Load ON/OFF by GSM sim808 Module. Load on off by mobile message.

GSM SIM808 is a good quality GSM Module .It is possible to do different projects. When it comes to projecting with GSM, most of the projects are loaded on and off via message .This means that you can load and unload a message on your mobile phone. It can be a fan or a motor or a light .Now I will show you how to load ON / OFF through Arduino coding by interfacing with Arduino and GSM modules .First of all let’s find out what components are needed to do this project.

  1. Arduino UNO R3 Board.
  2. GSM SiM808 Module.
  3. 1 Realy Module.
  4. Jumper wire.
  5. Bread Board.
  6. Led.
  7. Mobile SIM.
  8. Bulb Holder.
  9. Bulb.
  10. Mobile Phone.

If you want to project with GSM SIM 808, first you have to have a good idea about its pin diagram. Below I show the pin diagram of it you will see a little more carefully.

GSM Sim808
GSM Sim808

 

With GSM SIM 808 not only load on and off but with it you can also project GPS control system. I will show you later how you can do the best GPS project with GSM sim808. Now I will show you just how to load on and off with GSM SIM 808 and Arduino interface.

With it you can turn single phase motor on and off through three phase motor message. Now let’s show the pin diagram or connection diagram of how to load on and off by interfacing between GSM SIM 808 and Arduino and next I will show the coding.

 

GSM sim808 Module
GSM sim808 Module

In the image above I showed the connection with only one LED. Here you can use the driver circuit to turn on any AC load such as single phase motor, three phase motor, on and off. Notice the image below.

Hope you understand how to turn on and off AC using driver circuit. See above for projecting with GSM I showed pin diagram or connection diagram. You will make the connection according to this diagram. Now for coding you must add a library file to Arduino IDE Software.

Download this library file from below.

Download the library file from here : Download Here

Code:

 

 #include <DFRobot_sim808.h>  
 #include <SoftwareSerial.h>  
 #define PIN_TX  7  
 #define PIN_RX  8  
 int light = 13;  
 #define MESSAGE1 "Load is on"  
 #define MESSAGE2 "Load is off"  
 SoftwareSerial mySerial(PIN_TX,PIN_RX);  
 DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,  
 #define PHONE_NUMBER "01743175953"   
 #define MESSAGE_LENGTH 160  
 #define MESSAGE "Load is on"  
 #define MESSAGE1 "Load is off"  
 char gprsBuffer[64];  
 char *s = NULL;  
 char message[MESSAGE_LENGTH];  
 int messageIndex = 0;  
 String rmsg;  
 String asish = String("load on");  
 String asish1 = String("load off");  
 char phone[16];  
 char datetime[24];  
 //DFRobot_SIM808 sim808(&Serial);  
 void setup() {  
  pinMode(light,OUTPUT);  
  mySerial.begin(9600);  
  Serial.begin(9600);  
  //******** Initialize sim808 module *************  
  while(!sim808.init()) {  
    Serial.print("Sim808 init error\r\n");  
    delay(1000);  
  }  
  delay(3000);   
  Serial.println("Init Success, please call or send SMS message to me!");  
  // sim808.callUp(PHONE_NUMBER);  
  //sim808.sendSMS(PHONE_NUMBER,MESSAGE);   
 }  
 void loop() {  
  Read_SMS();  
 }  
 void Read_SMS()  
 {  
   messageIndex = sim808.isSMSunread();  
   Serial.print("messageIndex: ");  
   Serial.println(messageIndex);  
   //*********** At least, there is one UNREAD SMS ***********  
   if (messageIndex > 0) {   
    sim808.readSMS(messageIndex, message, MESSAGE_LENGTH, phone, datetime);  
    delay(200);  
      rmsg=String(message);  
       if(asish == message)  
      {  
        digitalWrite(13, HIGH);  
        sim808.sendSMS(PHONE_NUMBER,MESSAGE);  
         delay(20);  
         sim808.deleteSMS(messageIndex);   
      }   
     if(asish1 == message)  
      {  
        digitalWrite(13, LOW);  //For 5 sec motor stsr  
        sim808.sendSMS(PHONE_NUMBER,MESSAGE1);  
         delay(20);  
         sim808.deleteSMS(messageIndex);   
      }        
    //***********In order not to full SIM Memory, is better to delete it**********  
    sim808.deleteSMS(messageIndex);  
    Serial.print("From number: ");  
    Serial.println(phone);   
    Serial.print("Datetime: ");  
    Serial.println(datetime);      
    Serial.print("Recieved Message: ");  
    Serial.println(message);    
   }  
 }  

 

Copy the coding that I have shown you above and paste the Arduino IDE software. And the library file that I have given you above, you must download the library file and add it with the Arduino IDE software.

 

100% LikesVS
0% Dislikes

Leave a Comment