Mailbox Monitor
The goal of this project is to log and inform me when my mail comes. It’s mainly an excuse to play around with ZigBee mesh networking using XBee modules from Digi. Read my initial brainstorm here and here.
Here are the details of my progress.
Controller Node
My coordinator node will soon be installed in the attic, with 5V and RS-232 run from my server in the basement over two extra pairs of CAT5 I’ve already pulled for my attic temperature monitor. I didn’t have any 3.3V RS-232 level converters laying around, so I installed a MAX232 run directly off the 5V feed, whose 5V TTL output is then converted to the 3.3V side of the circuit fed off the onboard 3.3V regulator. I used a 50mw XBee module with an external RP-SMA antenna which should hopefully reach my mailbox without a problem without any router nodes in between.
Mailbox Node
Here’s the mailbox node I plan to install under my mailbox. I’ve set up a 50mw XBee module as an end node with pin sleep mode enabled. I’m using a Freescale MC9S08QG8 to monitor a magnetic reed switch on a keyboard interrupt I/O line. When that line changes state, the microcontroller wakes up, wakes the XBee module, sends a state notification using the SCI to the XBee DIN line, which sends it to my Coordinator Node in the attic. The microcontroller then waits 30 seconds to make sure the XBee module had time to re-synch with the Coordinator Node if necessary and transmit the data. Then, the microcontroller puts the XBee module to sleep and puts itself into stop mode 3 until the keyboard interrupt wakes it up again.
This circuit will run off battery power, so I’ve been trying to reduce current consumption as much as possible. A couple milliseconds a day it will draw the full 295 milliamps during transmit. The rest of the day, it will be sleeping. Right now, the circuit consumes 50 microamps while sleeping with the switch open, but 200 microamps while sleeping with the reed switch closed, due to the current drawn across the pullup resistor to ground when the switch is closed. I’m still trying to figure out if I can reduce that figure, since this will be the normal state.





Leave a Reply