Introduction: SMS Based Home Automation System Using 1SHEELD

Picture of SMS Based Home Automation System Using 1SHEELD

Hey friends, this first Instructable of a 16 year old. 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 Required

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

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.

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 :)

Comments

tomatoskins (author)2015-05-10

Really cool project! Thanks for sharing!

Thank you!

mikef14 (author)Tanishq Jaiswal2016-12-12

good day sir.. can i have the schematic diagram of the the triac and copler.. also the whole wiring diagram of this project.. its interesting to build 1 to because its cheaper. thanks

Tanishq Jaiswal (author)mikef142016-12-13

mikef14, here is my instructable on it--

https://www.instructables.com/id/DIY-Solid-State-Re...

here is the video tutorial--

mcalinisan (author)2015-09-13

good day, can i use a pre-made

2 Channel 5V 10A Relay Module

instead of making one?

Yes you can, and also you do not have to make driver circuit for it.

smandal13 (author)2015-08-22

nice project

jamilmk (author)2015-08-17

keep it up.

stringstretcher (author)2015-05-12

Do you mean I can connect this to my lights at home and then use the accelerometer to make the lights blink wildly? That's a good enough reason to build one!

JobJ (author)stringstretcher2015-06-03

That's really a weird idea! :)

Thats right! It will be a lot of fun too!

pmshah (author)2015-05-14

There is a company in Hyderabad that sells ready made unit with 4 controlled outputs for around Rs. 2000/-. All you need is to insert a GSM sim card.

JobJ (author)pmshah2015-06-03

If you are more fond of buying something than home-brewing, instructables is not the place for you.

hasathram3334 (author)pmshah2015-05-27

could you please share the address of the company

Tanishq Jaiswal (author)pmshah2015-05-14

Where did that company sells their products?

Raphango (author)2015-05-21

Interesting... =D

Tanishq Jaiswal (author)Raphango2015-05-22

Thank you! =D

Beetlesmart85 (author)2015-05-13

i usually use the Altium to do the design, but there are always some problems when generate gerber file. sometimes, the file is not complete. can you give me some advise?

by the way, after comparing some manufacturers, i found the china manufacturer's price is competitive, a worthy large production country. jaja. i had brought from pcbpool for one time, very good quality, but the price is expensive. my friend recommend to use: www.pcbway.com/j, a manufacturer from china, it's good, low price with good quality, i was amazing. and use this url, can get a $5 usd coupons, jaja, so good. hope it can help you.

diy_bloke (author)Beetlesmart852015-05-13

your link is not correct. it is www.pcbway.com . They are good, but it pays to compare. If you need small pcb's in quantity of less than 5, OSHPark https://oshpark.com/ is cheaper, especially as the shipping is free. Larger surfaces, or if you need more than 3, at a certain moment it is cheaper to use pcbway.com

Beetlesmart85 (author)diy_bloke2015-05-16

Hi dear, thank you, there is something wrong with the link, this is the correct link: www.pcbway.com/j , it should be without ",". now it's ok, with this link, you can get 5 coupons. jaja.

diy_bloke (author)Beetlesmart852015-05-16

5 dollar coupon. not bad. That shifts the balance

Will it ship to india?

They state they will ship for free to anywhere in the world

diy_bloke (author)diy_bloke2015-05-14

this is an example of their product. Good quality

eweirbach (author)2015-05-12

Pardon my noob question but is this to turn stuff on and off remotely with your cell phone ? And will it work no matter where you are or do you have to be in your house near the device ?
Thanx ED-D

Yes, you can control your home from anywhere in the world because you can send SMS from any part of the world.

Lee Wilkerson (author)2015-05-12

Excellent project. I have been using the X10 home automation system for about 30 years for which I currently have 15 remote modules plus computer interface and software for Linux and Winduhs. I buy a couple more modules each month.

I am slowly getting stuff for Arduino, and I look forward to learning Arduino programming.

Thank you.
All the best for your start and by my my personal experience I can say that you will have lot of fun in learning :)

diy_bloke (author)2015-05-12

I am happy you found my SSR instructable useful :-)

Yes it was so useful for me as well as others. Thanks a lot for sharing it :)

BoKKeR (author)2015-05-11

can it be run from a battery ? lets say I need it to stay alive for 5 days what kind of battery should I look for ?

BoKKeR (author)BoKKeR2015-05-11

with a actual gsm modul ?

Tanishq Jaiswal (author)BoKKeR2015-05-11

Choose from Sealed lead acid or lithium polymer

honey181 (author)2015-05-11

Optocouplers. O yeah! I didn't noticed at first. Haha..! Good! ;)

Tanishq Jaiswal (author)honey1812015-05-11

:) thank you

honey181 (author)2015-05-10

Its a better and cheaper idea to use triacs instead of relays. But consider if by chance the gate terminal of triac comes in contact with its M1 or M2 terminal, what could possibly happen..... ;) So i wud suggest you to use photo-triacs in place of regular triacs as it will isolate your sheeld circuitry from the power mains. And nice project by d way. Keep it up..! :)

Tanishq Jaiswal (author)honey1812015-05-10

I used optocouplers MOC3021 for complete isolation, if somehow flux even reaches at gate then it will affect NPN transistors only

About This Instructable

30,926views

488favorites

License:

Bio: I'm a 17yr old guy from India and love making projects on electronics, specially with arduino. Internet is the only guidance I have and ... More »
More by Tanishq Jaiswal:GyroCube DIY Solid State RelayDIY ULTRABRIGHT LED!
Add instructable to: