June
2004, Issue 167
Wireless
Monitoring System
CUT
THAT POWER BILL
Getting
minimal power consumption requires careful design and
programming—no detail can be ignored. The CR2025 lithium
battery can supply 170 mAh. This translates to an average
of 19 µA over a one-year period. The single sensor internal
pull-up can easily draw 10 times that current (see Figure
8)! Therefore, it’s wise to disable the pull-up after
a trap trigger is detected: simply switch its data-direction
bit, making the pin an output, and set the output to
zero. (Refer to the REED_ENABLE and REED_DISABLE macros
in hardware.h.)
|

(Click
here to enlarge)
|
Figure
8a—When the switch is closed, the input pull-up
(ranging from 16 to 36 kW) can eat up 10 times the
average current required by the entire circuit.
b—To avoid unnecessary current leaks, after a switch
closure is detected, the pull-up is disabled and
the pin direction is changed to an output, whose
value is set to zero. |
Another
trick is to enable pull-ups for port B. Although not
bonded out on the eight-pin QT part, they exist on the
silicon. This is why I included QY in place of QT header
files in the transmitter project.
Most
of the time, the MCU is in Stop mode, relying on an
automatic wake-up timer and keyboard interrupts to get
back on from time to time. The timer interrupt replaces
the usual software-based wait loops, making the MCU
rest in Wait mode during transmission in order to reduce
power. To save additional current, I disabled the ADC
and stopped the 16-bit timer when it wasn’t in use.
Refer to Donnie Garcia’s “MC68HC908QT4 Low Power Application”
for tips about low power.
Photo
2 shows the current drawn by the prototype during transmission.
I took the measurement from the voltage drop through
a 100-W resistor in series with the positive supply.
A 5-V bench supply powered the circuit.
|

(Click
here to enlarge)
|
Photo
2—The batteries last for years. Using Wait mode
limits the average current during transmission to
1.9 mA. The overall average consumption is just
3.1 µA because data is transmitted only one time
per hour (voltage drop on a 100-W series resistor:
vertical = 100 mV/div, horizontal = 10 ms/div). |
The
average current over a full transmission cycle (see
cursors) is just 1.9 mA. The trap transmits for up to
200 ms every hour during operation (i.e., 1/18,000 of
the time), requiring 0.1 µA (1.9/18,000) on average.
This contributes to the current required by the circuit
in Stop mode, which can be anywhere from 0.1 to 5 µA,
according to the datasheets. My prototype required approximately
3 µA, which means that it can theoretically run for
about 55,000 h from a 170-mAh charge. That’s six years!
In practice, the actual battery life might be noticeably
shorter than this because of environmental conditions,
tolerances, and discharge curves.
SYSTEM
TEST
I
built a couple of prototypes to perform preliminary
tests. I used dual-in-line MCU samples that are suitable
for prototype boards and manual soldering. I placed
the transmitter inside an off-the-shelf plastic box
measuring only 54 mm × 58 mm × 28 mm, which looks spacious
(see Photo 1). Production units can be much smaller
than this. An older solder station case, refurbished
for the occasion and completed with a few Dremel tool
touches, provided an excellent enclosure for the receiver
board (see Photo 3).
|


(Click
here to enlarge)
|
Photo
3a—The receiver box is recycled from an old soldering
station. b—The receiver is simple enough to be assembled
on a prototype board. The display and keyboard are
fixed to the front panel with thick double-adhesive
tape. |
You
can place the transmitter inside most commercial traps
without difficulty. However, the transmitter range is
greatly reduced for all-metal traps because of the shielding
effect. A future release should provide an external
aerial. Special hardened plastic must be used for the
transmitter box because it’s likely that some rodents
will try to bite it. I am also considering reducing
the number of possible trap codes from 128 to 64, or
even 32, to make the ID set up less tedious.
The
system works well, with neither false nor missed triggers.
At last, I can monitor traps in the attic and basement
from my desktop!