Dallas Semiconductor DS18B20 One-Wire 12 bit temperature sensor?

  • Active since 1995, Hearth.com is THE place on the internet for free information and advice about wood stoves, pellet stoves and other energy saving equipment.

    We strive to provide opinions, articles, discussions and history related to Hearth Products and in a more general sense, energy issues.

    We promote the EFFICIENT, RESPONSIBLE, CLEAN and SAFE use of all fuels, whether renewable or fossil.
  • Super Cedar firestarters 30% discount Use code Hearth2024 Click here
Status
Not open for further replies.

pybyr

Minister of Fire
Hearth Supporter
Jun 3, 2008
2,300
Adamant, VT 05640
I should begin this by admitting and being clear that I know my way around analog circuitry much better than digital

also, I am still at the stage of figuring out and getting ready to build the basic functional aspects of my system, and have been thinking of the control/ monitoring parts only as they relate to things I really ought to consider in the design of the basic piping/ pumping/ valving

that said, the point will come when I'll need to turn to planning controls, so have been trying to think some about that, too

I remembered a device that a friend of mine has played around with in connection with PIC processors, and that would seem to have potential superb adaptability for measurement and control for some of the complexities of wood boilers + storage- "Dallas Semiconductor DS18B20 One-Wire 12 bit temperature sensor"
data sheet--
(broken link removed)
they actually appear to be cheaper than thermistor sensors, and the ability to have mulriple sensors on a one-wire-pair system, but to have a microprocessor be able to distinguish among each of them, looks really intriguing.

Some of you around here (nofossil & I am sure others) know a lot more than I do about digital interfaces, processors, etc- what do you folks think of the potential of this device? and for a "relative digital newbie" what might be a good set up to tie into and program to accept & process the inputs and then make decisions on what devices to actuate, and in what sequence? bear in mind that I am not a programmer, and not aiming to have to become one on any sophisticated level

thanks!
 
Those things are awesome. They allow a whole variety of sensors (not just temperature) to be hooked up with much simpler wiring. I would use them myself, but they require an interface that's not available for the computer board that I'm using. If you're willing to use a Windows type PC, this type of sensor is a great approach for hydronic systems.

They do make a USB interface for 1-wire sensors that should work with my computer, but I'd have to write the driver software myself. Not enough hours in the day.

There's a guy in Vermont with an inn that's all wired with 1-wire sensors (every room, etc.) and there are plenty of web sites that discuss how to use them.
 
thanks Nofossil- the guy that I heard of them from is anything but a Windows fan- he uses them with "PICAXE" microcontrollers

