A 3-Station Temperature/Humidity Logging System Utilizing the Parallax P8X32A Microcontroller
The ThermoProp system consists of three modules, all utilizing a P8X32A (Propeller) microcontroller for a brain. This project originally started as an upstairs/downstairs thermostat, but has morphed into a data logger. I may eventually add a fourth module to interface to my home HVAC system. Currently the system logs temperature & humidity from outside and the upstairs of my house, and only temperature from the downstairs of my house. Data is communicated wirelessly via XBee and logged to μSD every 15 minutes.
The Master unit (Thermo-Master
) is located upstairs and contains the µSD card which is used to store the collected data. The Master has a DS1307 Real Time Clock with battery backup (BR1225) and uses a Parallax SHT11 module to read the temperature and humidity. An XBee Wireless RF module is utilized to communicate with remote units. The user interface consists of a single pushbutton (used to set the date/time) and a 4-line by 20-character LCD with the following format:
UP: 77.1° H 24.2%
OUT: 53.2° H 29.3%
The Outside unit (Thermo-Slave
) is mounted to an outside wall of my house (with a Velcro strip). A location was chosen that is shielded from direct sunlight. The module is powered by 3 AA batteries. Typical battery life is on the order of 70 days. A Sensirion SHT11 temperature/humidity sensor is used to measure the outdoors temperature and humidity. An XBee Wireless RF module transmits the local data to the Master unit. Since it is battery powered, this unit spends most of its time in low-power mode, only waking up every 10 minutes (roughly) to take a reading and transmit the data. Without the power-down, the batteries will only last 7-8 days!
The Downstairs unit (Thermo-Down
) is, obviously, located downstairs. The downstairs unit does not measure relative humidity, only temperature. A DS18B20 One-Wire Digital Thermometer is used for the temperature sensing. An XBee Wireless RF module is employed for communication with the Master unit. The user interface consists of a single pushbutton (requests the current date/time and outside temperature from the Master unit) and a 2-line by 16-character LCD with the following format:
Pressing the pushbutton will cause the following format to be displayed for 5 seconds:
When first powered on, the Master unit will display the current date and time, updated every second, and the local temperature and humidity, updated every 5 seconds. The outdoors unit is the key to the data collection effort. In the battery-powered Outside unit, the Propeller and XBee are put into a low-power mode, with the Propeller doing a slow count. Approximately every 10 minutes, the Propeller powers-up, wakes up the XBee, gets a reading from the SHT11, and transmits the temp/humidity to the Master unit. The Propeller then puts the XBee back to bed, and returns to low-power mode.
When the Master receives the Outside data, it stores it and displays the data on the LCD. It then sends the local (upstairs) temperature to the Downstairs unit. The Downstairs module will store this info and update the data on its own LCD. It will then transmit the local (downstairs) temperature back to the Master unit. The Master again stores the data and updates the LCD.
Every fifteen minutes, on the quarter-hour, the current information is written to a text file on the µSD card, stored comma-separated in a .CSV file. At midnight a new file is created, with the filename in the format of yy-mm-dd.csv. When the new file is created, a header line is also written. A small example of a log file:
Date,Time,Upstairs (F),Humidity (%),Downstairs (F),Outside (F),Humidity (%)
03/01/13,00:00, 74.4, 28.3, 76.9, 41.7, 44.5
03/01/13,00:15, 74.2, 28.2, 76.7, 41.4, 45.0
03/01/13,00:30, 74.0, 27.9, 76.3, 40.9, 46.0
03/01/13,00:45, 73.6, 27.6, 76.3, 40.7, 46.3
03/01/13,01:00, 73.3, 28.7, 76.1, 40.3, 46.8
03/01/13,01:15, 74.3, 28.5, 76.6, 40.0, 47.0
03/01/13,01:30, 74.7, 28.3, 76.8, 39.8, 47.5
03/01/13,01:45, 74.7, 27.7, 76.9, 39.6, 48.2
The log files are copied from the µSD card, usually once a week. Data is copied to an Excel workbook (a new workbook is created each month) with a tab for each day of the month. Each day tab is identical. The data file is copied into the appropriate worksheet day. The worksheets are constructed to extract minimum/maximum data, and produce line graphs of temperature and humidity related to time of day, as below:
- Outside unit sends outside temperature and humidity to Master unit every 10 minutes.
- After receiving the outside information, the upstairs temperature is sent to the Downstairs unit.
- Upon receipt of Upstairs information, Downstairs temperature is transmitted to the Master.