This is only a preview of the March 2025 issue of Silicon Chip. You can view 49 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 "Power LCR Tester, Part 1":
Articles in this series:
Items relevant to "RF Remote Receiver":
Videos relevant to "RF Remote Receiver":
Articles in this series:
Articles in this series:
Items relevant to "Versatile Waveform Generator":
Articles in this series:
Items relevant to "Pico 2 Audio Analyser":
Items relevant to "Transitioning to the RPi Pico 2":
Purchase a printed copy of this issue for $13.00. |
SILICON CHIP
Mini Projects #022 – by Tim Blythman
RF Remote
Receiver
Jaycar’s MS6147 Remote Controlled
Mains Outlet lets you control mainspowered devices without having to deal with
mains wiring. It can be operated by the included RF
remote control or another device equipped with a 433MHz
transmitter (like we used in Mini Project #006, June 2024). That
handy RF remote control can be used to control other devices too!
T
he MS6147 Remote Controlled
Mains Outlet Controller bundle
includes three switched outlet receivers and a handheld remote radio frequency (RF) transmitter. The transmitter has four channels, so there is
an unused channel that could control
something else.
You can get extra mains outlet
receivers, such as MS6149, to use with
that extra channel. But that isn’t all you
can do with it. For example, imagine a
USB-powered lamp. While you could
control it from one of these outlets by
having a mains-powered USB power
supply plugged into it, that would be
unnecessarily complex.
You could switch USB power to
the lamp with a low-voltage relay
or even a transistor, as we did in the
Gesture-controlled Lamp Mini Project from January 2025 (siliconchip.au/
Article/17601). Or use this RF Remote
Receiver to control the relay or transistor instead.
It can receive signals from any of five
different RF transmitters and then control something attached to the Arduino
Uno board. Our project uses four LEDs
to show the status of the four channels,
making it easy to test the operation of
these systems. The basic operation can
be seen in our video at siliconchip.au/
Videos/RF+Remote
We also wired up a relay module to
demonstrate how to switch just about
any low-voltage device.
The Arduino ecosystem makes it
very easy to customise the operation of the Receiver; you could add
the USB-switching circuitry from
the Gesture-controlled Lamp to add
a switched USB outlet, for example.
Alternatively, you could add some
logic to the Arduino sketch to control
some other low-voltage device. You
could even program it to send a command (using a different medium, such
as infrared) to another device, unifying
control to a single transmitter.
Circuit details
Our circuit is quite simple, and we
have laid it out on a prototyping shield
attached to the Uno as per Fig.1. We
expect many constructors will want to
add their own hardware, so you might
consider what else you want to control
before commencing assembly.
The 433MHz receiver module gets
its power from the Uno via the shield
to its Vcc and GND pins. A simple
wire antenna is connected to the ANT
pin of the receiver, while its DATA
output goes to digital pin 2 (D2) of
the Uno.
Fig.1: the circuit is simple
enough to wire up on a
breadboard, but we laid it
out on a prototyping board to
make it more robust. Ensure
that the necessary pads are
connected underneath the
board. To switch something
with the relay, connect the
C (centre, common) and NO
(normally open) contacts as
though they are a switch’s
contacts.
siliconchip.com.au
Australia's electronics magazine
March 2025 59
We are using
this type of RF
transmitter for this
project. It can be
purchased as part
of a bundle (along
with one or more
Mains Outlets) from
Jaycar with catalog
codes MS6147 or
MS6148. Kits like
Jaycar MS6148
allow up to three
mains devices
to be controlled
by a handheld
remote, leaving a
channel free on the
transmitter for us
to use. The Mains
Outlets can be
paired with up to
three transmitters,
but our Receiver
can work with up
to five!
Four LEDs are driven by digital
pins 7, 9, 11 and 13 (designated A,
B, C and D, respectively). These have
been chosen to allow a bit of space
between them as they are laid out
on the shield. Their anodes connect
to the Uno’s pins via 470W resistors,
while their cathodes are all connected
to circuit ground.
A 5V relay module is driven from
digital pin 7 (connected directly to the
relay module’s S pin). The module’s
+ and – pins are also wired to 5V and
GND, respectively. About the only
thing that should not be changed is
the receiver’s DATA pin connecting to
D2. The library we are using depends
on the interrupt feature on this pin.
Software
We are using the RF433any library
to decode the RF signals in this project. It can work with encodings from
various protocols, including that used
explore these a bit later, but each of the
four LEDs behaves much the same as
one of the four mains outlets would.
For example, the ‘A’ LED will light
up when either the A ON or ALL ON
button is pressed. It will go out when
either the A OFF or ALL OFF button
is pressed. This keeps the operation
straightforward and intuitive.
The button codes are decoded independently, so there is no reason they
can’t be allocated to ten independent
and distinct functions by changing
the way the software responds to the
codes. In other words, there’s no reason the ON button has to switch an
output on, or the OFF button switch
it off. They are just buttons, including
ALL ON and ALL OFF. This is left as
an exercise for the reader!
Construction
by the Remote Controlled Mains Outlet Controller. More information can be
found at https://github.com/sebmillet/
RF433any
As noted, this library uses the
pin change interrupt feature of the
ATmega328, so this project will only
work with boards like the Uno or
Nano and can only receive data on
digital pins 2 or 3. It might work on
other boards, but that has not been
tested.
The library waits for a transmission
to be received and the 32-bit code is
extracted. In the code used by the Outlet Controller, 20 bits are assigned to
the address and four bits to the data
or command, with another eight bits
forming a checksum.
The software compares the address
to those stored and, if it matches, the
output state is changed. There are
mechanisms to learn an address and
save it in EEPROM for later use. We’ll
Have a look at our photos and Fig.1
to see how we assembled the parts
for our prototype. The circuit is simple enough to be laid out on a breadboard, but we figured many constructors would want something robust.
Fit the receiver module to the shield,
watching the orientation. Solder it in
place and then run insulated wires to
the necessary pins on the shield. Note
that some of the connections are made
between adjacent pads on the underside of the shield.
Next, fit the resistors and the LEDs.
Make sure the LED anodes (the longer leads) connect to the resistors.
Then connect all the LED cathodes
together and to circuit ground. The
relay module is wired up with plugsocket jumper wires; you could easily
allocate it to a different button by connecting its S pin to a different digital
pin on the shield.
We also added a short length (~17cm)
of coiled insulated wire to form the
antenna; naturally, it connects to
Parts List – RF Remote Receiver (JMP022)
1+ Transmitter from a Remote Controlled Mains Outlet Controller
[Jaycar MS6147 or MS6148]
1 Arduino Uno R3 [Jaycar XC4410]
1 Prototyping shield [Jaycar XC4482]
1 5V single relay module [Jaycar XC4419]
1 433MHz wireless receiver module [Jaycar ZW3102]
4 yellow 3mm LEDs [Jaycar ZD0110]
4 470W ½W axial resistors [Jaycar RR0564]
1 USB cable to suit the Uno
assorted hookup and jumper wires
60
Silicon Chip
Australia's electronics magazine
The 433MHz receiver module
(Jaycar ZW3102; above) and 5V
relay module (Jaycar XC4419, left).
siliconchip.com.au
the receiver module’s ANT pin. This
length makes it a quarter-wave antenna
at 433MHz, but we’ve generally found
that these receivers work fine with just
about any sort of antenna, or sometimes none at all!
Programming
Plug the shield into the Uno and
connect it to your computer for programming. If you don’t already have
the Arduino IDE installed, get it from
www.arduino.cc/en/software
Now install the RF433any library.
Open the Library Manager in the IDE,
search for “RF433any” and install the
library with that name. We included
a ZIP file of the version we used in
the software download package (get
it from siliconchip.au/Shop/6/1820).
Assuming you have built the hardware as presented, select the Uno
board and its serial port, then upload
the RF_RECEIVER sketch. Open the
serial monitor at 115,200 baud to interact with the Receiver. You should see
something like Screen 1 appear when
it starts up.
The serial port is used for programming new codes and testing but it is
not needed for normal operation (ie,
receiving and responding to codes).
The status report can also be triggered
by sending a ‘~’ character (tilde) to
the terminal. You will probably need
to press Enter after that in the Serial
Monitor, but other terminal programs
may not require that.
Pressing a button on a transmitter
should result in a 32-bit code (eight
hexadecimal nybbles) being printed
to the serial monitor, like at the top
of Screen 2. You can then enter “s” to
save the address; it will be saved to the
first free spot. The new code is seen in
the updated status report.
Subsequent presses of that button
will also report that the Receiver is
responding to that command, and you
should see the corresponding LED
switch on or off. Sending “0” on the
serial monitor will delete the code allocated to the first slot; 1-4 will delete
the others.
So if you have multiple transmitters,
you should press a button on each,
then save it to the Receiver. After that,
you can check the saved addresses
with the “s” command. Each change to
the address list is implemented immediately and also saved to EEPROM, so
it will be available when the processor is restarted.
Once it is all set up, it does not need
to be connected to a computer and can
be powered from a USB power supply
instead. If you are interested in adding
your own hardware to the Receiver,
you can change the output pins near
the start of the sketch with the likes
of the RF_A_OUTPUT #define. The
actions caused by each command can
be customised further in the code
Action() function.
Summary
The compact handheld transmitters of the Outlet Controller can now
be used to control things other than
mains outlets. With the Arduino IDE,
you can add your own hardware and
SC
functions to our simple design.
This is the
finished RF Remote
Receiver. You can change
how the Arduino software responds
to different commands.
siliconchip.com.au
Australia's electronics magazine
SCREEN 1
________________________________
A: OFF
B: OFF
C: OFF
D: OFF
0 CODE: 0x----1 CODE: 0x----2 CODE: 0x----3 CODE: 0x----4 CODE: 0x----Last code: 0x0
~ for debug data
s to save last code to a slot
0-4 to clear a slot
∎
When first powered on, the Receiver
will deliver the status report shown
here to the serial port at 115,200
baud. You can also trigger the report
by sending a tilde character (“~”).
SCREEN 2
________________________________
903E0FAE
Added to slot 0
Saved
A: OFF
B: OFF
C: OFF
D: OFF
0 CODE: 0x903E0
1 CODE: 0x----2 CODE: 0x----3 CODE: 0x----4 CODE: 0x----Last code: 0x903E0
903E0FAE
0: A ON
903E0FAE
0: A ON
903E0FAE
0: A ON
903E0FAE
0: A ON
903E0FAE
0: A ON
903E0FAE
0: A ON
903E0FAE
0: A ON
Slot 0 cleared.
A: ON
B: OFF
C: OFF
D: OFF
0 CODE: 0x----1 CODE: 0x----2 CODE: 0x----3 CODE: 0x----4 CODE: 0x----Last code: 0x903E0
∎
To add a code, press a button on your
transmitter and see that the Receiver
acknowledges it, then send “s” on
the serial port. After that, you should
see the Receiver respond to that
transmitter. If you get an error that
all the slots are full, free up a slot by
sending a digit from 0 to 4.
March 2025 61
|