Remote control, especially when this no ethernet or Wifi in the outdoor, has been a very profound things in the past. When I was a child, I always image that I have an equipment which can control all home appliances. Now, this becomes a reality,with Arduino and GPRS modules and some other related modules. And, it is also quite easy, even for the beginners. Here I will step by step to show you how to remote control your home appliances via the GPRS/GSM SMS and relays.

At first, let me give a brief introduction about relay to you.
Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits). It acts as a “low voltage controlled switch to control high voltage”, For example, if you want to control power of your washer or air conditioner, which is oftern110v or 220v,by microchip such as AVR or PIC, it is necessary and safe to make your microchip control the relay first, and then control the power supply of those device with the relay.

With the GSM SMS, it is possible to control the relay remotely. You can send a message via phone to control the relay on&off. With this, it will convenient to control any device wirelessly, especially helpfully on irrigation, smart home, outdoor remote control etc.
So, let’s make such a “SMS controlled Relay” with Arduino, GPRS/GSM and a Relay module.

Step 1: Prepare your tools and parts.

Select the module you need, a Xduino, a GPRS/GSM module and relay module is essential. The GPRS/GSM and relay in “Shield” would be more Convenient if works with Arduino:
The modules I used in this application are as below:
Relay Shield
Notice that the Rated Current of the relay Is important, make sure it meets your requirements. Otherwise it maybe dangerous. Here, I use a 2A rating current relay, which is enough for my application to control a lamp. Usually, home appliances consume currents as below
Device Max current(A)
Electric Fan 1
Lamp 2
TV 2
Refrigerator 2
Microwave Oven 8
Air Conditioner Depends on the power, usually <20
Of course, you will need some tools, such as the Insulating tape, Scissors...

