Issue
149 December 2002
Wireless
Temperature Sensor Stew
rfPICDEM1
Future
Electronics’s Technical Solutions Management Group and
Microchip have teamed up to make designing and implementing
wireless sensor applications dead easy. All of the math
and plumbing that’s common to putting RF boxes together
has been done for you. The plumbing refers to the RF
part of the demo board. In my FM radio days, I called
the transmitter techs plumbers, because they worked
with wave guides and tuned cavities just like real plumbers
worked with kitchen pipes. The only real difference
was that the radio plumbers didn’t do toilets and they
never got wet.
Figure
1 is a block diagram of the rfPICDEM1 wireless sensor
demo board set. The receiver and transmitter are separate,
microcontroller-based units. As you know, Microchip
has branched out its suite of products. Now, in addition
to the standard line of microcontrollers, this set of
rfPIC demo boards includes a Microchip LDO voltage regulator
(TC55) and temperature sensor (TC74).
|

(Click
here to enlarge)
|
Figure
1—It’s too bad you can’t click on the boxes to
go directly to companies’ web sites for the datasheets.
You can get a copy of the CD-ROM that contains
this image from your Future Electronics or Microchip
representative.
|
The
object of the rfPIC wireless sensor solution demo kit
is to show us how to use the Microchip rfPIC12C509 to
send temperature data collected by a Microchip TC74
temperature sensor over a short-haul 433-MHz RF link
to a smart receiver using a Philips UAA3201 RF receiver
IC front-ending a PIC16C925 with an integrated LCD controller.
Whew! That was a mouthful, but it isn’t as complicated
as that last sentence makes it seem.
The
transmitter is based on the rfPIC12C509AG that’s driving
a loop antenna, which is etched onto the transmitter
circuit board. The rfPIC12C509AG is really a standard
PIC12C509 coupled with a 433-MHz amplitude shift-keying
(ASK) transmitter. The RF side of the rfPIC12C509AG
consists of a crystal oscillator, an integral phase-locked
loop, mode control logic, and an open-collector differential-output
power amplifier. As you can see in Figure 2, the RF
section and the PIC microcontroller electronics are
logically separate, although they reside inside the
same physical package.
|

(Click
here to enlarge)
|
Figure
2—As you can see, the RF section and the PIC microcontroller
electronics are clearly separate from each other. |
Normally,
ASK modulation is performed by alternately changing
the amplitude of the carrier in a pulse width modulation
fashion (i.e., the carrier wave is modulated for a period
of time to signal a logic 1 and left idle for a period
of time to indicate a logic 0). Instead of employing
the more common PWM method, the rfPICDEM1 uses Manchester
encoding.
In
Manchester encoding, a logic 0 is seen as a transition
from zero to one at the center of the bit time. Conversely,
a logic 1 is indicated by a one-to-zero transition at
the center of the bit time. This results in a synchronous
bitstream with an encoded clock signal that doesn’t
always transition physically at bit boundaries; instead,
it always transitions logically at the center of each
bit time.
When
powered up, the transmitter sleeps most of the time
to conserve the battery. When it awakes, the PIC12C509
part of the rfPIC reads the TC74 using I2C signaling.
If the temperature has changed, the new temperature
is transmitted. There are two push buttons on the transmitter.
These push buttons are used to wake up the transmitter,
set the station ID, generate a test (calibration) tone,
or initiate the transmission of the current temperature
and transmitter switch status.
The
transmitter code was written to automatically change
the transmitter station ID (zero through seven) when
SW1 is pressed and held. Also, because each TC74 has
a permanent I2C address that depends on the part number
of the sensor, the transmitter code uses I2C signaling
to automatically determine the I2C address of the current
on-board TC74.
A
message sent by the rfPICDEM1 transmitter consists of
32 bits of header data (zeros) followed by a 4-bit sync
frame (ones) and 32 bits of data. The data field contains
the station ID (8 bits), the temperature (8 bits), a
4-bit sensor type, 2 bits of message type, 2 bits of
button status, and an 8-bit checksum. This entire message
is transmitted three times each time the transmit event
is invoked.
The
rfPICDEM1 receiver can detect and support up to 16 remote
transmitters. With the push of a button on the receiver,
you can select one of four modes of operation. You can
display the temperature local to the receiver, the temperature
at the remote transmitter, or the difference between
the local and remote temperatures can be exhibited.
Auto mode displays the local temperature followed by
all of the received remote temperatures. Two LEDs on
the receiver show the status of the remote push buttons.
|

(Click
here to enlarge)
|
Photo
1—Just another sunny day. Note the etched loop antenna
on the top of the smaller transmitter board. The
PIC16C925 that comes loaded with the receiver firmware
is a one-time programmable (OTP) part and can be
replaced with a windowed-reprogrammable part for
firmware development. |
As
you can see in Photo 1, both boards are battery powered,
and the receiver has on-board provisions for in-circuit
serial programming (ICSP). An 8-pin socket pad area
on the transmitter allows you to use a separate 8-pin
PIC or PIC in-circuit emulator to control the RF section
of the rfPIC. On the transmitter board, "X"
symbols mark the spots where the traces can be cut to
isolate the optional 8-pin PIC pads from the rfPIC12C509AG.
For a close-up view of these markings, take a look at
Photo 2.
|

(Click
here to enlarge)
|
Photo
2—"X" marks the spot. A cut of the trace
at every "X" logically separates the rfPIC’s
microcontroller I/O from the RF section. Only two
lines from the microcontroller side are used to
control the RF side. |