USB-TTL/USB-STC-ISP driver setup

Gsm sim800l based home security system using arduino and pir sensor * Phone Calling/ sms

  i  going show,  

Gsm sim800l based home security system using arduino and pir sensor


        * Gsm sim800l based home security system .

        * Arduino ,pir sensor & Gsm sim800l ,

         *  Phone Calling. 

        *  Phone Calling  Project 


1. Circuit Diagram

2.  Detail project in video


 3. Project Code Call....

//C++
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4); //SIM800L Tx & Rx is connected to Arduino #3 & #2
int b = 8;
int state;
 
void setup()
{ Serial.begin(9600);
 mySerial.begin(9600);
 pinMode(b, INPUT);
}
 
void loop()
{
state = digitalRead(b);
if(state == HIGH)
{delay(5000);
 Serial.println(" barton ok");
call();
delay(500);
} }
void call()
{Serial.println("Initializing..."); 
  delay(1000);
  mySerial.println("AT"); //Once the handshake test is successful, i t will back to OK
  updateSerial();
  mySerial.println("ATD+ +8801749058593;"); //  change ZZ with country code and xxxxxxxxxxx with phone number to dial
  updateSerial();
  delay(20000); // wait for 20 seconds...
  mySerial.println("ATH"); //hang up
  updateSerial();}
 
void updateSerial()
{delay(500);
while (Serial.available()) 
{ mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available()) 
{Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}}

  

4. Project Code sms....  


//C++
#include <SoftwareSerial.h>  
SoftwareSerial sim800l(3, 4); // RX,TX for Arduino and for the module it's TXD RXD, they should be inverted
int Button = 7;
int  State;
 //Button state
void setup()
{pinMode(Button, INPUT); 
  sim800l.begin(9600);   
  Serial.begin(9600);   
  delay(1000); }
 void loop()
{State = digitalRead(Button);  
 if (State == HIGH) 
  { Serial.println("Button pressed");   
    delay(200);                         
    SendSMS(); }
  if (sim800l.available()){            
  Serial.write(sim800l.read());  } }
 void SendSMS()
{ Serial.println("Sending SMS...");               //Show this message on serial monitor
  sim800l.print("AT+CMGF=1\r");                   //Set the module to SMS mode
  delay(100);
  sim800l.print("AT+CMGS=\"+8801789807774\"\r");  //Your phone number don't forget to include your country code, example +212123456789"
  delay(500);
  sim800l.print("Security Breeze plz ceeck");       //This is the text to send to the phone number, don't make it too long or you have to modify the SoftwareSerial buffer
  delay(500);
  sim800l.print((char)26);// (required according to the datasheet)
  delay(500);
  sim800l.println();
  Serial.println("Text Sent.");
  delay(500);
} 

Comments