TIMOTHY MWALA
Published © GPL3+

Build Your Own SIM800L GSM Security Calls Alert🎉

Unleash security with a cloud-free marvel! Motion detection meets instant calls. DIY your fortress using ESP8266, GSM800L & PIR sensor. "

BeginnerFull instructions provided1 hour514
Build Your Own SIM800L GSM Security Calls Alert🎉

Things used in this project

Hardware components

Tripler Adapter
×1
PIR MOTION SENSOR
×1
ESP8288
×1
GSM MODULE
×1

Story

Read more

Schematics

Set up

This How you components should be aligned

Code

code for esp8266

C/C++
Remember to install the included libraries
#include <Wire.h>
#include <SoftwareSerial.h>

SoftwareSerial sim800l(D7, D6);

const int PIR = D3;
int PIRState = 0;

void setup()
{
  Serial.begin(9600);
  sim800l.begin(9600);

  Serial.println("Initializing...");
  delay(1000);

  pinMode(PIR, INPUT);

  sim800l.println("AT");
  updateSerial();

  sim800l.println("ATH"); //hang up
  updateSerial();
}

void loop()
{
  PIRState = digitalRead(PIR);

  if (PIRState == HIGH) {
    Serial.println("Sensor detects motion");
    Call(); // call every time motion is detected
    delay(2000); // Delay for stability
  } else {
    Serial.println("No motion detected");
  }

  while (sim800l.available()) {
    Serial.write(sim800l.read());
  }
}

void Call()
{
  sim800l.println("ATD+ xxxxxxxxxxxxxxxxxxxxxxx;"); //replace with your countrycode and phone number to be called
  delay(500);
  sim800l.print("Security alert | Intruder detected!");
  sim800l.write(26); // Send Ctrl+Z to indicate end of call
  delay(500); // Give time for the module to process
  while (sim800l.available()) {
    Serial.write(sim800l.read());
  }
}

void updateSerial()
{
  while (sim800l.available()) {
    char c = sim800l.read();
    Serial.write(c);
  }
}

Credits

TIMOTHY MWALA

TIMOTHY MWALA

23 projects • 13 followers
I am an Embedded engineer who like prototyping

Comments