University of Washington Tacoma CES Projects

Room Temperature Monitoring System

Build a small network of temperature sensors to be deployed in CP206H. These sensors will monitor the temperature of this room and when the temperature exceeds a given threshold, notifications will be sent via email to concerned persons. To accompany this, the sensor network will provide a web interface to allow individuals to query the history of the room's temperature.

Visit the live website
Username: guest@gmail.com
Password: 1Password!

Problem Statement

Build a small network of temperature sensors to be deployed in CP206H. These sensors will monitor the temperature of this room and when the temperature exceeds a given threshold, notifications will be sent via email to concerned persons. To accompany this, the sensor network will provide a web interface to allow individuals to query the history of the room's temperature.

Design

Interview with the user

The motivation for the project was that one particular computer lab on campus was reported to be experiencing temperature spikes on the weekends when the lab was used less frequently. The theory was that the doors not being opened and closed frequently was causing a build up of thermal energy. Evidently, the maintenance staff was less than convinced of the phenomenon. Our goal was to build a system that would monitor, record, and graph the temperatures over time and have the option to alert recipients via email if the threshold (established by some administrator) was exceeded.

- At least one sensor must be deployed to the environment for temperature measurement.
- Ideally, multiple sensors should be placed throughout the room to provide a broader picture of the temperature in the space.
- Wireless sensors throughout the room would be preferable to make easier deployment in the space.
- The sensors should will be measuring in an expected temperature range from 50-100 degrees Fahrenheit.
- The sensors should be accurate to within +-3 degrees Fahrenheit.
- The system should send a notification email to the relevant recipients when a certain temperature threshold has been reached.
- The threshold at which an email is sent out should be adjustable by the user through some interface.
- There should be a web-based user interface to view current temperature.
- There should be a web-based user interface to be able to query temperature trends over time.
- The user interface should be simple to use.
- The system should require little to no maintenance.
- The system should run on 120VAC and any peripheral sensors not directly connected to the central hardware should either run on 120VAC or have power efficiency to allow batteries to be used for extended periods of continuous operation without frequent replacement.

Physical Layout

The Black Box design can be seen at the top of the page. The general layout takes advantage of the cable raceways already in place around the perimeter of the room for network and power cables. The design requires the use of a Raspberry Pi as the microprocessor, which is placed in an enclosure in the center of the room. Five nodes are used, each of which consists of a single 22103KT as the resistive temperature device (RTD). Because the Raspberry Pi MCU doesn't have built-in Analog to Digital Converter (ADC) capabilities, a MCP3008 Analog to Digital Converter (ADC) was used to interface to the MCU. Using a single CAT5 cable, the sensors were wired into one long cable that would run around the perimeter of the room with one sensor at each corner and one in the middle.


The sensors were chosen for their linear response and were easily calibrated against a Go!Temp Vernier instrument. 22 ADC values were recorded on the MCU for each of the five sensors over a temperature range of ~60-120 deg F. The data for each was entered into Matlab to generate the linear regression for each sensor. Below is a single set of data points for one sensor.

Each sensor is set up to take a measurement every hour. On the hour, the sensor takes a total of 10 measurements over the period of a minute and the exponential weighted moving average is calculated. Once all the sensors have completed their individual measurements, the average of all values is calculated. This is all done in C on the MCU. Additionally, the algorithm takes into account the expected range of ADC values related to the range of temperatures the room can reasonably experience (50-100 deg F). If, for any reason, an ADC value is detected that is outside that range, it is considered an outlier and is not included in the averaged value.

Software

With the hardware in place and working reliably, the web interface was developed. The initial code was written in C to facilitate the MySQL query so that temperature values could be saved into the MySQL database. A PhpMyAdmin control panel was used to troubleshoot the system as well as to see the data collected from the temperature sensors. PHP code was developed to read the MySQL database and translate it into a Json database for later use in the web interface. Below is a flow diagram showing the the different phases of the system:

Now, the transformed Json data was accessed trough PHP code and made into a highChart graph which was displayed in the domain as an interactive graph. On the website, the user has the ability to see the temperature threshold of the system and well as change this threshold as shown in the following figure:

The user can also change the alert e-mail through the web as well as add additional e-mails for alert purposes:

With the system in place for a few weeks to monitor activity before the project was finally due, one particular weekend recorded the expected spikes in temperature over 80 deg F. We recorded a screen capture from the website to display to the user.

Conclusion

While the hardware utilized to sense and transmit data to the MCU is quite simple, the project provided some insight into how embedded systems can be used for common applications, not only for complex control systems. Interfacing with the hardware also provided good practice in filtering data through the software. The real experience gained here was in interfacing with the MySQL database and the PHP based web page that is hosted on the MCU itself. Unfortunately, because of the time constraints on the project, work needed to be delegated to various members of the team. I spent more time working on the hardware side of the project with the sensors, the enclosure, and the software to interface the temperatures gathered with the database than I did with the web portion.

I am trying to make up for the missed opportunity to learn, by developing this site and a separate web page for our Senior project that will be hosted on the MCU to support the interaction of the user with a remote camera system. Click this link to read more about that project: A 5-D remote camera system.

Team Members for the Room Temperature Monitoring System:

Faculty Sponsor:

George E. Mobus, Ph.D.