Hello guys,
From my childhood itself I was wondering about the TV remote controller and how does it work.This instructable tells the story how I managed to decode/hack an old remote controller and used it for home automation.
This instructable contains different parts as follows:
AFTER CHOOSING A WORKING REMOTE CONTROLLER FROM THE OLD REMOTE CONTROLLERS, WE SHOULD KNOW THE
BASICS:
The IR Remote controller consists of an Infra Red LED connected to its circuitry.
When we press any of the buttons, a corresponding code is sent to air via the LED. The code is actually an encoded number, encoded in HEX format. HEX means the base of counting is 16.
ie; In HEX, there are 16 numbers, from 0 to F, as 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
So in HEX 25 is (5x16^0)+(2x16^1)=5+32=37
and 5F is (15x16^0)+(5x16)=15+80=95
The HEX code is sent to the IR LED as 1s and 0s (high voltage (3.3V) and low voltage (0 V) respectively).
Suppose, the number 95 is assumed for the VOL+ button. When we press the button, the circuitry sends 95 to the LED as a series of 1s and zeros.
95 is 5F in HEX and this can be written in binary as 0101 1111
ie; 0101 1111=(1x2^0)+(1x2^1)+(1x2^2)+(1x2^3) + (1x2^4)+(0x2^5)+(1x2^6)+(0x2^7)
=1+2+4+8 + 16+0+64+0
=15 + 80
=95
This is the basics of any IR remote controller. Every button is associated with a unique code. What we have to do is decode the number associated with each button of the controller and record it for further reference.
For decoding, we have to setup Arduino Uno with an IR sensor.
Collect these:
Now do the connections as:
Now the hardware connections are ready.
Before programming, download the IR library attached to this step, unzip the folder and copy the IR library to the libraries folder of the Arduino main folder. (C:\Program Files (x86)\Arduino\libraries).
Then open the Arduini IDE, copy the code attached here and upload it to the Arduino Uno.
All the circuit and IDE setups are ready, it is the time for decoding now.
Open the "Serial monitor" in the Arduino IDE on your computer.(Tools-Serial monitor). Press the button on the remote controller to the IR sensor on the breadboard. When pressing each button, you can see a unique code in the serial monitor.
Press each button and write down the code.
eg:
Button Code
Play/Pause ---------0x1FE50AF
Next ------------------0x1FE35AC
VOL +----------------0x1FE23DE
1 ----------------------0x1FEA34E
Application 1 explains how the remote controller can be used to control an LED or to turn on and off an LED.
For this, a simple addition has to be done with the circuit/breadboard. Connect an LED to the pin number 13 of the Arduino. Do not forget to add a 470 Ohms resistor in series with the LED.
Now upload the code attached to this step to the Arduino Uno, and before uploading, you have to edit the program according to the decoded values of the remote controller. First, decide which buttons of the remote controller have to be used for turning ON and OFF.
In the 39th line of the code, there is "if(results.value==0x1FE50AF)"
here you can replace 0x1FE50AF with the code of the button you wish to turn ON the LED.
And in the 47th line, there is else "if(results.value==0x1FED827)"
Delete 0x1FED827 and add the code of the button you wish to turn OFF the LED.
The remote controller I decoded has "0x1FE50AF" for the button "1" and "0x1FED827" for the button "2". So I am using the buttons 1 and 2 of the remote controller for turning on and off the LED respectively.
After uploading the code you can simply turn on and off the LED connected to the pin number 13.
Application 2 looks forward to control a relay circuit connected to the pin number 13 of the Arduino.
For that, we have to make a relay circuit in addition to the previous circuit setup.
Things needed:
Relay circuit is used to control a circuit with high current/power using the circuit with a low current.
Here, the Arduino pin turns on and off the LED has only 20 milliAmperes of current. We cannot control/turn on and off a high power rated device( like a 230 V light ) with this output. so we use a relay circuit which is nothing but an electromagnetic circuitry.
From the circuit diagram, we can see that the control signal from the Arduino is connected to the base of the BC 547 transistor through a resistor. When a signal is reached to the base of the transistor, it turns the relay switch closed hence turning on the device connected.
You can buy a relay board (here) or make one yourself following these simple steps:
To do this circuit on the board, we need to:
Refer this instructable for more information about the relay and making a relay.
Now, when using the remote controller, you can simply turn on and off the relay. And any AC devices can be connected to the relay and be controlled.
For controlling an AC bulb:
Take :
Connect one wire of the plug to the bulb holder directly and connect the other one through the terminal connector of the relay.
Refer the pictures attached.
We can simply control the device attached to the relay by pressing the buttons on the remote controller.
In application 3, we are making a complete IR home automation device. We are using Arduino pro mini instead of Arduino Uno. Pro mini is smaller and handy than Uno. And for the power supply, we are using an old 5 V DC mobile phone charger.
So, we need:
Arduino pro mini can be programmed using Arduino Uno.
Refer this instructable for a more detailed explanation.
Now we have to connect all the parts together including the pro mini, the relay board, IR sensor and the power supply board.
For making the enclosure, take the plastic box and make a tiny hole for the IR sensor. Fix the IR sensor near the hole facing out the box. Place all the boards inside the box and fix it there using double-sided tape. Take the yellow twisted pair wire out and close the box.
Connect the yellow wires to the bulb holder and fix the holder on the box.
Instead of the bulb holder, one can use the two pin socket on the box so that we can control any AC device connected.
After this step, all the setup is ready and you can plug it into the ac outlet and control the bulb using the remote controller.
Hope you all enjoyed and well-understood this how to. Feel free to use the comment box and try to make it.
Happy making.
Vote for me in the remote control contestif you like this.
Thank you...