SMS based Home Automation system using 1SHEELD

Written by: techguru

Picture of SMS based Home Automation system using 1SHEELD

Hey friends, this my first instructable and just turned 16yr old two months ago.

In this instructable I will show how to make 5 channel SMS based Home Automation system using 1sheeld. Instead of using electromagnetic relays I've built my own cheap SSRs using triacs with an indication LED.

A great thanks goes to Amr Saleh and the whole team of 1sheeld.

Step 1: About 1SHEELD

Picture of About 1SHEELD

If you know about the Arduino and its shields like GSM and WIFI, and also buying each of them for use is expensive. To replace them all with just one, the Egyptian inventors made a wonderful single shield which connects to your android smartphone via Bluetooth and uses all the sensors and connectivity of it. You can also use more than one shield at a time like GSM, WIFI, Accelerometer, Gyroscope etc.

1sheeld - http://www.1sheeld.com/






Now let us acquire the materials...

 

 

Step 2: Materials required

Picture of Materials requiredtemp_-684450257.jpgtemp_-1503283857.jpgtemp_1597816078.jpgtemp_-595115075.jpg

You require -
1. 1sheeld
2. Arduino ( Mega or Uno but every arduino should work)
3. USB cable
4. USB power supply (optional)
5. A laptop or PC to program arduino
6. Installed Arduino IDE

7. A plastic box or you can make an acrylic case as I did

8. Relays ( I made my own SSR with the help of this instructable but, I designed my own circuit because extra Snubber circuit was of no use, you can download it from here which is Express PCB file)

