I picked up an USB Temperature Sensor on eBay a few weeks ago. Total cost just over 4 Euros. It would have been rude not to get one. It is a HIP TEMPer model from http://www.pcsensor.com/. They have a few mad products such as a three foot switch. I like it.
I took quite a while to actually arrive.
It arrived today, so I plugged it into a Windows XP machine and installed the software. Yep, worked fine. The software that comes with it is basically crap. The colour scheme is way ugly.
This is not a problem at all as I planned to use it on Linux. I wanted to be able to poll the device and pull a temperature reading off it, stick it in a mySql database and present the data via a PHP web page. Bob's your aunty.
After consulting Dr. Google for a while, I came across this site, that had what I was looking for. http://relavak.wordpress.com/2009/10/17/temper-temperature-sensor-linux-driver/
I downloaded the driver and ran it. Perfect, almost.
It ran in a loop with lots of other data being shown. The default executed in a debug mode.
So, I had a look at the source code. I am not a C programmer but it was easy to follow.
I changed a few settings, commented out a few lines, compiled and tested it. Wash, rinse and repeat.
After a very short period of time, I had what I wanted.
The program just reads once and outputs the temperature in centigrade.
Just the thing to use in a script and automate.
I think I will get a few more. Very cheap and useful. Brilliant piece of kit.
I use 1-wire sensors for a lot of my temperature measurements. This is another tool for the toolbox. This is all due to the Linux drivers provided by http://relavak.wordpress.com/2009/10/17/temper-temperature-sensor-linux-driver/.
He is the hero.
I have added an update to this blog - USB Temperature Sensor and Linux (Part 2) on 10/08/2012. Included come compiled code.