Hardware
The hardware was constructed on a breadboard for testing, then the schematic was created in Eagle and
a circuit board manufactured.
Input power is provided from a ‘wall wart’-type adapter, providing 5 VDC through a standard 2.1mm DC plug.
Voltage regulation is done by an MIC39100-3.3WS providing +3.3 VDC.
The microcontroller is a Parallax P8X32A (Propeller) in the QFP package, with the program stored in a 24LC512
Serial EEPROM. The EEPROM is mounted in a socket. Programming of the EEPROM is done out of circuit.
A three-pin header provides connection to a DS18B20 One-Wire Digital Thermometer. The temperature sensor
is mounted in a hole in the top of the case, sealed underneath with a little Sugru.
An XBee Wireless RF module is mounted in the required 2mm sockets. It is an Xbee 2mW Series 2.5 Chip Antenna.
When I purchased another unit recently for doing some breadboarding, I purchased this as
Xbee 2mW PCB Antenna - Series 2 (ZigBee Mesh). The XBee was configured using the Digi X-CTU configuration
software and set as ZNET 2.5 ROUTER/END DEVICE AT.
Connection to the LCD is provided via a three-pin header. The LCD is in a 2-line by 16-character format.
This is a serial-enabled, 3.3V, White on Black LCD, purchased from Sparkfun Electronics.
A two-pin header provides a connection for the pushbutton (normally open) switch. The pushbutton switch
input to the Propeller is pulled to ground via a 10K resistor, and goes high (3.3V) upon switch closure.
The pin is current-limited via an inline resistor. A small tactile pushbutton is also soldered to the pcb
which provides a RESET function for the microcontroller, when pushed.
Software
The main cog initializes two communications ports (FullDuplexSerial4port), one for communications
with the LCD, the other to talk to the XBee. The DS18B20 is then initialized (jm_1-wire) and checked.
Other cogs are then started, to read the temperature on a timed basis, to handle sending and receiving data,
to keep the LCD updated, and to watch for button presses. The main cog then shuts down, with all of the work
being handled by the launched cogs.
cog_Temps
Reads the temperature from the DS18B20 and stores the return in Hub memory, then sets a flag 'TempUpd'
to indicate new temperature data. Waits an interval (currently 5 seconds) and repeats.
cog_Display
This cog runs in a loop watching two flags, 'TempUpd', indicating the local temperature has updated,
and 'NewUpTemp', indicating that the remote (upstairs) temperature has updated. The LCD is then written
with the new information.
cog_Remote
This cog monitors the XBee ‘receive’ line for incoming data. The incoming data is identified by the first character received:
First Char | Message |
U | the transmission is from the upstairs XBee. The rest of the transmission is parsed and stored as the upstairs temperature and a flag is set ‘NewUpTemp’ to indicate that data has updated. |
| |
T | this is the current date/time and outside temperature, sent from the upstairs unit. The LCD is cleared and the date/time displayed on the first line, with the outside temperature displayed on the second line. After a period of time (currently 5 seconds), the LCD screen returns to the normal upstairs/downstairs temperature display. |
This cog also transmits the request for the upstairs temperature data when the appropriate flag 'AskForTime' is set.
cog_Button
This cog runs in a loop waiting for a button press. When a button press is detected, the cog sets a flag
‘AskForTime’ to indicate that the Master unit should be queried for the current date/time and outside temperature.
Thermo-Down
Thermo-Down circuit board layout
Thermo-Down schematic
Thermo-Down
Thermo-Prop
Last updated: 14 Feb 2014
Web Author: John Locke
Copyright © 2014 IdleTime Industries - ALL RIGHTS RESERVED