8 Channel Home Automation using GSM Module SIM 900A

8 Channel Home Automation using GSM Module SIM 900A

  • In this article, we will make GSM based Homeautomation system in which we control total 8 no. of Devices and We can also check the status of our devices either it is ON or OFF.
  • This project is useful for remote location where internet connectivity is not available.
  • By using GSM Module we can control our home appliances by sending an SMS from anywhere in the world. and also we can check the real time status of appliances.
  • For making of this project I have used GSM Module SIM900A & Arduino Nano.
  • To make this project look professional and to use it in real-life, I designed the custom PCB for it.


Components Required.

For this project we need

1.GSM Module SIM900A.
2.Arduino Nano.
3.Female Header.
4.5v Relay.
5.1Kohm Resistor.
6.Terminal connecter.
7.BC547 NPN Transistor.

Designing the PCB.

To design the circuit and PCB, we used EasyEDA which is a browser based software to design PCBs.

Designing the circuit works like in any other circuit software tool, you place some components and you wire them together. 

Then, you assign each component to a footprint.

Having the parts assigned, place each component. When you’re happy with the layout, make all the connections and route your PCB.

Save your project and export the Gerber files.

Ordering the PCBs at PCBWay.

This project is sponsored by PCBWay. PCBWay is a full feature Printed Circuit Board manufacturing service.

Turn your DIY breadboard circuits into professional PCBs – get 10 boards for approximately $5 + shipping (which will vary depending on your country).

Once you have your Gerber files, you can order the PCB. Follow the next steps.

1. Download the Gerber files – click here to download the .zip file.

2. Go to PCBWay website and open the PCB Instant Quote page. 


3. PCBWay can grab all the PCB details and automatically fills them for you. Use the “Quick-order PCB (Autofill parameters)”.

4. Press the “+ Add Gerber file” button to upload the provided Gerber files.

And that’s it. You can also use the OnlineGerberViewer to check if your PCB is looking as it should.

Now select the shipping method , the one you prefer and has cost efficient.

You can increase your PCB order quantity and change the solder mask color. I’ve ordered the Black color.

Once you’re ready, you can order the PCBs by clicking “Save to Cart” and complete your order.

PCBWay has lots of other staggering solder mask, Now they can produce pink, orange, grey, even the transparent solder mask. 

Apart from this they also provide Black core PCB.

After approximately one week using the DHL shipping method, I received the PCBs at my place.

As usual, everything comes well packed, and the PCBs are really high-quality. 

The letters on the silkscreen are really well-printed and easy to read. Additionally, the solder sticks easily to the pads.

CODE.

Click here to download the Code.

//THIS CODE IS WRITTEN BY ASHISH MAURYA (TECHNOLAB CREATION),MODIFY AND USE IT TO UR PROJECT
// Variable to store text message
String textMessage;

// Create a variable to store LIGHTS state
String light1State = "LOW";
String light2State = "LOW";
String light3State = "LOW";
String light4State = "LOW";
String light5State = "LOW";
String light6State = "LOW";
String light7State = "LOW";
String light8State = "LOW";


// LEDS connected to pin 3,4,5,6,7,8,9,10
const int light1 = 10;
const int light2 = 9;
const int light3 = 8;
const int light4 = 7;
const int light5 = 6;
const int light6 = 5;
const int light7 = 4;
const int light8 = 3;


void setup() {
 
  // Set lights as OUTPUT
  pinMode(light1, OUTPUT);
  pinMode(light2, OUTPUT);
  pinMode(light3, OUTPUT);
  pinMode(light4, OUTPUT);
  pinMode(light5, OUTPUT);
  pinMode(light6, OUTPUT);
  pinMode(light7, OUTPUT);
  pinMode(light8, OUTPUT);
 

  // By default the leds is on
  digitalWrite(light1, LOW);
  digitalWrite(light2, LOW);
  digitalWrite(light3, LOW);
  digitalWrite(light4, LOW);
  digitalWrite(light5, LOW);
  digitalWrite(light6, LOW);
  digitalWrite(light7, LOW);
  digitalWrite(light8, LOW);
  
 
  
  // Initializing serial commmunication
  Serial.begin(19200);

  // Give time to your GSM shield log on to network
  delay(20000);

  // AT command to set SIM900 to SMS mode
  Serial.print("AT+CMGF=1\r"); 
  delay(100);
  // Set module to send SMS data to serial out upon receipt 
  Serial.print("AT+CNMI=2,2,0,0,0\r");
  delay(100);
}

