How to send a message to my phone that my Arduino system is on when turning on my Arduino i have installed a GSM shield on the Arduino to create security alarm system using PIR SENSOR when ever there motion I will receive a call to my phone.
but i want to add also a line of code which can make my system send me a txt message stating that my system is turned on so i can make sure that when ever i turn my system on i can doule check by getting a message that says that system is turned on successfully
i dont know how to start doing that.
this is the code i did:
int PIR = 6;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(96000);
 pinMode (PIR , INPUT );
}


void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead (PIR == HIGH)){
  Serial.println(&quot;thief detected&quot;);
  delay (200);
  Serial.println (&quot;ATD+0197263315;&quot;);
  delay(1000);
  Serial.println(&quot;ATH&quot;);
  delay(1000);
  
  }
  else digitalWrite (PIR, LOW );
    
}
You can send an SMS using the Arduino GSM library. Here is a bare bones sketch that sends one pre-set SMS when it starts up, based on this tutorial:
#include &lt;GSM.h&gt;

#define PINNUMBER &quot;1234&quot;
#define REMOTENUMBER &quot;07123456789&quot;
#define TXTMESSAGE &quot;System started!&quot;

GSM gsmAccess;
GSM_SMS sms;

void setup() {
  boolean notConnected = true;

  while (notConnected) {
    if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
      notConnected = false;
    } else {
      delay(1000);
    }
  }

  sms.beginSMS(REMOTENUM);
  sms.print(TXTMESSAGE);
  sms.endSMS();
}

void loop() {
}

If you can't or don't want to use the GSM library, it should also be possible to send an SMS by using the SoftwareSerial library to control your GSM shield using AT codes. Here's a tutorial on this approach, which is lighter weight but might be more fiddly to get working, especially if you need a PIN for your SIM card.