A one wire temperature device - Page 1
Forum section: electronics / projects

author: Qmavam
author_rank: Regular Contributor
timestamp: April 16, 2021, 10:31:13 pm
content: Hi all, I bought this digital thermometer,https://www.amazon.com/dp/B01MSOI9Y4?psc=1&ref=ppx_pop_dt_b_product_detailsIt uses the DS18B20, which is supposed to have a specific digital address. I want to set it up to be switchable between 5 or 6 different DS18B20 devices, shown here.https://www.amazon.com/gp/product/B00M1PM55K/ref=ppx_yo_dt_b_asin_title_o08_s02?ie=UTF8&psc=1What I need to know is, "Do they program each unit to work with the DS18B20 that is wired to each unit or is it programmed to just work with whatever DS18B20 that is plugged in?"DS18B20 pdf (over my head)https://datasheets.maximintegrated.com/en/ds/DS18B20.pdfThanks for your help, Qmavam

author: tszaboo
author_rank: Super Contributor
timestamp: April 16, 2021, 10:36:10 pm
content: I would be super surprised if they would do anything than burning the same code to all the microcontrollers in those displays. Image the overhead work in the production setting that up, and there is 0 benefit for doing so.

author: Qmavam
author_rank: Regular Contributor
timestamp: April 16, 2021, 11:02:43 pm
content: Quote from: tszaboo on April 16, 2021, 10:36:10 pmThat would seem logical, but I think every DS18B20 is manufactured with a different address.I did find something that may pertain in Example Two on page 18, when "only one DS18B20 is connected".https://datasheets.maximintegrated.com/en/ds/DS18B20.pdfI read it as, Master sends out reset pulse, Master only gets one presence pulse back and then, because only one pulse, Master skips ROM command and then Writes to scratchpad.So, I think it sends reset and go through several operations, reads scratchpad and displays temp. Then reset again and start over. I think I can just switch in a different DS18B20 and it will run through its sequence and read that one.I'll try that. If anyone has other ideas then what I have please inform me, I know I don't have a good understanding.Thanks, Qmavam

author: DrG
author_rank: Super Contributor
timestamp: April 16, 2021, 11:09:43 pm
content: Quote from: Qmavam on April 16, 2021, 10:31:13 pmIt has been a while since I have worked with them and I should probably go look at some code first, but.....They don't have a "specific digital address" per se, they have a unique ID which you can read. You do not have to make use of it, however, to read the temperature. So, if you only have one sensor, there is no reason to mess with the ID...and I would guess that is what they are doing with the product that you bought.So, no easy way to switch between device except by using hardware (not sure how smoothly that would go and I never tried it), if you wanted to stay with that device. If you write your own software, or use an existing software library, you could put together your own system fairly easy - see the billions of Arduino examples out there

author: Qmavam
author_rank: Regular Contributor
timestamp: April 16, 2021, 11:34:31 pm
content: It has been a while since I have worked with them and I should probably go look at some code first, but.....They don't have a "specific digital address" per se, they have a unique ID which you can read. You do not have to make use of it, however, to read the temperature. So, if you only have one sensor, there is no reason to mess with the ID...and I would guess that is what they are doing with the product that you bought.So, no easy way to switch between device except by using hardware (not sure how smoothly that would go and I never tried it), if you wanted to stay with that device. If you write your own software, or use an existing software library, you could put together your own system fairly easy - see the billions of Arduino examples out thereYes, I did have a system I put together that monitored 12 chest freezers, it worked great. I will say the wiring part was easy for me but the computer program install and setup was tedious for me. I liked the program I used because It had a large display and would change from white numbers to red at any preset temp as a warning. But it was not easy for me to setup. Every morning when I hit the computer mouse, I could see if any freezer was malfunctioning, before any damage was done.I just wanted a simple instrument to monitor the temperature stratification of the air in my sauna. If I could just mount a 6 position switch and switch between sensors, that are mounted at different heights in the sauna that would be great.Hmm, while looking for something else the other day I ran across a package of LM35s.

author: DrG
author_rank: Super Contributor
timestamp: April 16, 2021, 11:41:48 pm
content: Quote from: Qmavam on April 16, 2021, 11:34:31 pmQuoteQuoteYes a 3 pole, multi-position switch might work, BUT. You will probably need to power the unit off, turn the switch and power back up. That way, the unit initializes the sensor (sets the precision, which may not be at the default), AND you will only see one sensor at a time. Of course, you need to test all that out and the first thing would be to change the sensor, just to make sure (I am 99% certain that they are not relying on the ID, but who knows?).With some of the libraries for the Arduino, you might find it easier than you think AND you could get a display that shows all 5 values all the time and could alert and so on.

author: Qmavam
author_rank: Regular Contributor
timestamp: April 17, 2021, 12:43:45 am
content: I've never used an Arduino and this is just a one of, probably one test and done. If I can just wire a switch and take the measurements that would be great.

author: Qmavam
author_rank: Regular Contributor
timestamp: April 18, 2021, 04:44:58 pm
content: OP here. I hooked up 5 DS18B20 temp sensors to the Digital thermometer listed in the op. Switching the data lines with a switch, it works just fine. The 5 sensors vary from 77.2*F to 79.7*F. For reference my K type thermocouple reads 77.8*F.Mikek

author: DrG
author_rank: Super Contributor
timestamp: April 18, 2021, 05:03:23 pm
content: Good deal!

author: gnuarm
author_rank: Super Contributor
timestamp: April 18, 2021, 05:56:49 pm
content: Quote from: Qmavam on April 18, 2021, 04:44:58 pmSome time back I dug into the temperature measurement thing since it seemed the inexpensive devices were not so accurate, ±2°C over the range. Turns out it is hard to get accurate temperature measurement without calibration. Even thermocouples require a known temperature reference (called the cold plate) which ultimately limits the temperature accuracy.Often they have a more narrow spec near room temperature.BTW, have I seen you post in sci.electronics.design?

author: MikeK
author_rank: Super Contributor
timestamp: April 18, 2021, 07:23:19 pm
content: Quote from: Qmavam on April 18, 2021, 04:44:58 pmMaxim/Dallas had (has?) a problem with fake DS18B20 sensors. I found that ones I got off eBay were indeed fake and not very accurate. I resorted to buying from a reputable parts vendor. Ways to identify fakes are shown online.

author: DrG
author_rank: Super Contributor
timestamp: April 18, 2021, 08:47:58 pm
content: Quote from: MikeK on April 18, 2021, 07:23:19 pmThe OP seems happy with the results and, for what he is doing and wants, calibration is unlikely to be easily implemented.Nevertheless, your point is valid. We had a thread on fake DS18B20shttps://www.eevblog.com/forum/projects/fake-ds18b20/msg3028660/#msg3028660I tested out some of mine and...the "reputably sourced" ones and one of the 'cheap' ones were likely genuine, according to the checking code. Other cheapos came up as likely counterfeit.

author: Qmavam
author_rank: Regular Contributor
timestamp: April 20, 2021, 01:41:59 pm
content: I was disappointed in the accuracy/consistency, but one degree is not important for what I'm doing, at least for this measurement experiment. I still have a dozen Maxim DS18B20s (probably close to 13 years old) from my 12 freezer monitor project. I bought the Amazon units because I like the design, never thinking they may not be maxim parts and not be as accurate. Oh well!As a side note, when you switch from sensor to sensor it displays the old reading for about a one second, then displays the new reading. Looks like the reset pulse is about once a second.Mikek AKA Qmavam Not to be confused with MikeK