background image
168
This is the A-head
Part II: More Hacking Techniques
Each lamp (or set of lamps) must be outfitted with an addressable radio
receiver. Several companies sell low-cost radio receivers that could be used
for this purpose.
Figure 8-28
shows a block diagram of a wireless lamp con-
troller, and
Figure 8-29
shows a block diagram for a simple transmitter.
The radio link provided by the inexpensive receivers will require additional
software to allow for reliable data transmission and reception.
Figure 8-30
shows the different operations that the data must undergo in order to be
reliably transmitted over a "raw" radio link. There are many other methods
available, but this one is simple and reliable.
In order to receive a radio channel coded packet, the inverse of the transmit
operations must be performed. This chain of functions is shown in
Figure
8-31
.
Error Control Coder
The radio channel will likely have
noise on it from time to time. To
prevent noise from hindering reli-
able data reception, an error-cor-
recting code should be applied to
all data.
You'll find a good explanation of
error correcting codes at
http://
www.eccpage.com/. The web page
also includes C source code. For
this simple system, I recommend a
BCH code.
Each frame should be organized into
a packet and a few command codes
defined.
Error coder
Data input (data
payload, address,
desired function)
Packetizer
Channel coder
Radio hardware
Figure 8-30: Wireless transmitter software
Radio hardware
Data output (data
payload, address,
desired function)
Channel deCoder
DePacketizer
Error code
decoder
Figure 8-31: Wireless receiver software
Micro-
controller
Low-cost
radio
receiver
Relay
Relay driver
transistor
120V socket
120V plug
Lamp
Figure 8-28: Wireless lamp receiver
RS-232
interface
From PC Serial port
Low-cost
radio
transmitter
Figure 8-29: Wireless transmitter