loading

This project illustrates how to control your TV, Satellite receiver and Stereo using your Android mobile instead of using there remote control.

Basically, you can apply this technique for any other devices work with remote control. I was wondering to use my mobile to control all the device in the home in stead of using the remote of each device.

Now you can control as much as you want of your home remote devices by only 1 application on your mobile!

Step 1: Components

1- Arduino Uno (or any other arduino board) (25$)

2- 1Sheeld (55$) (here is the website of 1Sheeld for the getting starting tutorials and documentation)

3- IR Receiver (1.95$)

4- IR Led (0.95$)

5- Android Mobile phone

Step 2: Android Application

Basically, All we have to do in this step is to download the android application from google play store.

Application

Step 3: Decoding Your Remote

The transmitter in the remote control handset sends out a stream of pulses of infrared light when the user presses a button on the handset. A transmitter is often a light emitting diode (LED) which is built into the pointing end of the remote control handset. The infrared light pulses form a pattern unique to that button. The receiver in the device recognizes the pattern and causes the device to respond accordingly (Wikipedia).

So we have to know that unique pattern of each button.

Simply, you have to download the IR libraryfor Arduino.

In the examples of that library, you can find IRrecvDump example (as illustrated in the third image). This code used to encode data from remote control.

You have to wire the IR receiver. As shown in it's figure:
1- Ground
2- 5V
3- Pin 11

After uploading this code to the Arduino open the serial monitor and press any button on your TV remote, you will find something as in the fifth image image.

As shown in the fourth image, you can find the hex code that refer to each button of the remote control. Write down these hex numbers corresponding to its function (e.g. 20DFC03F ,32 refers to power button).

Note, If you get "unknown encoding", press the button again.

Step 4: Android Sketch

Now, We have to upload the code that is used to transmit the commands to our devices. You can find the code but you will make a small change depends on your remote.

All you have to do here is to replace by hex values as (0x20DF10EF) by the values you have got from the power button, volume up/down buttons and any other button you want.

Since 1Sheeld mobile application doesn't have a remote control interface, I used the KeyPad shield as the remote controller, you can choose the Keyboard shield as well for much more devices.

#include <OneSheeld.h>
#include <IRremote.h>
IRsend irsend;
void setup() 
{
  OneSheeld.begin();
}

void loop(){  if(Keypad.isRowPressed(0) && Keypad.isColumnPressed(0))
  {
    irsend.sendNEC(0x20DF10EF, 32);
  }
  else if(Keypad.isRowPressed(0) && Keypad.isColumnPressed(1))
  {
    irsend.sendNEC(0x20DFC03F, 32);
  }
   else if(Keypad.isRowPressed(0) && Keypad.isColumnPressed(2))
  {
    irsend.sendNEC(0x20DF40BF, 32);
  }
   else if(Keypad.isRowPressed(1) && Keypad.isColumnPressed(1))
  {
    irsend.sendNEC(0x41048B7, 32);
  }
  else if(Keypad.isRowPressed(1) && Keypad.isColumnPressed(0))
  {
    irsend.sendNEC(0x410C837, 32);
  }
  else if(Keypad.isRowPressed(2) && Keypad.isColumnPressed(0))
  {
      for (int i = 0; i < 3; i++) {
      irsend.sendSony(0xa81, 12); // Sony TV power code
      delay(40);
    }
  }
}

Step 5: Testing

Finally, you use the IR LED at pin 3 in Arduino and Place it next to the in front of the devices as shown.

Now Open 1Sheeld mobile application and connect it with the shield and then choose the keypad shield, all of these shown in the video.

Now, by pressing the buttons on your mobile phone it will make the corresponding task whether to power on, volume up, volume down, ....etc.

<p>hello, can this project turning on the desktop PC?</p>
<p>I am getting an error of OneSheeld not declared in the scope and keypad not declare, although I have added the req libraries.</p>
<p>I would just build a keypad for cheaper</p>
<p>can you please help ??? :S i canot varify the code :S</p><p>#include &lt;OneSheeld.h&gt;</p><p>#include &lt;IRremote.h&gt;</p><p>IRsend irsend;</p><p>void setup() </p><p>{</p><p> OneSheeld.begin();</p><p>{</p><p>void loop(){</p><p> if(Keypad.isRowPressed(1) &amp;&amp; Keypad.isColumnPressed(1))</p><p> {</p><p> irsend.sendNEC( 8C837, 32);</p><p> }</p><p> else if(Keypad.isRowPressed(0) &amp;&amp; Keypad.isColumnPressed(1))</p><p> {</p><p> irsend.sendNEC( 88877 , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(1) &amp;&amp; Keypad.isColumnPressed(2))</p><p> {</p><p> irsend.sendNEC( 828D7 , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(1) &amp;&amp; Keypad.isColumnPressed(0))</p><p> {</p><p> irsend.sendNEC( 848B7 , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(2) &amp;&amp; Keypad.isColumnPressed(1))</p><p> {</p><p> irsend.sendNEC( 8A857 , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(1) &amp;&amp; Keypad.isColumnPressed(3))</p><p> {</p><p> irsend.sendNEC( 20DF10EF , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(3) &amp;&amp; Keypad.isColumnPressed(1))</p><p> {</p><p> irsend.sendNEC( 20DFD02F , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(0) &amp;&amp; Keypad.isColumnPressed(0))</p><p> {</p><p> irsend.sendNEC( 8F807 , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(2) &amp;&amp; Keypad.isColumnPressed(0))</p><p> {</p><p> irsend.sendNEC( 802FD , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(0) &amp;&amp; Keypad.isColumnPressed(2))</p><p> {</p><p> irsend.sendNEC( 20DF40BF , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(2) &amp;&amp; Keypad.isColumnPressed(2))</p><p> {</p><p> irsend.sendNEC( 20DFC03F , 32);</p><p> }</p><p> else if(Keypad.isRowPressed(0) &amp;&amp; Keypad.isColumnPressed(3))</p><p> {</p><p> irsend.sendNEC( 800FF , 32);</p><p> }</p><p>}</p>
<p>Actually, there is 2 problems:<br>1- you have to change the bracket after &quot;OneSheeld.begin();&quot; form &quot;{&quot; to &quot;}&quot; to close the function</p><p>2- you have also before each code to put &quot;0x&quot; ,, for example instead of <br>irsend.sendNEC( 8C837, 32); change to <br></p><p>irsend.sendNEC( 0x8C837, 32);<br></p><p>Try these and of there is any problems please tell me </p>
<p>I LOVE YOU :D :D :D but why should i do that 0x ???</p>
<p>Thanks a lot :) ,,, Because these values are in hexadecimal ,,, so you have to put 0x to make Arduino recognize that point <br>http://arduino.cc/en/Reference/IntegerConstants</p>
<p>That's interesting. Thanks for sharing this!</p>
<p>thanks a lot and I hope you can try it :)</p>
just to clarify, the phone can't interface directly with the device.. IE. tv
<p>actually, no the phone interface with 1Sheeld and arduino using Bluetooth and then the arduino transimt the code to the TV </p>

About This Instructable

16,932views

40favorites

License:

More by ashraf nabil:Line Follower Robot Using Camera Shield in 1Sheeld & Arduino Automated Photo Booth takes a picture and posts it on Twitter with Arduino and 1Sheeld Real-time BitCoin Price monitor using LED Matrix, Arduino and 1Sheeld 
Add instructable to: