This project will show you how to create a remote temperature monitoring system using Phidgets. These systems are often used to ensure the temperature at a remote location (vacation home, server room, etc.) are not at dangerous levels. This system allows you to set a minimum temperature that you are comfortable with, and if the temperature drops below that limit, a notification will be sent. The program could easily be modified to send notifications if the temperature gets too high, or just to send notifications every day, hour, or minute!
Step 1: Skills Required
All you need is some basic programming knowledge for this project. The program is written in C# but could easily be ported to your favorite language!
Step 2: Hardware
Step 3: Project Overview
This project consists of a TMP1000 connected to a VINT Hub that is plugged into a computer. Software running on the computer interfaces with the electronics and sends a notification (email or text) if the temperature drops below a certain temperature. Note: the VINT Hub can also be used to interface with analog sensors, so if you have an old analog temperature sensor laying around, make sure to use it! If you are using an analog sensor, some slight modifications to the code will be necessary. Leave a comment for more information.
Step 4: Software Overview
At the top of the form the current temperature is displayed and it is updated every 30 seconds. Below the temperature, there are a few settings:
Temperature Limit: If the temperature is consistently below this value for more than 5 minutes, the user will be notified. An email will then be sent every hour until the temperature rises.
Send Notification To: Specify an email address that should be notified when the temperature drops below the threshold. Note: many wireless providers offer an email to text option, so notification can be sent directly to a phone.
Under the Email Settings tab, there are a few more options:
- Server Address: Email server address. If you aren't using Gmail, a quick Google search will result in articles like this that will help you out.
- Username: The email you would like to send notifications from. For this program I created a new Gmail account and allowed less secure apps to use it.
- Password: Password for account.
After entering information into all the required fields, the status in the bottom right corner of the form will indicate that the program is running. After that, you can simply minimize the program and forget about it!
Step 5: Code
Code for this project is available in the TemperatureMonitor.zip file. Before compiling the program, make sure you have the Phidget libraries installed on your computer. You can find the Phidget libraries here.
Here is a quick overview of the code:
- When the form loads, create a TemperatureSensor object and subscribe to attach, detach, and error events.
- In the attach handler, set the DataInterval to 30 seconds.
- In the event handler, update the temperature label and check if the temperature is below the limit. If the temperature is below the limit, increment a counter and exit. If the counter indicates that the temperature has been below the limit for 5 minutes, send a notification.
- If a notification has been sent, start a 1 hour timer that will prevent any more notifications from being sent until the time has elapsed.
Step 6: Notifications
Here is an example of an email notification that was sent when the reported temperature was below the 25°C limit for more than 5 minutes.
Step 7: Questions?
If you have any questions about the project, let us know in the comments section!
Thanks for reading