(broken link removed to http://wulfden.org/stamps/picaxe.shtml)
 
All right, I followed the link this time. Looks like the guy is in Underhill Center - we should pay him a visit!

The PICAXE is a little closer to pure hardware than I wanted to be, but the price is definitely right. Hope someone picks this up and runs with it.
 
I am looking at monitoring mine so I can see how/when the oil boiler kicks on, monitor temps on the wood boiler and when the circulators run.

This free software has alot of functionality, just need a leftover PC running linux and some time to configure it.

(broken link removed to http://www.klein.com/thermd/)

A one wire controller such as this one can support up to 100 1 wire sensors, all kinds of different types.

http://www.embeddeddatasystems.com/..._Code=HA7Net&Category_Code=HA&Product_Count=0


~ Phil
 
mpilihp said:
I am looking at monitoring mine so I can see how/when the oil boiler kicks on, monitor temps on the wood boiler and when the circulators run.

This free software has alot of functionality, just need a leftover PC running linux and some time to configure it.

(broken link removed to http://www.klein.com/thermd/)

A one wire controller such as this one can support up to 100 1 wire sensors, all kinds of different types.

http://www.embeddeddatasystems.com/..._Code=HA7Net&Category_Code=HA&Product_Count=0


~ Phil

I looked with some lust at the Ethernet 1-wire interface, but it cost more than the computer that I'm using to control my whole system. I'm just too cheap. I think it's probably a really good solution, though. Would help avoid having your system look like this:
 

Attachments

  • [Hearth.com] Dallas Semiconductor DS18B20 One-Wire 12 bit temperature sensor?
    controller-panel.webp
    141.1 KB · Views: 632
THere are other 1-wire controllers that are cheaper but require more techno saavy ability which Im not a programmer so going with this is more at my abilities. I can set up a unix server and configure settings in a confi file.... WHen I get a chance Ill post the other controllers.

~ Phil
 
I am planning to use ds18s20 sensors with my ts7800 sbc to control my system. I can't remember the difference between these and the ds18b20, but I think they are pretty similar. A few months ago I wrote some proof of concept C code to interface with the sensors directly from the ts7800 and the interface works. Since then I have been focused on my piping, chimney, and tank so I have not dealt with the sensors a lot since the initial work. However I did try to interface with one of the sensors on a long run (about 30 feet of wire) and had some stability problems. I was able to fix it for the time being by removing other wires from the bus. One solution in my case would be to put only 1 sensor per IO line on the ts7800, which is not a big deal for me since the ts7800 has dozens of IOs. So I basically have it working but I have some signal integrity issues that I'll work on once my piping is done.
 
nofossil said:
All right, I followed the link this time. Looks like the guy is in Underhill Center - we should pay him a visit!

The PICAXE is a little closer to pure hardware than I wanted to be, but the price is definitely right. Hope someone picks this up and runs with it.

Brian is a friend of mine through the shared avocation of amateur radio- I could probably line up a group visit with him to pick his brain on this stuff
 
nofossil said:
Those things are awesome. They allow a whole variety of sensors (not just temperature) to be hooked up with much simpler wiring. I would use them myself, but they require an interface that's not available for the computer board that I'm using. If you're willing to use a Windows type PC, this type of sensor is a great approach for hydronic systems.

nofossil- any sense of what "caliber" of Windows would work- I can tolerate 98SE and 2000 professional (and have legit, licensed copies of each), but anything after that gives me fits with its bloated slowness and tendency to seize up
 
The other controller I found that was cheaper and works with the Klein software is TEMP08, costs $75. Check out the software website, he lists all the devices the software works with.

(broken link removed to http://midondesign.com/TEMP08/TEMP08.html)

Another option for those less technically saavy is the minigoose by www.itwatchdog.com Its about $200 without any sensors and can support 16. Has its own built in web interface and displays the status of the sensors and 24hrs history... Not alot but much more plug and play. Will work with any 1-wire sensor im told so you dont need to buy their expensive ones.

~ Phil
 
I haven't spent a lot of time researching the 1-wire hardware out there. There seems to be a very inexpensive USB interface (looks like a flash drive) that I believe comes with generic Windows drivers:
(broken link removed to http://www.hobby-boards.com/catalog/product_info.php?products_id=1503)

Worth checking, but I'd expect that Win2k Pro would be fine.

I've looked at code to interface 1-wire directly to a digital i/o line, but it seems CPU intensive and I've got plenty of other stuff for my CPU to be doing. I'd be more than happy to see any examples, though. I'm actually hoping that someone else figures out USB drivers for the TSxxx boards for the USB 1-wire interface board mentioned above.
 
Well, it looks like all the electronics gurus are right here on this thread - so not to hijack it, but...suppose you are using these temp sensors, what would it take to have the temp accessible through the internet? I'd love to be able to hit a web page and see a couple of simple read-outs showing house temp, outdoor temp and stove temp so I can plan ahead for the evening fire.
 
cozy heat said:
Well, it looks like all the electronics gurus are right here on this thread - so not to hijack it, but...suppose you are using these temp sensors, what would it take to have the temp accessible through the internet? I'd love to be able to hit a web page and see a couple of simple read-outs showing house temp, outdoor temp and stove temp so I can plan ahead for the evening fire.

Funny you should ask. In my case, I use the TS7260 which comes with a complete operating system with web server in onboard RAM. I just wrote a little C routine that reads the analog and digital I/O values and returns a simple web page:

(broken link removed)

(Hope this works - this is the 'outside the firewall' link and I can't test it from inside the firewall......)

I've had variants that allow me to set variables, turn loads on and off, and so on. Make sure any such is password protected at least.
 
Wow- nofossil- what is it that's the impediment to using "your" system brains with the one-wire serial temp sensors?

is that impediment anything you'd consider an impediment if you were doing it from scratch?
 
pybyr said:
Wow- nofossil- what is it that's the impediment to using "your" system brains with the one-wire serial temp sensors?

is that impediment anything you'd consider an impediment if you were doing it from scratch?

The issue is that there are no drivers for 'hardware' 1-wire interfaces such as the USB device I mentioned earlier in this thread. I could do it in software, but that ties up the CPU to do the required timing. I need the CPU for other cool stuff like serving the web page.

The Ethernet 1-wire interface that someone mentioned would work with my card, but it's more money than my cheapskate soul can tolerate. I've talked with Techologics (the manufacturer of my computer card) about doing a 1-wire interface card, but it hasn't gotten high enough on their priority list. Maybe some other techie here or elsewhere will do a driver for the USB interface.

EDIT: I poked around. There's been some progress over the last couple of years. There seems to be linux support for the Maxim DS9490 USB 1-wire interface, though it's not necessarily stable or easy to port to my card. I'll order one and add it to my project list.
 
nofossil said:
I could do it in software, but that ties up the CPU to do the required timing. I need the CPU for other cool stuff like serving the web page.

Interfacing the sensor directly with the arm DOES require taking over all of the CPU time for the duration of the query, but it is still pretty quick. Reading one sensor without using the ROM (which necessitates using one one sensor per IO) takes somewhere on the order of 150ms. If there are 6 sensors that you want to read every couple minutes then the impact is about 1 second every two minutes. With these numbers the impact to a web server will be very small. In the off chance that you happen to hit the server during a sensor reading, you would get at most a 1 second delay.
 
I take that back... I haven't looked at the code in awhile.

The biggest part of the sensor read is the delay between sending the command for the sensor to store the temperature and when the temperature is ready to be ready out. I think it was over a half second for this part. The best was to do a group of sensors is to do this step in parallel for all sensors. This can be done using all sensors on a single bus, or possibly even on separate buses. If they are done in parallel, i think the total for all sensors will still come in at around a second or less.
 
free75degrees said:
nofossil said:
I could do it in software, but that ties up the CPU to do the required timing. I need the CPU for other cool stuff like serving the web page.

Interfacing the sensor directly with the arm DOES require taking over all of the CPU time for the duration of the query, but it is still pretty quick. Reading one sensor without using the ROM (which necessitates using one one sensor per IO) takes somewhere on the order of 150ms. If there are 6 sensors that you want to read every couple minutes then the impact is about 1 second every two minutes. With these numbers the impact to a web server will be very small. In the off chance that you happen to hit the server during a sensor reading, you would get at most a 1 second delay.

I read all 16 analog inputs every second. There are some control functions where I want pretty quick response, and I don't want to compromise on speed for at least those values. I also log all inputs and outputs every 30 seconds (to an SQL database), so I'd need to sample all inputs at least that often.

For people who aren't quite as obsessive, every minute would probably be fine. How quickly does outside or storage temperature change, after all?

One other issue - to make the timing work, the temp sensor task would have to disallow preemption by the operating system task switcher. If the task crashed, it would then take the operating system with it.
 
Yeah if you are going to log every second then I can see how using the arm would be a problem. Keeping in mind that the big time hog in the process is the sensors' internal temperature conversions, there might be another solution, albeit a little more complicated... While a lot of the back and forth communication between the sensor and arm need to use very strict timings, once the sensors have been instructed to convert and store the temp, they will hold the temp in their internal registers indefinitely. So one could call a program to tell all of the sensors to convert/store their temps (this would be pretty fast), then sleep for a second or so while the temps are stored by the sensors (other tasks can run during this span), then read the temps (this would also be pretty fast). This way the longest part of the process would not be hogging the arm's resources.
 
If I can ask a dumb question - where can I go (website) where I can learn the basics of using a computer to control things? I know my way around mechanical things, and windows xp, but a couple of years ago all I found was WAY above my head (making circuit boards and such). (I could probably make a cicuit board if I knew the lingo...)
 
maurice said:
If I can ask a dumb question - where can I go (website) where I can learn the basics of using a computer to control things? I know my way around mechanical things, and windows xp, but a couple of years ago all I found was WAY above my head (making circuit boards and such). (I could probably make a cicuit board if I knew the lingo...)

Windows based PCs are not aimed at the electronics DIY person. There are expensive commercial boards with accompanying software that can do marvelous things, but not typically at a reasonable cost point. Non-Windows computers can be a bit intimidating for those who aren't fairly hard-core software jockeys.

There are some great books and websites aimed at amateur robotics. A really good one that gets at the basics is 'Mobile Robots' by Jones and Flynn. Lots of simple schematics and theory. They're assuming that you're building a computer from scratch, but the interface theory is right on.

I just went out and bought a single board computer from Technologics (the TS7260) and started playing. I ended up adding an analog input board and a discrete I/O board to it. I had the advantage that I was already familiar with Linux and C programming, though.
 
nofossil - thanks for the tip on the TS7260. That web set-up you've got looks sharp and exactly what I had in mind. I took a look at some web sites and it looks like the 7260 board runs about $150...which winds up being about $150 over my budget!

I do OK with electronics, computers, networking, etc...but definitely not as versed in it as you. Basically what I was hoping to accomplish was push an old 400mhz computer into service, wire up 2-3 type K thermocouples and have this somehow tie into the internet so I could reference the page remotely. I'll have to do some more searching and see what else is available. If I can't find anything, I can always guesstimate like all the previous years.
 
The challenge with using old PCs is that analog inputs are hard to come by. For the TS7260, an 8 channel 12 bit board is $60. I don't know of any comparable PC hardware. Linux is free and runs fine on older hardware. Comes with a web server, too. Just have to figure out how to get it to read analog signals. There's a chance that the 1-wire USB interface is adequately supported in Linux now. If so, that would be a big step forward in low-cost PC based systems, though I don't know of any 1-wire thermocouples.

I did a project years ago using the PC joystick interface as a two channel analog input. The problem is that it's not a true analog input - it essentially measures resistance by charging a capacitor and then letting it discharge through the connected load. After a certain interval, it reads the cap voltage and infers the external resistance from that.
 
Status
Not open for further replies.