<p>im wondering if you can help me...... Im using the arduino uno r3 and when I send the text message it do anything..... I already check the serial monitor..... and if I send the message AT+CMGR=1 and then the second message it appears AT+CMGR=2 and so on and so on..... can you help me please? :)</p>
<p>Wondering if anyone has solved the problem many of us are having with this sketch. I also get the AT+CMGR printout on the serial monitor, but sending the &quot;ona&quot; sms to the shield does nothing. Thanks, Ron</p>
<p>Just when I was wondering whether It's possible, I found this. Thanks for sharing, gotta test this out!</p>
<p>How can you automatically delete sms ?</p>
Everything is okay..I programme arduino. ..then what is that you put void processgprsmsg() and void processsms() ? Sir I kindly request you. .can you tell me pls?
<p>Hi All this is an awesome project, i am going to be building this today, but i do not have an arduino, i'll be using an gsmcommander from gsmcommander.com awesome product.</p>
<p>Good Day. Sir. I would like to create the same project using Arduno Mega 2560 and Sim900d GSM shield. I also want to have a feedback message so that the user will know the status of the device. But I dont want to use any sensor. Is it possible that I can check the status of the device by using only the logic from the Arduino?</p>
<p>How can i make this work on a SIM900D based gsm shield? I seem to get stuck on the AT+CMGF=1 printout on the serial monitor.</p>
<p>The code is only if you send the commands through serial port. What commands can we use to send the sms from cell phone??</p>
<p>Hi.</p><p>I have an Arduino board mega 2560 and a sim900 gprs board.</p><p>Can you help with setup, how the two should be connected.</p><p>and what changes should be made in your program to the two can talk?</p>
<p>The program should be the same. You can have a test first.</p>
<p>wouldn't it be possible to say turn on or off a computer with a 860 watt power supply - by attaching the device to the power switch instead of the power supply?</p>
<p>thanks a lot...can you please tell me how to control using gprs rather than sms</p>
<p>This demo may help you. <a href="http://www.elecrow.com/wiki/index.php?title=GPRS/GSM_Shield_v1.0#A_Simple_Source_Code_Example" rel="nofollow"> http://www.elecrow.com/wiki/index.php?title=GPRS/...</a></p>
<p>Hello,</p><p>I have bought the items linked on this thread. I uploaded the sketch successfully using Arduino IDE. I followed all the steps but the module does not receive the SMS. When I put the SIM into a phone, the phone does receive the text. Can you please help?</p><p>Glenn. </p>
<p>Since my last post I have gotten the GSM module to receive SMS.</p><p>It tried the sketch again but the relay does not turn on.</p><p>Can you help with this please?</p>
Hi Glenn Hornibrook, You can test the voltage of the relay control pin to have a look.
<p>its not receiving the sms . what should i do?</p>
You can test it on serial monitor on the computer to have a look that whether the short message is received or not. <br>The is the wiki page using the gprs shield http://www.elecrow.com/wiki/index.php?title=GPRS/GSM_Shield_v1.0
<p>I have used ardiuno uno R3 but when I send ona or onb ect. nothing happens please help</p>
Hi 225 awesome5, You can test it on serial monitor on the computer to have a look that whether the short message is received or not.
<p>hi .. i want to know , i wanna make a project to turn on the lamp in the house while im not at the house .. but , if i wanna make sure the light is turn on , can i receive sms from the device to my phone to prove the light is turn on .. </p>
And it is really a great idea.
I think that it is ok. you can add a light sensor or current sensor on this project.
Please give me the code . Iam also doing this project.i collected the componen.please give the code
You can download the code at the step 4 upload the program
<p>Please upload the code of entire project please!! i am doing the same experiment</p><p>My email id: lokeshrrs@gmail.com</p><p>i would be obliged if i have been helped!!</p><p>Thank u!!</p>
You can download the code at the step 4 upload the program.
<p>Can I use Arduino Uno?</p>
Yes, The Crowduino atmega328 is Arduino UNO compatible.
<p>can i have the code please? </p><p>miola001@gmail.com</p>
<p>There is a download link at the step of upload program </p>
<p>hello. does this use the hardware serial?</p>
<p>good job mr</p>
<p>#include &quot;SIM900.h&quot;<br>#include &lt;SoftwareSerial.h&gt;<br><br>#include&lt;string.h&gt;<br><br>#include&lt;stdlib.h&gt;<br><br>//If you want to use the Arduino functions to manage SMS, uncomment the lines below.<br>#include &quot;sms.h&quot;<br>SMSGSM sms;<br>char num[20],tex[160];<br>int numdata;<br>boolean started=false;<br>char smsbuffer[160];<br>char n[20];<br> <br>char number[20];<br>char sende[20]=&quot;+919032987470&quot;; // Athenticator mob<br>char message[180];<br> <br>char pos;<br>char a[10];<br> int i=0,m,p;<br> <br>void clockwise()</p><p>{</p><p>;</p><p>}</p><p><br>void anticlockwise() <br></p><p>{</p><p>;</p><p>}</p><p><br>void stop() <br></p><p>{</p><p>;</p><p>}</p><p>int count=0;<br><br>void setup() <br>{<br> //Serial connection.<br> Serial.begin(9600);<br> Serial.println(&quot;GSM Based Stepper motor Controling\n&quot;);<br> //Start configuration of shield with baudrate.<br> //For http uses is raccomanded to use 4800 or slower.<br> if (gsm.begin(2400)){<br> Serial.println(&quot;\nstatus=READY&quot;);<br> started=true; <br> }<br> else Serial.println(&quot;\nstatus=IDLE&quot;);<br> <br> /**** stepper motor pins activating ****/<br> pinMode(pin1,OUTPUT);<br> pinMode(pin2,OUTPUT);<br> pinMode(pin3,OUTPUT);<br> pinMode(pin4,OUTPUT);<br><br>};//setup()<br><br>void clearbuf(char *b)// clearing the buffer<br>{<br> while(*b)<br> *b++='\0';<br>}<br><br><br>void loop() <br>{<br> int r;<br> <br> pos=sms.IsSMSPresent(SMS_UNREAD);// we can check msg recvd or not<br> <br> delay(1000);<br> <br> if((int)pos&gt;=0&amp;&amp;(int)pos&lt;=20){<br> <br> Serial.print(&quot;POS=&quot;);<br> <br> Serial.println((int)pos);<br> <br> message[0]='\0';<br> <br> sms.GetSMS((int)pos,number,message,180);// getting the num&amp;mesg<br> delay(500);<br> //Serial.println(number);<br> //Serial.println(message);<br> delay(3000);<br> <br> if(number[0])// if number recived or not checking<br> {<br> p=strcmp(number,sende); //checking the number <br> <br> if(!p)// if known number<br> {<br> Serial.println(&quot;Authorised Person\n&quot;); <br> Serial.print(&quot;Mobile Number: &quot;);<br> Serial.println(number); <br> Serial.println(&quot; &quot;); <br> Serial.print(&quot;Message: &quot;);<br> Serial.println(message); <br> Serial.println(&quot; &quot;); <br> <br> m=atoi(message);// converting string/char to integer<br> r=m*510;<br> // Serial.print(&quot;Rotations: &quot;);<br> // Serial.println(r);<br> if(m&gt;=0)// checking Clockwise<br> {<br> Serial.println(&quot;clock wise&quot;);<br> Serial.println(&quot; &quot;); <br> clockwise(r);<br> stop1();<br> Serial.print(&quot;rotations:&quot; );<br> Serial.println(m);<br> Serial.println(&quot; &quot;); <br> } <br> else// checking AntiClockwise checking<br> {<br> Serial.println(&quot;Anticlock wise&quot;);<br> Serial.println(&quot; &quot;); <br> anticlockwise(r);<br> stop1();<br> Serial.print(&quot;rotations:&quot; );<br> Serial.println(m);<br> Serial.println(&quot; &quot;); <br> }<br> }//if(!p)<br> else//if unknown number recived<br> {<br> Serial.println(&quot;Un Authorised Person\n&quot;);<br> Serial.print(&quot;Mobile Number: &quot;);<br> Serial.println(number); <br> Serial.println(&quot; &quot;); <br> Serial.print(&quot;Message: &quot;);<br> Serial.println(message); <br> Serial.println(&quot; &quot;); <br> Serial.println(&quot;Operation not Alloted\n&quot;);<br> }<br> }//if(number[0])<br> }//if(pos)<br> /* else // if messages more than 20 then deleted<br> {<br> for(pos=0;pos&lt;20;pos++)<br> {<br> sms.DeleteSMS((int)pos);<br> Serial.println(&quot;All Messages Deleting......&quot;);<br> Serial.println(&quot; &quot;); <br> }<br> pos=0;<br> }*/<br> <br> delay(1000); <br> /*** clearing all variables***/ <br> sms.DeleteSMS((int)pos);<br> Serial.println(&quot;Message Deleted\n&quot;);<br> clearbuf(message);<br> clearbuf(number);<br> p='\0';<br> m='\0';<br> r='\0';<br> delay(2000);<br>}//loop()</p>
<p>hai friends iam ganesh. plz help for my project . any one for write the program for control one relay using GSM module (sim900). progarm form msg is given to some text is diplay.</p>
<p>Hi Team,</p><p>What i have to do to register a particular mobile number otherwise anybody can hack the device na...?</p>
Please give me the code . Iam also doing this project.i collected the componen.please give the code
Please give me the code . Iam also doing this project.i collected the componen.please give the code
Please give me the code . Iam also doing this project.i collected the componen.please give the code
Please give me the code . Iam also doing this project.i collected the componen.please give the code
Please give me the code . Iam also doing this project.i collected the componen.please give the code

About This Instructable



Bio: Elecrow is an open hardware facilitation company based in Shenzhen. We integrate resources to serve new era of innovation. To make your making and innovation ... More »
More by Elecrow: ESP8266 Wireless Toilet Usage Indicator (Smart Home)Arduino Theremin Door-close Reminder Arduino Goods Counter
Add instructable to: