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.

Temperature sensor / weatherstation

Temperature sensor / weatherstation
Create a weatherstation or temperature monitor using the very cool digital temperature sensor DS1820.

I use this setup to monitor a server room, and as a weatherstation.

This project consists of:

  • A Dallas 1-Wire bus network
  • Interface between RS-232 and the Dallas 1-Wire system
  • Digital temperature sensors connected to the Dallas 1-Wire bus (DS1820/DS18s20)
  • Software setup to gather and graph temperatures

Updated 2007-11-18 to include automatic graphing scripts and pictures of real life implementations of this system.
 
Remove these adsRemove these ads by Signing Up
 

Step 1You need

You need
«
  • IMG_1046.jpg
  • IMG_1105.jpg
This is what you need to make a weather station or temperature logger:

  • Some linux skills
  • Basic electronics skills, soldering etc..

Components
  • 1 6.2V Zener diode (1N5234)
  • 1 3.9V Zener diode (1N5228)
  • 2 Schottky diodes (1N5818)
  • 1 1.5 k resistor
  • 1 2pin screw terminal
  • 1 D-sub 9 female connector with solder points
  • 1 small piece of perfboard.
  • One or more Dallas Semiconductor DS1820 or DS18s20 digital temperature sensor
  • Cat5 cabling
  • Shrink tube
« Previous StepDownload PDFView All StepsNext Step »
82 comments
1-40 of 82next »
Dec 12, 2011. 8:29 AMgadragon says:
Can i use 1N5819 instead of 1N5818?
Nov 4, 2011. 8:32 AMhumall says:
I have little experience with soldering so I made a breadboard version of the circuit, see pdf file I added, I used Ubuntu for Digitemp and everything works fine, rrd-tool and web server setup. Tried to use Windows version of Digitemp, did not work. Thanks for making this instructable, it showed me how to use 1-wire bus.
Sep 23, 2011. 12:14 PMgaracs says:
This is EXACTLY what I am looking for, but unfortunately it uses DALLAS DS1820 sensors, I do not have handy at the moment.

Would this also work with a LM35DZ? If so, what would be the differences in the scheme?

BTW, great instructable.
Apr 17, 2011. 6:13 AMandy70707 says:
Will this interface work with other 1-wire devices such as iButtons? And can it do bi-directional serial (read+write) or just simply reading from the device?
Mar 16, 2011. 11:13 PMWavy says:
Great Instructable! Using a breadboard, everything worked out smoothly. I also used the MartyBugs' schematic to confirm the setup. Very nice and fun, thanks!
Aug 28, 2009. 8:19 PMtitan44 says:
Is it possible to make this work with a db25 instead of a db9?
Jan 27, 2011. 10:35 AMBrafferton says:
Db25:
Pin 2 Transmit
Pin 3 Receive
Pin 7 Ground
Pin 20 DTR (if using non-parasitic)
Nov 18, 2009. 9:53 AMmattccc says:
(removed by author or community request)
Jan 27, 2011. 10:28 AMBrafferton says:
Short answer is, you don't.
The 18S20 is a 1 wire serial device
Your printer port will only talk to parallel devices.
May 8, 2009. 9:09 PMthermoelectric says:
I tried this on Linux (Ubuntu) and when I typed this into the terminal "digitemp -s /dev/ttyS0 -i" i get this

"DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU Public License v2.0 - http://www.digitemp.com
Turning off all DS2409 Couplers

Searching the 1-Wire LAN"

Problem is it doesn't show any sensors....
Jan 27, 2011. 10:27 AMBrafferton says:
It's not physically working. Check all the components are correctly polarised (My goof was wiring the D"18S20 back to front)
Jul 6, 2009. 1:47 PMdarkcape says:
Loving this I have wanted to do this ever since reading about it in the linux toys book. on question I have though what is the maximum number of sensors that the 1 wire network can handle?
Jan 27, 2011. 10:25 AMBrafferton says:
Depends on whether it's in parasitic mode or non parasitic. From the number of components used, I'd say it in parasitic mode. Therefore, no more than 3.
In non-parasitic mode (2 more components required) 10 or 12 would be quite happy. With a separate 5 volt PSU, several thousand.
Sep 5, 2010. 3:29 AMwareneutron says:
you have to work in weather forcast
Apr 10, 2010. 5:21 PMeng_islam_h says:
thats really great,i've done it and it works really fine with the 1 wire driver from maxim, now i'm trying to read the data in LabView and i'm really close
great job
thanks 
Jun 23, 2009. 9:38 PMsalimi says:
hi please write vb code for monitoring graph
May 22, 2009. 9:36 PMthermoelectric says:
I don't know if I have done it right, but when I try to run the logdata script manually I get a error. What do you suggest? beau@beau-desktop:~$ php /etc/tempsensor/graphdata.php ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory ERROR: opening '/var/log/digitemp_rrd/0.rrd': No such file or directory Warning: fopen(/var/www/temperature/index.html): failed to open stream: Permission denied in /etc/tempsensor/graphdata.php on line 75 Warning: fwrite(): supplied argument is not a valid stream resource in /etc/tempsensor/graphdata.php on line 76 Warning: fclose(): supplied argument is not a valid stream resource in /etc/tempsensor/graphdata.php on line 77 Warning: fopen(/var/www/temperature/index_0.html): failed to open stream: Permission denied in /etc/tempsensor/graphdata.php on line 102 Warning: fwrite(): supplied argument is not a valid stream resource in /etc/tempsensor/graphdata.php on line 103 Warning: fclose(): supplied argument is not a valid stream resource in /etc/tempsensor/graphdata.php on line 104 Warning: fopen(/var/www/temperature/index_all.html): failed to open stream: Permission denied in /etc/tempsensor/graphdata.php on line 102 Warning: fwrite(): supplied argument is not a valid stream resource in /etc/tempsensor/graphdata.php on line 103 Warning: fclose(): supplied argument is not a valid stream resource in /etc/tempsensor/graphdata.php on line 104
Apr 30, 2009. 10:51 AMbhp0528 says:
I'm a little shy (actually lazy) when it comes to circuit boards and solder. I noticed a similar tutorial was using a http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2982 to interface from serial to RJ-45.

