Arduino Projects

GSM Based Home Automation System Using Arduino


hey friend’s welcome in “DiY Projects Lab” In this project you’re going to build an GSM Home Automation System using arduino. where we  can control the home appliances (T.V. , BULB), using the simple GSM based phone, just by sending SMS through the phone.  In this Home Automantion System Project, no Smart phone is needed just the any old GSM phone you can control  any home electronic appliances, from anywhere anytime .

GSM Home Automation Working Explanation 

The brain of this project is an Arduino  nano board which in combination with GSM module . GSM wireless communication for controlling electronics home appliances , We send some commands like “#A.Start*”, “#A.stop *”  After receiving given commands by the Arduino through GSM module then Arduino send signal to relays for cut  ON or OFF.

Components For GSM Based Home Automation System Using Arduino 

You can get the components for Home automantion  from the links below

  1. Arduino nano    x1
  2. GSM module    x1
  3.  Relay Module   x1
  4. Conneting wire and LED
  5. Bulb
  6.  Holder

When you send SMS to GSM module by phone , then GSM receives that SMS and sends it to Arduino. then Arduino compare this command with predefined command .if it match with predefined command then then Arduino sends data to relay via relay for turning ON and OFF home appliances .

Here in this project we have used 1 zero watt bulb . Message Operation
1 #A.Start* Bulb ON
2 #A.Stop* Bulb OFF

GSM Module  

GSM module SIM900A

GSM module (Global System for Mobile Communications)   SIM900A Model is built with Dual Band GSM/GPRS based        used in many communication devices which are based on GSM technology.

There are various AT Commands like ATD to dial a call , ATA for answer a call, AT+CMGS to send the sms ,AT+CMGR to read the message etc.

We can use GSM module using these commands for any GSM Projects                                                                                     

Basic AT Command

1. To change sms sending mode : AT+CMGF=1


2. To read SMS in text mode : AT+CNMI=2,2,0,0,0


3. To make a call : ATD+916209403151; //replace X with number you want to call, change +60 to your country code


4. To disconnect / hangup call : ATH


5. To redial : ATDL


6. To receive a phone call : ATA   


GSM Based Home Automation System Using Arduino Circuit Diagram :



GSM Sim900A :

  • GSM Rx to Arduino Tx.
  • GSM Tx to Arduino Rx.
  • 5v to external 5v supply which can deliver up to 1 amp.
  • Ground to ground.

Relay :          

  • VCC to 5V                                 
  • GND to GND      
  • Relay to D1


CODE for GSM Based Home Automantion System

#include <SoftwareSerial.h> // Library for using serial communication
SoftwareSerial SIM900(7, 8); // Pins 7, 8 are used as used as software serial pins

String incomingData;   
String message = "";   
int relay_pin = 1;    // Initialized a pin for relay module

void setup()
  Serial.begin(115200); // baudrate 
  SIM900.begin(19200); // baudrate for GSM 

  pinMode(relay_pin, OUTPUT);    
  digitalWrite(relay_pin, HIGH);  

void loop()
  //Function for receiving sms

  // if received command is to turn on relay
    digitalWrite(relay_pin, LOW);
    message = "Led is turned ON";
  // if received command is to turn off relay
    digitalWrite(relay_pin, HIGH);
    message = "Led is turned OFF";

void receive_message()
  if (SIM900.available() > 0)
    incomingData = SIM900.readString(); 

void send_message(String message)
  SIM900.println("AT+CMGF=1");       delay(100);  
  SIM900.println("AT+CMGS=\"+916209403151\""); // Replace it with your number

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button