In today’s Instructable, I’ll show you how you can use a generic RF module without a microcontroller which will eventually lead us to build a project where you can convert an IR Remote of any device to a RF Remote. The main advantage of converting an IR Remote to RF, is that, you don’t have to point the remote before pressing the buttons for the device to work. Also, if you have a device that is not always in range of the remote, like a home theater in the corner of a room, this RF Remote will make your life easier.
Let’s get started.
Step 1: How About a Video?
The videos has all the steps covered in detail required for building this project. You can watch it if you prefer visuals but if you prefer text, go through the next steps.
Also if you want to watch the project in action, refer the same video.
Step 2: Parts List.
Encoder and Decoder ICs:
INDIA – https://amzn.to/2HpNsQd
US – Encoder –> https://amzn.to/2HpNsQd ; Decoder –> https://amzn.to/2HpNsQd
UK – Encoder –> https://amzn.to/2HpNsQd ; Decoder –> https://amzn.to/2HpNsQd
INDIA – https://amzn.to/2GZ17y9
Step 3: Encoder and Decoder.
The encoder and decoder ICs we will be using are HT12E and HT12D, D for decoder and E for encoder. Let’s take a look at the pins of these ICs.
In HT12E, pin numbers 10, 11, 12 and 13 are data input pins and pin 17 is the output pin, which we will modulate. Pins 16 and 17 are for internal RC oscillator and we connect a resistor ranging from 500k to 1M (I used 680k) across these pins. Actually, the resistor connected will be a part of the RC oscillator. Pin 14 is transmit enable pin. It is an active low pin and the data will be transmitted only if this pin is held low. Pin 18 and 9 are Vcc and GND respectively, and I will talk about remaining eight pins in a while.
Things are somewhat similar for the decoder. 18 and 9 are supply pins, 15 and 16 are internal oscillator pins and a 33k resistor is connected between them. Pin 17 is the valid transmission pin of the IC which is goes high whenever a valid data is received. The modulated data is given to pin 15 and decoded parallel data is obtained from pins 10, 11, 12 and 13.
Now you will notice that decoder IC also has those 8 pins that we saw in encoder. In fact, they serve a very important purpose in keeping your transmission secure. These are called address setting pins and they ensure that the data sent is received by the right receiver in an environment where there are more than one of these pair. If in the encoder, all of these pins are held low, then to receive the data all of these pins of the decoder must also be held low. If four are held high and four are held low, decoder address pins must also have the same configuration, then only the data will be received by the receiver. I will be connecting all pins to ground. You can do whatever you like. For changing the address on the go, a DIP switch is used, which connects the pins to either high or low just by a flick of the buttons on it.
Step 4: Prototyping.
You will need two breadboards. I went ahead and connected all up using the circuit diagram in this step with LEDs in place of the Arduino and push buttons with a 10k pull down resistor in place of switches.. I used separate power supplies for both of them. As soon as you power the transmitter, you will see that the valid transmission pin goes high indicating that the successful connection is made. When I press any button on the transmitter side, the corresponding LED on the receiver side glows. Multiple LEDs are turned on if I press multiple push buttons. Notice the VT led, it blinks every time it receives a new data, and this will be very helpful in the project we are going to make.
If your circuit is not working, you can debug easily just by connecting the output of encoder to input of decoder and everything must still work the same. This way you can at least make sure that you ICs and its connections are alright.
If you change one of the address pins to high, you can see everything stopped working. To make it work again, you can either connect it back, or change the same pin status on the other side to high. So, keep this in mind while designing anything like this as they are very important.
Step 5: Infrared.
You might have guessed by now that we are going to mimic those IR codes of the remote. To get started we will need an infrared receiver like TSOP1338 and an Arduino. We are going to determine the hex codes of each buttons that make them different from the other one.
Download and install the two libraries, link of which is provided. Now open IRrecvdump from IRLib master examples folder and upload it to Arduino. First pin of the receiver is ground, second is Vcc, and third is output. After applying power and connecting output to pin 11, I opened serial monitor. I pointed the IR remote to the receiver and started pressing its buttons. I pressed each button twice and after I was done with all the required buttons I disconnected the Arduino.
Now look at the serial monitor, there will be lots of garbage, but they are just stray light rays that the receiver caught as it is too sensitive. But there will also be the protocol used and the is hex code of the buttons you pressed. That is what we want. So I made a note with name and their hex codes as we will be needing it later.
How IR in Remote works:
Step 6: What Are We Doing?
Step 7: Find the Receiver.
Step 8: Soldering.
Using the same connection diagram, I built the required two PCBs, I have used standalone Arduino instead of a Pro Mini as that’s what I had laying around.
Before putting the microcontroller in, I wanted to test the connections one more time. So I applied 9 Volts to transmitter and 5 Volts to receiver and used a LED to test the functioning of the boards and quickly tested everything. I also added a power switch for saving battery to the transmitter PCB.
Finally after uploading the sketch, I fixed the Arduino to its place.
I soldered the 1k resistor directly to the cathode of LED and I will use a heat shrink before gluing it to the adapter I made for my home theatre using a GI sheet, but if you have access to 3d printer, you can build a far more professional looking adapter easily, if it is required. I will also solder a long wire between the LED and the PCB so that it is easy to place the PCB in a different place, somewhere hidden. After all these are done, it is time to test its functioning, which you can see in action in the video I have embedded in step 1.
Read more: Convert Your IR Remote to RF Remote