Looking at the documentation it appears this would do the same as your diodes and soldering and give you a RJ-45 to boot. The site appears to spec the device for $21. Any idea how that would compare to soldering diodes in price and functionality?
Apr 30, 2009. 10:58 AMbhp0528 says:
After looking at the site a little longer I found a number of different adapters (USB, Serial, etc). Has anyone tried these?

http://www.maxim-ic.com/products/ibutton/products/adapters.cfm#rs232
Apr 4, 2009. 7:17 AMSolargoat says:
I built it, but having zero electronics experience, and not much software experience, I am not sure if it works. After downloading various programs to read it, including 1-WireViewer, Lampomittari, and I can't seem to get it to recognize my interface. I guess it is a hardware problem in how I constructed it. What can I do to troubleshoot this device with a multimeter? What is the proper voltage that should be coming out of my serial port on my Dell Latitude D620 notebook? I am getting 4.98 Volts now. If someone could get me started, I would be eternally grateful!
Apr 4, 2009. 7:35 AMSolargoat says:
That was a quick reply! I have an iMac and a Gigaware USB-serial converter. I guess I'll try that, but now that will introduce its own issues with software.
Nov 27, 2008. 9:17 PMax89 says:
Very neat! How many sensors can you hook up? (I apologize if this was asked and answered but I didn't see it when I read through.)
Mar 6, 2009. 12:47 AMthermoelectric says:
It will tell you how many sensors can be connected on the datasheet of the 1-wire sensor.
Mar 6, 2009. 12:46 AMthermoelectric says:
Hey, I'm back. I have been able to make it run on Windows but it can't dectect my interface, Is there a way to test what I have wired incorrectly?

BTW to get it to run on windows you need to
  • download the current Windows digitemp
  • find the digitemp.exe file in the digitemp file
  • copy that to WINDOWS/system32
  • Go into command prompt and type "digitemp", That will give you the syntax of the command
Hope I could help anyone that is trying to use it on Windows...
Feb 23, 2009. 12:57 PMthermoelectric says:
Wow, After attempting to make the interface, I can safely say that you are GREAT at using protoboards.

Do you know how I can use this on windows?
I have tried what you said below but it doesn't work, What does the digitemp -aq > c:\path\to\webserver\root\temperature.txt mean?
Feb 24, 2009. 11:05 PMthermoelectric says:
By the way, Why do you reccommend using CAT5 cable over telephone cable?
Feb 25, 2009. 12:57 PMthermoelectric says:
Issues? What was happening with the telephone wire to cause major issues?
Feb 23, 2009. 1:33 PMthermoelectric says:
Oh, Thanks anyway, I might just have to try the alternate install of Ubuntu (128mb RAM)
Feb 25, 2009. 11:43 PMthermoelectric says:
That is a definite thing i'm going to have to do since I can't get it to work in windows....
Mar 6, 2009. 12:46 AMthermoelectric says:
Scratch that :-)
Aug 31, 2008. 2:52 PMBCHurricane89 says:
looks good, nice job. just wondering, because someone asked before, and I have the same question, but it wasnt answered: Can i use a DS18S20+ sensor? the DS1820 is discontinued, and I can get the DS18S20+ free, as a sample. :) plz respond, THANKS!
Feb 23, 2009. 1:09 PMthermoelectric says:
Yes you can use the DS18S20+ (All the + indicates is the lead free status...)
Nov 21, 2007. 1:36 AMgoldust says:
hi chr this tutorial is very Useful. but i want to Setup software for WindowsXP . can you help me? (i know you are Professional)
Aug 25, 2008. 2:22 PMthermoelectric says:
Have u had a go at making it run on windows?
Aug 8, 2008. 5:50 PMthermoelectric says:
Can I use a DS18S20+ (i think the plus indicates the RoHS status)
1-40 of 82next »

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!
652
Followers
7
Author:chr
I like microcontrollers and LEDs :D