This is only a preview of the September 2024 issue of Silicon Chip. You can view 42 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Compact OLED Clock/Timer":
Items relevant to "Pico Mixed-Signal Analyser (PicoMSA)":
Items relevant to "IR Helper":
Videos relevant to "No-IC Colour Shifter":
Articles in this series:
Articles in this series:
Items relevant to "Discrete Ideal Bridge Rectifiers":
Items relevant to "Electric Guitar Pickguards":
Purchase a printed copy of this issue for $12.50. |
SILICON CHIP
Mini Projects #010 – by Tim Blythman
IR Helper
Infrared (IR) remote controls make life easier. However,
each controlled device typically needs its own remote
control, making it awkward when you have many devices.
The IR Helper can simplify things by emulating different remote
controls.
T
he main role of the IR Helper is to
send IR signals automatically, so
you don’t have to juggle multiple IR
remote controls. Our prototype can do
this in a couple of ways, but since it is
programmed using the Arduino IDE,
it is easy to extend and adapt.
You will need some Arduino knowledge, though, since you will have to
change our prototype sketch to suit
your equipment and its IR codes.
The IR Helper can be programmed
to send a signal when it is powered
on. Many devices like TVs have USB
ports, so you can simply plug the IR
Helper in, and it will power on when
the TV does and send out the signals
it’s programmed to generate.
The IR Helper can also respond
to IR commands and perform extra
actions by sending further signals
to other devices. For example, the
IR Helper could detect the TV being
switched on remotely and then turn
on a receiver, amplifier, DVD player
or all three!
From the photos, you can see that
the IR Helper has simple hardware. It
uses two main modules: a small microcontroller module and an IR receiver
module. We have used a module rather
than a simple IR receiver because of
its handy onboard LED indicator; it is
also slightly cheaper.
An IR emitter LED is included so
that the IR Helper can transmit as well
as receive IR signals. The main processor is a compact Leonardo Tiny board
with a USB interface. The USB interface is used to display received codes
for testing, among other things.
We published an article in the
August 2018 issue titled “Turn any PC
into a media centre – with remote control!” (siliconchip.au/Article/11195).
These two projects use very similar
hardware, so you might be interested
in reading the earlier article to see
what else can be done with this basic
combination of parts.
Circuit details
Fig.1 is the wiring diagram. We
assembled our prototype by soldering
the parts to the Leonardo Tiny board,
using heatshrink tubing to protect the
exposed leads where necessary. You
could also use a full-sized Leonardo
board if you wanted to.
If you have the Arduino Beetle board
from the 2018 article, you could add
the IR Transmitter LED, updating the
hardware to suit this article, since
both projects use the same pin for the
IR receiver.
The IR Receiver Module incorporates one LED that illuminates when
the IR receiver chip sees a valid, mod-
Parts List – IR Helper (JMP010)
1 Leonardo Tiny board [Jaycar XC4431]
1 IR Receiver Module [Jaycar XC4427]
1 IR Transmitter LED [Jaycar ZD1946]
1 220W 1% ½W axial resistor [Jaycar RR0556]
1 3cm length of red wire [Jaycar WH3010]
1 3cm length of 5mm diameter heatshrink tubing [Jaycar WH5553]
66
Silicon Chip
Australia's electronics magazine
ulated signal. The S pin of the module
goes low at the same time, signalling
to the processor in the Leonardo Tiny
that a signal has been received.
The Leonardo Tiny sends an IR signal by driving its A0 pin high, sending
current through the IR transmitter LED.
The pin does not have a lot of drive
capability, but it’s enough for transmitting commands over short distances.
The IR LED in your handheld IR
remote control will be driven much
harder than the one in the IR Helper,
but we expect that most readers will
situate their IR Helper near the devices
it is transmitting to. You can see that
the IR receiver and transmitter are on
opposite sides to facilitate this.
Assembly
Solder the short length of red wire
to the middle pin of the IR Receiver
module, then cover the exposed parts
of the pin and wire with a few centimetres of heatshrink tubing and shrink
it into place. Solder the two outer pins
of the module to the D11 and GND (−)
pins of the Leonardo Tiny, as shown in
the photos. Note that the module has
to be upside-down for this to happen.
Next, solder the other end of the red
wire to the 5V pad on the other side of
the Leonardo Tiny.
Prepare the LED by cutting the longer anode lead to around 5mm. Cut
one of the resistor’s leads to a similar length. Solder the two cut leads
together, then use the heatshrink tubing to cover most of the LED’s leads
separately.
This LED assembly can now be powered directly from a DC supply. You
could use this idea on a breadboard or
siliconchip.com.au
similar to add LEDs without needing
to wire up separate resistors.
Now solder the exposed ends of the
LED assembly to the A0 and GND pins
of the Leonardo Tiny. You should be
able to re-check the polarity by observing that the side of the LED with the
flat edge connects to GND.
You can do a quick test by applying
power and aiming a signal from an IR
remote control at the receiver module. Its indicator LED should flicker
while it is receiving a valid IR remote
control signal.
Arduino sketch
You can download the Arduino
sketch for this project: siliconchip.
au/Shop/6/450
If you don’t already have it, download and install the Arduino IDE from
www.arduino.cc/en/software
The sketch uses the “irremote”
library. This library contains just
about everything you need to send
and receive IR signals for all manner of
devices. To install it, search for “irremote” in the Arduino Library Manager and click the install button when
you find it. We used version 4.3.1 of
the library.
Then open and upload the IR_
HELPER sketch. You will need to customise your sketch to work with your
devices, but this is made easier since
the prototype sketch will also show
received codes on the Serial Monitor,
allowing you to find the correct protocol and codes for customisation.
Screen 1 shows the typical result
when two different buttons on the
same remote control are pressed. Note
how the sketch even displays the recommended Arduino code. We used
three for the <numberOfRepeats>, but
you could try increasing that if you
find that codes are not being received.
Fig.1: this wiring diagram shows how our prototype is connected, with
components and modules wired directly to the processor board. You could
instead use a full-sized Leonardo board with jumper wires to make the
connections.
Protocol=NEC Address=0xEF00 Command=0x3 Raw-Data=0xFC03EF00 32 bits LSB first
Send with: IrSender.sendNEC(0xEF00, 0x3, <numberOfRepeats>);
Protocol=NEC Address=0xEF00 Command=0x3 Repeat gap=40800us
Protocol=NEC Address=0xEF00 Command=0x2 Raw-Data=0xFD02EF00 32 bits LSB first
Send with: IrSender.sendNEC(0xEF00, 0x2, <numberOfRepeats>);
Protocol=NEC Address=0xEF00 Command=0x2 Repeat gap=40800us
Screen 1: the terminal output from the IR Helper shows the protocol, address
and command of received IR codes. The sketch also prints the necessary
Arduino code to replicate a received signal. Information about supported remote
control protocols is at https://github.com/Arduino-IRremote/Arduino-IRremote
Press the button you wish to emulate
and check its code using the sketch,
then copy it to the triggeredAction()
function of the sketch and upload it
again. You can then check whether the
transmitter works by typing ‘t’ into the
serial monitor.
The prototype sketch also sends this
code whenever it sees a code matching the RX_ADDRESS and RX_COMMAND values. The prototype sketch
will also run the powerOnAction()
function every time it is powered on;
you can add another IrSender command to that function if needed.
You would use this feature by plugging the IR Helper into the USB port
of a device like a TV, so that when it
is switched on, the powerOnAction()
is run. Since many remote controls
have a toggle action power button (ie,
pressing power can both switch the
device on and off), this can be a good
way to distinguish an ‘on’ action from
an ‘off’ action.
From here, you should be able to
see what changes you need to make
to fit the sketch to your situation. You
could also add other sensors to automate other functions. For example,
you could rig up a light or motion
sensor to switch on a lamp that has
IR remote control when it gets dark
or movement is detected.
The IR Helper could also be used
to add IR remote controls to devices
that do not have it by wiring up a
relay module to the Leonardo board
to switch things on or off upon receipt
SC
of certain commands.
The assembly is compact at just 10cm long.
We’ve left quite a bit of lead on the LED to allow
it to be bent for aiming purposes, but it could be
made shorter if necessary. The IR Receiver Module
is mounted upside-down (relative to the
Leonardo Tiny) so the pins
align with the correct
pads on the Leonardo
Tiny board.
siliconchip.com.au
Australia's electronics magazine
September 2024 67
|