[clug] Linux compatible external Thermometer

Neil Pickford neilp at goldweb.com.au
Tue Feb 23 06:06:14 MST 2010

Yes I am doing this for monitoring my SolarHart hot water performance 
using Slackware 13.0, DS18b20 sensors, One Wire File System (OWFS), 
Round Robin Database Tool (RRDTOOL) and some bash scripting.

See: <http://happy.emu.id.au:8430/temps/Last_24_Hours_temps.png> for a 
near live report of the 8 sensors I currently have installed.
or: <http://happy.emu.id.au:8430/temps/Last_Week_Outside.png> as an 
example of a week for a single sensor.

The temperature sensors I use are and a bunch of Maxim (Dallas) DS18b20 
one wire devices that look like a TO-92 transistor.
Each has a unique serial number and they are all connected in parallel 
on a single pair of wires (the one wire specification doesn't count the 
These sensors cost around A$7 each from Farnell or A$2.50-3.00 off eBay.

To interface and read them you use a spare serial COMM port, if you have 
one, with a passive circuit consisting of some resistors, Schottky & 
Zenner diodes.  See Figure 13 on Page 21 of this link:

You can also use USB as the interface but this tends to cost a lot more 
for the converter A$75-200.  Maxim tend to point people in this 
direction as these devices use special purpose interface ICs that they make.

The sensors run on flea power and only really draw a few milliamps when 
you actually read them. You can either power the devices off the COMM 
port over the one-wire data line (parasite power supply mode) or supply 
a third wire with a 5V current limited supply, however it is important 
that this 5V supply is floating WRT to the PC ground if you are using 
the cheap COMM port interface as the one wire ground is RXD and is NOT 
the PC ground (i.e. you can't directly connect to the USB port supply on 
the computer)

To access the one wire bus install the One Wire File System owfs
<http://owfs.org/> available on sourceforge.  owfs links into the FUSE 
filesystem modules in Linux.

For data storage, statistics, query, graphics and presentation I am 
using RRDTOOL <http://oss.oetiker.ch/rrdtool/>

I read the sensors every minute with a cron job in a bash script to QA & 
load the data into RRDTOOL.  I generate a bunch of PNG files for the 
webserver (Apache) every 10 minutes using RRDTOOL.

So with a bit of your time and effort it is achievable to do this in the 
region of A$20 depending on what resources (electronic bits) you have at 
your disposal.

Neil Pickford

Paul wrote:
> just as a hobby I would like to start measure the outside/inside temps 
> and I would be interested if anyone has used some sort serial or USB 
> thermometer  on there Linux box?
> Note preferably a cheaper device ie around $20
> Paul

More information about the linux mailing list