I was able to determine, as single byte values in
2-digit hexadecimal notation. There are commands
to independently switch up to 4 units per remote, so
given the number of possible identifiers, this allows
262, 144 individual outlets to be controlled!
D off (generated by unused
button pad on the remote)
D on (generated by unused
button pad on the remote)
All off (no button)
Pulse all off units on momentarily,
then off again (no button)
This information enabled me to encode and inject
my own data to be transmitted to the outlet units.
To accomplish this, I made some further modifications to the Bit Whacker firmware, so that it would
generate waveforms comparable with those produced by the remote.
time, the opening and closing of the USB port
would sometimes fail. So I split the program into 2
separate processes: a server, which runs all the time
in the background, holding the serial port open and
managing the flow of commands; and a command-line client, which sends commands to the server.
I used TCP/IP sockets as the communication
method, which lets the server and client run on
different machines if desired.
You can download the application, Remote Outlet
makezine.com/22/rcoutlets. Figure H
(previous page) shows the application running on
Windows. The electrical socket icon in the system
tray indicates that the server process is running.
To create the toolbar at the bottom, I selected
New Toolbar from the regular toolbar’s right-click
menu. Then I created the Lamp shortcuts on the
desktop and the Fan shortcuts on the toolbar and
entered the command-line program name, outletctl,
and its required arguments (device_ID [0-65535], button [a, b, c, d, all], and state [on, off]) in the Target box.
I also chose an appropriate icon using the Change
Icon button. (I created all of the application’s icons
For the scheduled tasks shown, I dragged the
desired shortcuts into the Scheduled Tasks window,
under Control Panel/Administrative Tools. This pane
supports numerous scheduling options, but if it isn’t
flexible enough, you can also call the program from
a batch file or scripting language of your choice
(I’d recommend Perl).
There’s a great deal of potential in these off-the-shelf remote outlet systems; their availability
and relatively low cost makes them ideal for any
electronic projects that need to switch plug-in
This project highlights just one way of using them,
and I’ve tried to keep my modifications as general
as possible so they’re useful to others. Hopefully
I’ve shown how easy it can be to interface with these
systems, and how, by understanding a bit about how
they work, you can make them work the way you
want them to!
The Remote Outlet Control
The final part of the project was to write a computer
application in C++ to control the units, as it wasn’t
very convenient having to enter commands into a
Rather than writing a fancy graphical application,
I decided that a command-line program would be
better. Firstly, it would be simpler, making it less
prone to errors and easier to port (I wanted to run
it on both Linux and Windows).
Secondly, I could easily create shortcut icons
that controlled particular appliances by simply
associating them with command-line program calls.
Finally, I could automate the process in different
ways, either by calling the program from a script or
batch file in response to certain events, or else by
triggering it at preset times from the Task Scheduler
(on Windows) or a cron job (on Linux).
While developing my first version of the program,
I found that if you called it twice in rapid succession, say, to switch multiple devices at the same
Andrew Wedgbury is a software engineer, keen electronics
hobbyist, and big fan of open source software and hardware. He always has a few projects on the go, which he tries
to document at
74 Make: Volume 22