This tutorial will guide you through building a simple remote-controlled on-off switch that will work with most IR remote controls. And you only need four components to build it.
It works like this: Every time you push a button on the remote control the signal is received an converted into one long pulse that toggles a flip-flop. On the output of the flip-flop, there’s a relay module that gets turned on or off with every button press.
Connect whatever you want to the relay, and now you can control that thing with any button on almost any IR remote control!
Click here to see the circuit on Circuit Canvas and make your own adjustments >>
The Circuit
This project uses a TSOP312 IR receiver, a capacitor, and a JK flip-flop. Below the parts list, you can find the schematic that shows the connections between all the components.
Parts List
- 1x TSOP312 IR receiver module
- 1x 74HC73 JK flip-flop IC
- 1x Relay module
- 1x 47µF electrolytic capacitor
- Breadboard
- Power supply (5V)
- Any old IR remote control
How the Circuit Works
IR Signal Detection: The TSOP312 IR receiver module detects the infrared signal from the remote control. The signal is decoded sent out on the output pin as a series of ones and zeroes (highs and lows).
Pulse Shaping: The 100µF capacitor connected onto the connection between the TSOP312 output (Pin 2) and the JK flip-flop’s clock input (Pin 3) converts the short pulses from the IR receiver into a single, longer pulse. This makes sure the flip-flop gets one clock pulse per button press.
JK Flip-Flop: The JK flip-flop acts as a toggle switch. It changes its output state (Pin 13) from HIGH to LOW or LOW to HIGH each time it receives a pulse on its clock input (Pin 3).
10 Simple Steps to Learn Electronics
Electronics is easy when you know what to focus on and what to ignore. Learn what "the basics" really is and how to learn it fast.
Relay Control: The output of the flip-flop (Pin 13) connects to the input of the relay module (SIG). When the output is HIGH, the relay is energized, and the “COM” pin gets connected to the “NO” pin. When the output is LOW, the relay is off, and the “COM” pin is connected to the “NC” pin
Build Instructions
You can easily build this circuit on a breadboard. Here’s an image of how I connected it:
Start by connecting the 74HC73 chip at the lower end of the board.
The 74HC73 chip comes with two JK flip-flops inside, but you’ll only use one.
Use jumper wires to connect all the following pins to plus on your breadboard:
- VCC (Pin 4)
- Inverted Reset (Pin 2)
- J input (Pin 14)
- K input (Pin 3)
Connect the chips ground pin (Pin 11) to minus on the breadboard.
Place the IR receiver and add wires to connect it’s VCC pin to plus and it’s GND pin to minus. And connect it’s output pin to the CLK pin of the JK flip-flop (Pin 1).
Then the capacitor, with its negative pin on the CLK pin of the JK flip-flop (Pin 1) and the positive pin to plus.
At the top of the breadboard, place your relay module and connect its VCC and GND pins to the plus and minus. Then connect its SIG pin to the Q output of the JK flip flop (Pin 12) using a jumper wire.
Testing the Circuit
- Point your IR remote control at the TSOP312 receiver module.
- Press any button on the remote control. You should see the relay click and its onboard LED will turn ON.
- Press the button again. The relay should click again, and the LED will turn OFF.
- Note that this circuit can be a bit sensitive to noise from other IR sources. If it’s turning on and off by itself without you pushing anything, move it to another location with less IR noise.
Now, connect your load (i.e. lamp/motor/whatever you want to control) to the relay. Just make sure your relay is rated for the voltage and current your load needs.
Congratulations! You have successfully built a remote-controlled on-off switch.
More Circuits & Projects Tutorials
Build Something Practical This Evening
Download this tutorial that shows you step by step how to build an old-school USB charger for your mobile.