🔒 Closed Arduino Motion Security SMS notification Code

Status
Not open for further replies.

Jenman

Forum Veteran
this is the best combination of PIR motion Sensor and A6 gsm Module
A6 Minimum System GPRS GSM-1000x750.webp


int lamp = 8; // choose the pin for the RELAY
int inputPin = 9; // choose the input pin (for PIR sensor)
int val = 0; // variable for reading the pin status

char phone_no[]="your mobile number here";

void setup() {
pinMode(lamp, OUTPUT); // declare lamp as output

pinMode(inputPin, INPUT); // declare sensor as input

Serial.begin(9600);
delay(300);

Serial.println("AT+CMGF=1");
delay(2000);
Serial.print("AT+CMGS=\"");
Serial.print(phone_no);
Serial.write(0x22);
Serial.write(0x0D); // hex equivalent of Carraige return
Serial.write(0x0A); // hex equivalent of newline
delay(2000);
Serial.print("Master may humihipo saakin");
delay(500);
Serial.println (char(26));//the ASCII code of the ctrl+z is 26

}

void loop(){

val = digitalRead(inputPin); // read input value

Serial.println(val);

if( val== 1) {

digitalWrite(lamp,HIGH); // turn ON the lamp

} else {

digitalWrite(lamp,LOW); // turn OFF the lamp

}

}




int lamp = 8; // choose the pin for the RELAY
int inputPin = 9; // choose the input pin (for PIR sensor)
int val = 0; // variable for reading the pin status

char phone_no[]="your mobile number here";

void setup() {
pinMode(lamp, OUTPUT); // declare lamp as output

pinMode(inputPin, INPUT); // declare sensor as input

Serial.begin(9600);
delay(300);

Serial.println("AT+CMGF=1");
delay(2000);
Serial.print("AT+CMGS=\"");
Serial.print(phone_no);
Serial.write(0x22);
Serial.write(0x0D); // hex equivalent of Carraige return
Serial.write(0x0A); // hex equivalent of newline
delay(2000);
Serial.print("Master may humihipo saakin");
delay(500);
Serial.println (char(26));//the ASCII code of the ctrl+z is 26

}

void loop(){

val = digitalRead(inputPin); // read input value

Serial.println(val);

if( val== 1) {

digitalWrite(lamp,HIGH); // turn ON the lamp

} else {

digitalWrite(lamp,LOW); // turn OFF the lamp

}

}

 
Saan naka bibili ng ganyan boss, eto yata ung toolna ginagamitmi appletech 752 na katulong nya sa pag bypass ng icloud sa mga old ipads.
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 329
    Views
  • 3
    Participants
Last reply from:
PHC-sinyangPH

Trending Topics

Online now

Members online
1,104
Guests online
3,375
Total visitors
4,479

Forum statistics

Threads
2,331,798
Posts
29,260,433
Members
1,147,824
Latest member
samxkb
Back
Top