We have umpteen number of remote controls available around us and in 99% cases they are infra red type remote control which works on line of sight. Infrared signal is of longer wave length, they are invisible to naked eyes but to digital cameras.
To check if any IR remote control is working or not ,just point it to a digital camera lens and see through the camera. You will not miss the glow, if it works.
How an IR remote works:
It consists of two units – a transmitter and a receiver
The transmitter is a combination of an IR transmitter LED, a small microprocessor to create the hexadecimal number to be transmitted , a small amplifier to boost up the signal before transmitting through the LED and a power supply unit. Invariably all these transmitter unit have a keypad with buttons to press. With the press of every button the microprocessor sends a particular 32 bit hexadecimal word to the amplifier which then transmits thru' the LED.
While at the other end the receiver unit consists of an IR Receiver unit normally inexpensive TSOP4838 or PNA4602 type , a decoder unit usually a small microprocessor and a power supply unit. The decoder decodes the Hexadecimal number it receives and then accordingly switches on or switches off the particular unit. The typical IR receiver ( TSOP4838 or PNA4602) unit has 3 legs – 2 are for power supply and the 3rd one is for data out signal.
Build your own tailor Made remote control:
The idea came to build up a remote control unit by hacking a cheap IR transmitter unit. The unit will be capable of switching on the lights, fans and other accessories and at the same time the unit will be capable of modulating the fan regulators or dimmer controller.
[Several IR Transmitter unit ]
When I look around I find quite a handful number of IR transmitter units are available in my Vindhyanagar residence. Each one is for a particular unit to control. Even my car stereo too have a remote control to change the song selections. All these units have similar keypads like channel selection, volume control etc. When I hacked one remote unit and decoded the signal it transmits using one TSOP4838 on an Arduino . I find almost all of them emits a different word for different buttons. Some codes may turn out to be same on two different units but certainly they are defined for different buttons – like I found 0 of my car stereo sends same 0xFF6897 to that of 10+ button of my CD player. For other buttons I could not find any other tow buttons which sends same signals.
First a TSOP4838 is connected on an Arduino UNO and the words that are coming from the transmitter is placed on the serial terminal. Few digital pins are selected for controlling 5 volt relays. The code is made in such a way that on one press of a button it will switch on a device and on next press it will switch it off. For controlling the regulator of a fan we have used a small bipolar stepper motor which will be directly connected to the knob of the fan regulator. The volume button (up & down) will be used for bidirectional rotation of the stepper motor thus controlling the fan regulator. We also have provided the PWM output on a digital pin which works out of the channel (up & down) button press.
First we noted down the words that are arriving from each button press of the Tx unit. It's a 32 bit word like 0xFFA857
or 0xFF30CF. The 0x part does not appear because we are printing the HEX code. Now in the Arduino code we incorporate those words for energizing the several digital pins. The volume (up & down) buttons are used for movements of a small bi-directional stepper motor which is directly mounted on the knob of a fan regulator. Since it's only a knob operation, the stepper power connected directly to the GPIOs will be enough to rotate it to the both extreme ends. In case the stepper power is not enough to rotate the knob ,connect a L293 or L298 dual H bridge in between the GPIOs and the stepper motor.
Testing , update & Operation:
Assemble the circuit , connect the TSOP4838 probe with the Arduino, Upload the sketch and then point your IR Remote transmitter towards the TSOP4838 probe. Open the serial terminal and then note down the hex code for each key press buttons. In the next stage define your key press buttons for each switches that you are going to operate with the remote.
Say, you select
Button-0 for light1,
Button-1 for light2,
Button-4 for light3,
Vol+ & Vol- Button for Fan regulator (Operates the Stepper motor)
Ch+ & Ch- Button for 12Volt Dimmer lamp (Operates the n channel FET)
… You can define as many switches as there are free GPIOs .
Now, open the Arduino sketch and then replace the existing codes with the codes that you have obtained from your IR Remote transmitter. Upload the sketch and now your home made IR Remote transmitter is ready to rock the next Saturday evening party at your home.
The relays have two switches NC & NO. Be careful while connecting the relay with the load on the power socket. The dimmer circuit is meant to run on 12 / 15 volt DC only. For making it works with the power line devices we have to modify it's design.