Thursday, November 15, 2007

Simple Serial Port Thermometer

I wanted an easy / cheap way to record the temperature in my room, near my bass (to prevent cracking), in Mike's terrarium (to keep him alive), and throughout the house. I found a blog post describing exactly how to do this for less than $1 in components. So last weekend I stopped by HSC in Santa Clara and picked up the necessary parts.

1 Thermister (1K Ohm or more)
1 Capacitor (100 uF or more)
1 Diode (D6520 though many others will work)
1 Female DB-9 (Serial Port) Connector and some wire (from an old Ethernet cable)

A resistor's resistance varies with temperature which we attempt to minimize in normal resistors. A thermister is a special case where this effect is not limited. Therefore if we can measure the resistance of the thermister we can figure out the temperature.

In this circuit we charge the the capacitor through the resistor. We can time how long it takes the capacitor to charge using the serial port. From that we can extrapolate the temperature. So I soldered it all together, wrote a program to measure the charge time, calibrated it and got the finished product below!


Now I can install these all over the inside and outside of my house, in my car, and anywhere else I have a computer. For those who know me, that's everywhere! Over the past two days I put the lead outside and recorded the temperature every minute. I ended up with a pretty cool graph.


I've marked night and day and we can see the temperature fluctuate with sunlight. However, despite what the graph says it did not get to 85° F yesterday! The graph shows a sharp increase at 12:47 PM and erratic data for the next 3ish hours (highlighted). As it turns out, this comes as a result of direct sunlight hitting the thermister (hence why the news always reports temperature in the shade).

Next steps for me are to automatically generate graphs like this online and write an Instructable describing the process in a bit better detail.

Technologies: Basic Electronics, Python

No comments: