3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

$30 Historical Temperature Sensor System using PC,1-wire, Perl, MRTG

$30 Historical Temperature Sensor System using PC,1-wire, Perl, MRTG
«
  • tempprobesceen2.PNG
  • tempprobesceen3.PNG
  • temp2008.bmp
  • 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 1Get 1-wire up and talking

Get 1-wire up and talking
«
  • PICT4134.JPG
  • rj45cab.jpg
  • PICT4133.JPG
  • 1wire_viewer.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.
« Previous StepDownload PDFView All StepsNext Step »
16 comments
Feb 21, 2007. 10:47 AMtradergordo says:
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
Nov 17, 2010. 8:18 AMSneak85 says:
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.
Apr 29, 2009. 10:26 AMDerin says:
You could also wire it up to the A/C and set it to try to keep the temperature constant.
Mar 7, 2008. 4:34 AMketas says:
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 :)
Jan 22, 2008. 3:42 PMMrJeffreyGee says:
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#?
Feb 27, 2007. 5:25 PMGooserider says:
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)
Jul 15, 2007. 1:24 PMtr0g says:
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.
May 3, 2007. 11:54 AMToxicboy says:
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.
Feb 22, 2007. 8:27 PMfjace says:
Do these sensors work in liquids? I need to monitor the temperature of a bunch of fish tanks. Great instructable.
Feb 22, 2007. 9:55 PMProfessor Hognutz says:
Is there anything MRTG won't do?
Feb 21, 2007. 9:39 AMjarv34 says:
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

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
1
Author:xorshift