Serial Port Thermometers and Perl

temp-2009-11-13_09-21-02

About two years ago, I adapted a thermometer design that I found on the web to be used with Perl under Linux — it worked reasonably well, and after a while it fell into dis-use, probably because the wiring was wrong as I found it — I had tried to extend the wiring and it didn’t work, so I went in search of lower-hanging fruit…

Anyways, the central idea is this:

A thermistor, that is, a component that changes it resistance with temperature, is placed in parallel with a capacitor, and the butt of the capacitor is connected to ground, and the top of the thermistor is connected to an output serial port control line. An input serial control line is connected to the top of the capacitor, which is also the bottom of the resistor. When you direct the output control line to apply positive voltage, you will charge the cap through the thermistor, and you will be in the land of RC time constants, where you can derive the value of R for the thermistor, and therefore the temperature.

Of course, there are a couple of diodes involved to keep things right-side up, since RS-232 applies plus and minus voltages.

With the average 9-pin serial port, you can wire up two thermistors, on DTR/DSR and RTS/CTS.

The original was set up for Windows, with some Visual BASIC program, you know the kind that’s always missing some OCX file or other. I “ported” the idea to Perl, and as soon as I can find the guy’s name, I will add it here. The Perl module Device::SerialPins is central to this scheme, as well as good old Time::HiRes.

I am looking for the original files in order to get the curve-fitting procedure, because, for what-ever reason, it’s uncalibrated on the new hardware, and tests have shown that the temp differential is non-linear, so I am not likely to get off that easy.

Still, it’s a digital thermometer for pennies, possibly free, since it used things that you’re likely to have, if you’re the kind of person that’s likely to have them…