$30 Historical Temperature Sensor System using PC,1-wire, Perl, MRTG by xorshift
tempprobesceen1.PNG
PICT4133.JPG
PICT4134.JPG
1wireschematic.jpg
I wanted a cost effective way to record temperatures in different areas (computer rooms specifically) and present the data using graphs. Currently the temperatures are updated every 5 minutes, and can be accessed via a web page, but this could easily be modified to perform alerts based on thresholds.

For the initial system, I decided to monitor temperatures throughout my home (basement, 1st floor, Attic, and outside) I chose to use windows, as most of my clients have a windows system readily available.

The system is based on 1-wire devices, these things are amazing, and small. Basically using 2 wires, from the serial port adaptor (USB also avail) they receive power, and will acknowledge temperature requests based on their unique serial number being sent down the 1-wire bus.{{{
'''''''
}}}

What you will need
Hardware:
https://shop.maxim-ic.com
DS9097# IBACC Commercial (0 deg C to +70 deg C) Qty 1 Price $ 21.59
DS18S20 TO92 Military (-55 deg C to +125 deg C) Qty 2+ Price $ 2.57
CAT 5 cabling, crimpers, and RJ45 ends, RJ45 Coupler(preferred but not required)
Software
Windows Workstation (XP, 2000, etc.)
ActiveState Perl (Free) http://www.activestate.com/products/activeperl/
MRTG (Perl Script)(Free) http://oss.oetiker.ch/mrtg/
Apache (Web server) (Free) http://httpd.apache.org/

 
Remove these adsRemove these ads by Signing Up

Step 1: Get 1-wire up and talking

PICT4134.JPG
1-wire is bus network, and should be wired in a daisy chain manner, not hub and spoke, in other words devices should all be connected in a row, not all fed back to the serial port adaptor indivdually. (But you can do this with 1-wire hubs)

Wire up sensors, connect serial port adaptor, make sure pin out is correct, and reverse 1-wire and gnd.

open the following website, and run the 1-wire viewer,
it will show you all the 1-wire devices connected after you configure the correct interface type and serial port.

http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm

If you don't see any listed you may have it wired incorrectly, either way don't proceed until you see your devices listed like the screenshot.
tradergordo says: Feb 21, 2007. 10:47 AM
Excellent. I would love to try this as well, I've got two wireless weather stations and 3 thermometers in my house but nothing to interface with the PC. I'm also interested in trying to determine if its worth it to run an attic vent fan in the summer (if the attic is well insulated, maybe I'm just wasting electricity trying to cool a space that does not even impact the temps in the rest of the house). What conclusions did you come to in that regard? Thanks, Gordo
Sneak85 says: Nov 17, 2010. 8:18 AM
Actually how warm it is in your attic does effect the temperature in the rest of your house. The more insulation you does help with this.t Just a note you can check out this website consumerenergycenter.org/coolroof/ for more info. Or to some it up, it basically says if you have a light colored roof (opposed to the typical black or dark asphalt shingles) you can lower the temperature of your roof by almost 100F Since more light is reflected you reduce the amount of heat absorbed into your structure, reduce the heat island effect, and can reduce your cooling needs.
xorshift (author) says: Feb 23, 2007. 9:23 AM
My attic gets over 128 degrees f, so I imagine a ridge vent would help, and no ongoing cost post installation, either way you go you may have to look at increasing your soffit vents to equalize out the input/output.. I probably won't get it installed until later in the year though..
Derin says: Apr 29, 2009. 10:26 AM
You could also wire it up to the A/C and set it to try to keep the temperature constant.
ketas says: Mar 7, 2008. 4:34 AM
Good.
But what about RRDtool? I know it can run under win32 as well. MRTG isn't really for temperature logging and graphing (Maybe MRTG 3 will be).

I, personally, run it under FreeBSD.
Take a look: http://weather.si.pri.ee/

It's currently undocumented, but I'm happy to share everything :)
MrJeffreyGee says: Jan 22, 2008. 3:42 PM
In one of your mouseover image descriptions, you say "usb adaptors may not work correctly". Could you please clarify on that a little more? Have you/anyone tried using the DS9490R USB adaptor instead of the DS9097#?
xorshift (author) says: Jan 28, 2008. 5:37 PM
It's has been a little while since I built the exe for this, I believe the problem was getting the command line executable working, but this may have just been my personal problem, the usb interface is supported by many other apps, check out
owfs for easy support through Linux, at least that is the direction I'm headed..
Gooserider says: Feb 27, 2007. 5:25 PM
looks real useful, but my app involves a slightly different temp range. I want to monitor flue temperatures on a wood stove, that can get to slightly over 1,000*F.... Is there a substitute part that would give the temp range of a "Type K" thermocouple? (~1250*C or 2250*F max temps, don't need to go under room temp)
tr0g says: Jul 15, 2007. 1:24 PM
Gooserider,

What you want is a MAXIM MAX6675. It takes the input directly from a Type-K thermocouple and puts out an SPI 12-bit readout up to 1024 degrees c. Sparkfun sells them. It complicates things a bit, as you need the TC and the max chip. But it's better than trying to screw around with the temp tables, etc, to get the conversion from the raw TC voltage.
xorshift (author) says: May 3, 2007. 4:12 PM
I couldn't find sensors that support nearly that range, but if you found a thermocouple that changed a voltage per temp. , you could use a 1wire analog/digital converter, read in the voltage and then calculate/graph the temperature
Toxicboy says: May 3, 2007. 11:54 AM
Great post and I followed most of it to the point where I read in your mrtg.cfg: ### TEMP 1 wire #Target[TEMP0]: `g:\webroot\wwwroot\dynamic\rsH_1wiretemp.exe "COM1" 6A0008010FCEFF10,9F0008010FAB7B10,TEMP0` Target[TEMP0]: `perl g:\webroot\wwwroot\dynamic\rsh_call1wiretemp.pl "COM1" Outside,Attic,TEMP0` What does the rsh_call1wiretemp.pl look like and why did u comment out rsh_call1wiretemp.exe. Why are you using the perl script. COuld be my lack of Perl knowledge here, but I am really curious to implement this how you did. Thanks for the work.
xorshift (author) says: May 3, 2007. 4:09 PM
Sorry, you can ignore the perl script, it was just a frontend to the exe so I could reference sensors by their name, not their serial number, I can post it as well, but the exe is all you really need, it does the serial work to talk to the sensor and format it in the correct mrtg format I will edit and repost the mrtg cfg file
fjace says: Feb 22, 2007. 8:27 PM
Do these sensors work in liquids? I need to monitor the temperature of a bunch of fish tanks. Great instructable.
xorshift (author) says: Feb 23, 2007. 9:25 AM
you'd want to seal them, I've seen some use epoxy filled straws, and others with silicone, for an aquarium I'd choose the latter, and rinse well...
Professor Hognutz says: Feb 22, 2007. 9:55 PM
Is there anything MRTG won't do?
jarv34 says: Feb 21, 2007. 9:39 AM
very cool, i've been wanting to do something similar in my house. It would be neat to try to make this work wirelessly so you could have multiple sensors around the house (maybe cheap wireless tx/rx from sparkfun?) or have it communicate over the power lines like an x10 device. I did a quick a look for one and didn't find anything similar. Great job!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!