A GSM security alarm system that sends SMS alerts when motion is detected extends your home protection to wherever you are in India. When the PIR sensor detects an intruder, the Arduino immediately sends a text message to your mobile via a SIM800L or SIM900 module – giving you real-time awareness even when kilometres away. This project is affordable, reliable on any Indian carrier, and covers situations where WiFi notifications fail.
Table of Contents
- Components
- GSM Module Setup
- Circuit Wiring
- Arduino Code
- Multi-Zone Configuration
- India-Specific Tips
- FAQ
Components
- Arduino Uno or Nano
- SIM800L GSM module (Rs 250-400) or SIM900 (Rs 500-800)
- HC-SR501 PIR sensor (Rs 30-80)
- Any Indian SIM card: Jio, Airtel, Vi, or BSNL work with SIM800L
- 3.7V LiPo or 4V regulated supply for SIM800L (CRITICAL: 5V from Arduino will damage it)
- 100uF 16V capacitor across SIM800L power pins to handle GSM transmit bursts
- 5V relay module for siren or light activation
- Buzzer for local alarm
GSM Module Setup
The SIM800L is the most popular GSM module in India. Key setup requirements:
- Power: Requires 3.4-4.4V supply, NOT 5V. Use a dedicated 3.7V LiPo or a 4V regulator (LM317 set to 4V) with 2A current capability. The SIM800L draws up to 2A peak during GSM transmission.
- Antenna: Use the included spring antenna or a 868MHz GSM antenna – significantly improves signal in areas with weak coverage (common in Indian rural and suburban areas).
- SIM card: All Indian carriers (Jio, Airtel, Vi, BSNL) work with SIM800L for SMS. Jio SIMs require VoLTE settings and may not work for voice calls on SIM800L (SMS only is fine).
- AT commands: Test with Arduino Serial monitor at 9600 baud before integrating into the alarm circuit.
// Test AT commands (run with Serial Monitor at 9600 baud)
AT // Module check - should respond OK
AT+CPIN? // SIM check - +CPIN: READY = SIM detected
AT+CSQ // Signal: +CSQ: 15,0 (0-31, higher = better)
AT+CMGF=1 // Set SMS text mode
AT+CMGS="+919876543210" // Enter phone number with India country code
Test SMS message // Type your message
// Press Ctrl+Z (or send byte 26) to send
Circuit Wiring
- PIR OUT to Arduino D2 (interrupt pin)
- SIM800L TXD to Arduino D10 (SoftwareSerial RX)
- SIM800L RXD to Arduino D11 (SoftwareSerial TX) via 1k/2k voltage divider
- SIM800L VCC to 4V regulated supply (NOT 5V)
- 100uF capacitor across SIM800L VCC and GND
- Relay IN to D8, siren to relay COM/NO
- Buzzer + to D9
Arduino Code
#include <SoftwareSerial.h>
SoftwareSerial gsm(10, 11); // RX, TX
#define PIR_PIN 2
#define RELAY_PIN 8
#define BUZZER_PIN 9
String PHONE = "+919876543210"; // Your phone number with country code
bool armed = true;
unsigned long lastSMS = 0;
const unsigned long SMS_COOLDOWN = 60000; // 1 min between SMS
void sendSMS(String msg) {
gsm.println("AT+CMGF=1"); delay(500);
gsm.println("AT+CMGS="" + PHONE + """); delay(500);
gsm.print(msg);
gsm.write(26); // Ctrl+Z
delay(3000);
}
void setup() {
Serial.begin(9600);
gsm.begin(9600);
pinMode(PIR_PIN, INPUT);
pinMode(RELAY_PIN, OUTPUT); digitalWrite(RELAY_PIN, HIGH);
pinMode(BUZZER_PIN, OUTPUT);
delay(3000); // SIM800L startup time
gsm.println("AT+CMGF=1"); // SMS text mode
delay(500);
}
void loop() {
if(armed && digitalRead(PIR_PIN) == HIGH) {
// Trigger alarm
digitalWrite(RELAY_PIN, LOW); // Siren ON
digitalWrite(BUZZER_PIN, HIGH);
// Send SMS if cooldown elapsed
if(millis() - lastSMS > SMS_COOLDOWN) {
sendSMS("ALERT: Motion detected at your home! Check immediately.");
lastSMS = millis();
}
delay(30000); // Keep alarm on 30 seconds
digitalWrite(RELAY_PIN, HIGH);
digitalWrite(BUZZER_PIN, LOW);
}
delay(200);
}
Multi-Zone Configuration
For a 3BHK home with multiple entry points:
- Connect one PIR sensor per zone (front door, back door, bedroom window) to separate Arduino input pins
- Name each zone in the SMS message: ‘ALERT: Zone 2 (Bedroom window) triggered’
- Use an Arduino Mega for 8+ zones with individual zone enable/disable switches
- Add a master arm/disarm button with 30-second entry delay for the main entrance zone
India-Specific Tips
- SMS vs WhatsApp alerts: SMS is more reliable for security alerts in India as it works even on 2G and without a data plan. WhatsApp requires active internet and may be delayed.
- Jio SIM note: Jio SIMs work for SMS on SIM800L but voice calls may not work (VoLTE-only network). For voice call alerts, use an Airtel or Vi prepaid SIM.
- Power cuts: Add a 3.7V 2000mAh LiPo battery as UPS for the alarm system. A TP4056 charge controller keeps it topped up from 5V mains adapter. Provides 12-24 hours of alarm standby during power outages.
- SIM800L startup: Always allow 5-10 seconds after power-on before sending AT commands. The module needs time to register on the network.
Frequently Asked Questions
Why is my SIM800L not sending SMS?
Most common causes: (1) Power supply issue – SIM800L needs 3.4-4.4V at 2A. Arduino 5V or underpowered USB supply causes failure. Always use a dedicated 4V/2A supply with 100uF bypass capacitor. (2) Network registration – verify with AT+CREG? response 0,1 (home network). (3) SMS mode not set – send AT+CMGF=1 before every SMS session. (4) Phone number format – use +91XXXXXXXXXX with country code for Indian numbers.
Which Indian carrier works best with SIM800L?
Airtel and Vi (Vodafone Idea) prepaid SIMs work most reliably with SIM800L for both SMS and voice calls. Jio works for SMS but not voice calls due to VoLTE-only network architecture. BSNL works everywhere but signal is weakest in many urban areas. For rural India, BSNL and Airtel often have better 2G/3G coverage than Jio in remote districts.
How do I prevent false SMS alerts from PIR triggers?
Implement a 2-trigger confirmation: alarm only fires if PIR triggers twice within 10 seconds. This eliminates single false triggers from pets, temperature gradients, and ceiling fan air movement. Also implement a cooldown period (1-5 minutes) between SMS sends to prevent SMS flooding when an intruder moves repeatedly in the detection zone.
Can I call instead of SMS for urgent alerts?
Yes – use AT+ATD+919876543210; command to initiate a voice call from SIM800L. The called party hears whatever the microphone connected to the module picks up – allowing you to listen to ambient sound at the alarm location. This requires a non-Jio SIM for voice calls. Auto-answer at the remote end: use AT+ATA command on a second SIM800L at your location.
Is it legal to trigger alarms and send SMS from a private alarm system in India?
Fully legal for personal security use. Private alarms and automated SMS notifications from personal properties are not regulated. If the alarm system triggers in error and disturbs neighbours regularly, there may be civil noise complaints. Calibrate PIR sensitivity and implement false-trigger filtering to minimise unwanted activations.
Add comment