void loop(){
  if(Serial.available()>0){
    textMessage = Serial.readString(); 
    textMessage.toUpperCase();   
    delay(10);
  } 
  if(textMessage.indexOf("LIGHT1ON")>=0){
    // Turn on red led and save current state
    digitalWrite(light1, HIGH);
    light1State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT1OFF")>=0){
    // Turn off red led and save current state
    digitalWrite(light1, LOW);
    light1State = "off"; 
    textMessage = ""; 
  }
   if(textMessage.indexOf("LIGHT2ON")>=0){
    // Turn on blueled and save current state
    digitalWrite(light2, HIGH);
    light2State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT2OFF")>=0){
    // Turn off blueled and save current state
    digitalWrite(light2, LOW);
    light2State = "off"; 
    textMessage = ""; 
  }
   if(textMessage.indexOf("LIGHT3ON")>=0){
    // Turn on green led and save current state
    digitalWrite(light3, HIGH);
    light3State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT3OFF")>=0){
    // Turn off grrenled and save current state
    digitalWrite(light3, LOW);
    light3State = "off"; 
    textMessage = ""; 
  }
   if(textMessage.indexOf("LIGHT4ON")>=0){
    // Turn on red led and save current state
    digitalWrite(light4, HIGH);
    light4State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT4OFF")>=0){
    // Turn off red led and save current state
    digitalWrite(light4, LOW);
    light4State = "off"; 
    textMessage = ""; 
  }
  
   if(textMessage.indexOf("LIGHT5ON")>=0){
    // Turn on red led and save current state
    digitalWrite(light5, HIGH);
    light5State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT5OFF")>=0){
    // Turn off red led and save current state
    digitalWrite(light5, LOW);
    light5State = "off"; 
    textMessage = ""; 
  }
  
   if(textMessage.indexOf("LIGHT6ON")>=0){
    // Turn on red led and save current state
    digitalWrite(light6, HIGH);
    light6State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT6OFF")>=0){
    // Turn off red led and save current state
    digitalWrite(light6, LOW);
   light6State = "off"; 
    textMessage = ""; 
  }
  
   if(textMessage.indexOf("LIGHT7ON")>=0){
    // Turn on red led and save current state
    digitalWrite(light7, HIGH);
    light7State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT7OFF")>=0){
    // Turn off red led and save current state
    digitalWrite(light7, LOW);
    light7State = "off"; 
    textMessage = ""; 
  }
  
   if(textMessage.indexOf("LIGHT8ON")>=0){
    // Turn on red led and save current state
    digitalWrite(light8, HIGH);
    light8State = "on"; 
    textMessage = "";   
  }
  if(textMessage.indexOf("LIGHT8OFF")>=0){
    // Turn off red led and save current state
    digitalWrite(light8, LOW);
    light8State = "off"; 
    textMessage = ""; 
  }
  ///////////////////////////////////////////////////////////////
  if(textMessage.indexOf("LIGHT1STATE")>=0){
    String message = "light1 is " + light1State;
    sendSMS(message);
    textMessage = "";
  }
  if(textMessage.indexOf("LIGHT2STATE")>=0){
    String message = "light2 is " + light2State;
    sendSMS(message);
    textMessage = "";
  }
  if(textMessage.indexOf("LIGHT3STATE")>=0){
    String message = "light3 is " + light3State;
    sendSMS(message);
    textMessage = "";
  }
    if(textMessage.indexOf("LIGHT4STATE")>=0){
    String message = "light4 is " + light4State;
    sendSMS(message);
    textMessage = "";
  }
    if(textMessage.indexOf("LIGHT5STATE")>=0){
    String message = "light5 is " + light5State;
    sendSMS(message);
    textMessage = "";
  }
    if(textMessage.indexOf("LIGHT6STATE")>=0){
    String message = "light6 is " + light6State;
    sendSMS(message);
    textMessage = "";
  }
    if(textMessage.indexOf("LIGHT7STATE")>=0){
    String message = "light7 is " + light7State;
    sendSMS(message);
    textMessage = "";
  }
    if(textMessage.indexOf("LIGHT8STATE")>=0){
    String message = "light8 is " + light8State;
    sendSMS(message);
    textMessage = "";
  }
}  

// Function that sends SMS
void sendSMS(String message){
  // AT command to set SIM900 to SMS mode
  Serial.print("AT+CMGF=1\r"); 
  delay(100);

  // REPLACE THE X's WITH THE RECIPIENT'S MOBILE NUMBER
  // USE INTERNATIONAL FORMAT CODE FOR MOBILE NUMBERS
   Serial.println("AT + CMGS = \"+91XXXXXXXXXX\""); 
  delay(100);
  // Send the SMS
  Serial.println(message); 
  delay(100);

  // End AT command with a ^Z, ASCII code 26
  Serial.println((char)26); 
  delay(100);
  Serial.println();
  // Give module time to send SMS
  delay(5000);  
}

Replace the ‘X’s with the recipient’s mobile number & use international format code for mobile nubers.

After doing this modification upload the code into your arduino nano  board after selecting right board and COM Port.

Connect GSM Module to homeautomation PCB as shown in diagram below.

Connection for bulb.

Connect all of your homeappliances as shown in the schematic below.

Thank you so much for reading, Comment below if you have any query.

5 thoughts on “8 Channel Home Automation using GSM Module SIM 900A

  1. Sir,
    I want to make project for study purpose in college ,so i want to do this project for submission in college please give me the circuit diagram for this project, so i think that you support for my submission project for study
    Thank you sir.

  2. Sir hear we can give signal from our mobile like on and off but I need signal from gsm like if light is on or off example if light is off or on I need that msg from gsm i,e light is on

Leave a Reply

Your email address will not be published. Required fields are marked *