Project tutorial
Universal Remote Control

Universal Remote Control

Control everything from your phone

  • 4,201 views
  • 0 comments
  • 12 respects

Components and supplies

About this project

//www.youtube.com/embed/aGGJzWk67NM?theme=light&color=red

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 library for Arduino.

https://github.com/shirriff/Arduino-IRremote

In the examples of that library, you can find IRrecvDump example. This code used to encode data from remote control.

You have to wire the IR receiver. As shown in its 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.

As shown in the image below, 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.

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

https://codebender.cc/sketch:55268

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.


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.


Code

Untitled fileArduino
#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);
    }
  }
}
Github
https://github.com/shirriff/Arduino-IRremote
Codebender
https://codebender.cc/sketch:55268

Comments

Similar projects you might like

Universal Remote Control using Arduino, 1Sheeld and Android

Project tutorial by Ashraf Nabil

  • 9,118 views
  • 5 comments
  • 14 respects

Control an LED with the Remote Control

Project showcase by Nicholas_N

  • 3,196 views
  • 2 comments
  • 9 respects

Universal Remote Control

Project tutorial by 4D Makers

  • 2,334 views
  • 0 comments
  • 4 respects

Track and Control Your Car Remotely

Project tutorial by Ashraf Nabil

  • 25,416 views
  • 5 comments
  • 58 respects

Servo Control with TV Remote Control

Project showcase by eldo85

  • 5,601 views
  • 5 comments
  • 17 respects
Add projectSign up / Login