Build A Simple Remote Controlled On Off Switch
Build A Simple Remote Controlled On Off Switch
Learn how to build a remote-controlled ON-OFF switch that can be controlled from any
standard remote control. You can use this to control a lamp, triggering a Halloween project
unnoticed, or whatever else you can think of that could be useful to turn on and off remotely.
You’re not going to decode the signal to figure out what button was pressed, instead you’re just
going to detect if a button has been pressed. You’ll use this to toggle the state of a flip flop that
controls a relay where you’ll connect whatever you want to control.
An IR remote control consists of an IR LED (Light Emitting Diode) that emits infrared light. When
you press a button on the remote, it sends a specific pattern of light pulses that represent
different commands.
These light pulses are modulated, meaning they switch on and off at a high frequency, typically
around 38 kHz. This modulation helps the receiver distinguish the IR signal from ambient light.
The receiver on the device has an IR detector, which demodulates and converts the infrared
light signal back into electrical signals. This detector is designed to only respond to infrared light
modulated at specific frequencies, filtering out signals from natural light sources.
The receiver must then decode these signals to figure out what command was sent (such as
volume up, change channel, or power on/off) based on the pattern of the pulses.
I used the TSOP1238, but there are plenty of other options that will work.
What makes this project possible with so few components is the fact that you’re not going to
figure out what command was sent from the remote control, you’re just going to detect that a
command has been sent – any command.
So instead of trying to decode the output from the IR receiver, you’re just going to detect that a
command starts, then filter out the data of the command to make sure we only trigger the flip
flop one time. You can filter out the data using a capacitor up to VCC.
When the output from the demodulator goes high, the output transistor turns on and your
capacitor charges up fast since it does not have to go through any resistor (it’s connected
directly to ground through the output transistor).
But when the output from the demodulator goes low again, the output transistor turns off, and
your capacitor must discharge through the internal pullup resistor. This makes the discharge
phase much slower. So the voltage on the output pin will need some time before it becomes
high again.
A capacitor value of around 47 µF is high enough to make the output voltage stay low for the
whole duration of the received IR command.
The output from the IR Receiver is inverted. It means that the output is normally high, when
there is no IR signal detected. Then it goes low, every time a signal is detected. So you need a
flip flop that triggers on the negative edge of the signal (or add an inverter).
The 74HC73 is a negative edge-triggered JK flip flop - perfect for the job.
Now, you need to make the Q output from the flip flop control whatever it is that you want to turn
on and off.
The Relay
An easy way to control whatever you want is to use a relay.
To easily control the relay and save a few parts, I used a relay module. The module has pins for
controlling the relay on and off, and it has proper screw terminals for connecting whatever you
want to control.
Parts list
• IR Receiver (TSOP1238)
• Capacitor (47 µF)
• JK Flip Flop (74HC73)
• Relay Module (Ex: Parallax Single Relay Board)
Build Instructions
I recommend you build this out on a breadboard to test it out first. Here’s a drawing of how you
can hook it up:
1. Getting Started With Electronics is a short and beginner-friendly eBook I wrote to help
people get started. It contains clear and simple instructions to get started building
electronics. Perfect for complete beginners.
2. Our online classes at Ohmify is for those who want to learn skills like soldering, circuit
design, Arduino, and PCB design and more in order to confidently create electronic
gadgets and tools – and who are prepared to take action to make it happen.
Keep On Soldering!
Oyvind @ build-electronic-circuits.com