9. A driver circuit if you are not using the ready-made relay module ( I've made my own)

10. And the most important thing is, lot of guts to cope up with my English :D

Step 3: Place your 1sheeld correctly

Picture of Place your 1sheeld correctly

You need to place your 1sheeld correctly, confusion can arise while using with Arduino Mega.

Step 4: Download 1sheeld library

Picture of Download 1sheeld library 1s2.JPG

You need to download and place 1sheeld library from here-https://github.com/Integreight/1Sheeld-Arduino-Lib...

And then extract it to the location in libraries of arduino.

Step 5: The Code

Picture of The Code

Open arduino IDE then copy, paste this code and then upload.

In place of +1234567890 in the program add the phone number with country code from which the message will come to your phone

There are five pins- 13,12,11,10,9. and if you want to turn the pin 13 on and off, then you need to send the message "on13" for turning on and "off13" for off.

You can also send the message "on all" or "off all" to turn all the five pins on or off

And you may have noticed that programming 1sheeld is much easier than programming GSM shield for the same project.

You can also download the code from here.

I'm not a good programmer at all, and there my be lot of mistakes in the program and I will highly appreciate the suggestions for improvement.

<p>// Programmer: Tanishq Jaiswal<br>    // Email:      tanishq.jaiswal99@gmail.com    // Age:        15    // Library:    OneSheeld    // Shield:     1sheeld ( <a href="http://www.1sheeld.com" rel="nofollow"> <a href="http://www.1sheeld.com" rel="nofollow">  www.1sheeld.com  </a> </a> )    /*     A simple Example which will turn the pins on and     off while recieving specific messages from specific     phone.    5 pins which are used here pin: 13,12,11,10 and 9.       */</p><p>    /* Include 1Sheeld Library */    #include </p><p>        int ledPin13 =13 ;        /* led on pin 13 for debuging */    int ledPin12 =12;         /* led on pin 12 for debuging */    int ledPin11 =11;         /* led on pin 11 for debuging */    int ledPin10 =10;         /* led on pin 10 for debuging */    int ledPin9 =9;           /* led on pin 9 for debuging */    int ledpin =4;            /* led on pin 4 for debuging */</p><p>    void setup()    {      /* Start communication */       OneSheeld.begin();      /* This function invokeds receiveSms once any new messages are          received */      SMS.setOnSmsReceive(receiveSms);    }</p><p>    /* Nothing to loop on */    void loop()    {}</p><p>    /* Receiving Function for new SMS's */     void receiveSms(const char * number ,const char * text)    {      if(!strcmp(number,"+1234567890"))               /* phone number from which you will send the sms "PUT YOURS IN PLACE OF +1234567890" */      {        if(!strcmp(text,"on13"))                        /* Check if i need to open the light connected to (pin 13)*/        {          digitalWrite(ledPin13,HIGH);                  /* turn on the light (pin 13) */         }        if(!strcmp(text,"off13"))         {          digitalWrite(ledPin13,LOW);                   /* turn off the light(pin 13) */         }                if(!strcmp(text,"on12"))                        /* Check if i need to open the light (pin 12) */        {          digitalWrite(ledPin12,HIGH);                  /* turn on the light (pin 12) */         }        if(!strcmp(text,"off12"))                                     {          digitalWrite(ledPin12,LOW);                   /* turn off the light(pin 12) */        }                if(!strcmp(text,"on11"))                        /* Check if i need to open the light (pin 11) */        {          digitalWrite(ledPin11,HIGH);                  /* turn on the light (pin 11) */         }        if(!strcmp(text,"off11"))                {          digitalWrite(ledPin11,LOW);                   /* turn off the light(pin 11) */        }        if(!strcmp(text,"on10"))                        /* Check if i need to open the light (pin 10) */        {          digitalWrite(ledPin10,HIGH);                  /* turn on the light (pin 10) */         }        if(!strcmp(text,"off10"))                {          digitalWrite(ledPin10,LOW);                   /* turn off the light(pin 10) */        }        if(!strcmp(text,"on9"))                         /* Check if i need to open the light (pin 9) */        {          digitalWrite(ledPin9,HIGH);                   /* turn on the light (pin 9) */         }        if(!strcmp(text,"off9"))                {          digitalWrite(ledPin9,LOW);                    /* turn off the light(pin 9) */        }                if(!strcmp(text,"on all"))                {          digitalWrite(ledPin9,HIGH);          /* turn on the light(pin 9) */          digitalWrite(ledPin10,HIGH);         /* turn on the light(pin 9) */          digitalWrite(ledPin11,HIGH);         /* turn on the light(pin 9) */          digitalWrite(ledPin12,HIGH);         /* turn on the light(pin 9) */          digitalWrite(ledPin13,HIGH);         /* turn on the light(pin 9) */        }        if(!strcmp(text,"off all"))                {          digitalWrite(ledPin9,LOW);          /* turn off the light(pin 9) */          digitalWrite(ledPin10,LOW);         /* turn off the light(pin 9) */          digitalWrite(ledPin11,LOW);         /* turn off the light(pin 9) */          digitalWrite(ledPin12,LOW);         /* turn off the light(pin 9) */          digitalWrite(ledPin13,LOW);         /* turn off the light(pin 9) */        }        else        {          digitalWrite(ledpin,LOW);                    /* put any unused pin here (pin 4) */         }      }    }</p>

 

Step 6: Upload the code

Now all you need to do is upload the code to your arduino and once its done uploading jump to next step.

Step 7: Download 1sheeld app

Picture of Download 1sheeld app

Download it from Playstore, open it and then turn the Bluetooth on, connect to the 1sheeld and then select the SMS Shield.

Step 8: Ready your driver circuit and relays.

Picture of Ready your driver circuit and relays.IMG_20150510_212044.jpgIMG_20150510_212104.jpg

I've made a driver circuit using the 2n2222 NPN transistors.

For relays I will suggest to use the homemade one and the circuit is being made in Express PCB and the link is here. And also you need to tin the PCB and I used to tin by my own new method using soldering Iron.

NOTE: IF YOU ARE NOT EXPERIENCED TO WORK WITH HIGH VOLTAGE THEN YOU SHOULD USE LEDs IN PLACE OF ANY HIGH VOLTAGE APPLIANCE. AND I'M NOT RESPONSIBLE IF YOU HARM YOURSELF OR YOUR PROPERTY, USE PROPER PRECAUTIONS AND UNPLUG EVERYTHING EVEN BEFORE GOING NEAR TO IT.

 

 

 

 

Step 9: Put everything togeather

Picture of Put everything togeather

Just fix everything and make every connection.

I know that there may be a lot of suggestions for improvement of this project jumping in your mind, so please use the comment section and let me and others know.

As I told you this is my first Instructable, so sorry for all the mistakes that I made( I have no guidance other than internet) and I hope that you liked it.

Thank You :)

Leave a Reply