Remote Temperature Monitor (beta version)

There was much coding done today.  The beta version of the remote temperature monitor app is finished and will be getting a trial run with a batch of ribs for the July 4th holiday.  I have a Maverick wireless thermometer to verify the temperature readings.  It works pretty well but the range sucks, which is why I hacked together all of the following.

Let’s take a look at how all this comes together.

The Arduino is parked outside next to my Weber Smokey Mountain with the thermocouple running under the lid.

It’s using a thermocouple and a MAX6675 chip to send data via a USB extension cable to a Linux netbook.

The Linux box runs a cronjob once a minute, grabs a few temperature readings (cat) and posts the data up to a PHP page (curl) which stores it in a MySQL database.  We use some regex to parse the temperature reading out to its own field.

The web server has a PHP page with an API for performing various actions.  For example. we can return the latest temperature as JSON.

[{"ID":"6337","TemperatureData":"104.45 104.45 104.90 104.90 ","Timestamp":"2011-07-03 14:10:11","Temperature":"104.90","Parsed":"1"}]

The Android app is written as a sticky foreground service and it has a client app to view the temperature data, change alarm settings, etc.

The high and low temperature alarms are adjustable and the app will beep and vibrate the phone for one second when an alarm occurs, but we can turn off the beeping if necessary.

Using the AlarmManager class, we set up a repeating task to download the latest temperature and parse it using Gson.  There is a continuous notification showing the latest temperature.  If there’s been no updated temperature data in the last 15 minutes (say a squirrel stole the Arduino), we throw up an additional notification as well as vibrate/beep the phone.

The Nexus One can do colored LED notifications, so it also flashes the LED yellow to indicate a data problem.

If the temperature falls outside the high/low range, we throw up a notification/vibrate/beep thusly.

We flash the LED red if it’s too hot…

…and blue if it’s too cold.

If all goes well tomorrow, I’ll have a nice set of data and will work in some line graphs with Google Charts.  The Arduino also needs some sort of enclosure for long-term outdoor use.

Leave a Reply

Your email address will not be published. Required fields are marked *