This project shows you how to create a simple remote-controlled on-off switch that will work with most IR remote controls. And you only need four components to build it—an IR receiver, a capacitor, a JK flip-flop, and a relay module.
You can connect whatever you want to control to the relay, and then use any IR remote control to turn it on or off.
The Circuit
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).
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.
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).
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
Parts List
| Reference | Value |
|---|---|
| C1 | 47µF |
| IR Receiver | TSOP312 |
| JK Flip-flop | 74HC73 |
| Relay | Module |
The Layout
You can easily build this circuit on a breadboard. Here’s an image of how I connected it: