Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:44 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : DS18B20 keeps returning 1045 degrees?

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9753
Posted: 08:37am 20 Oct 2018
Copy link to clipboard 
Print this post

Hi there.

This is odd. I have two 18B20 sensors(the TO92 ones), on 100mm leads, and one returns the correct temp, the other one alternates between the correct temp and 1045 degrees.





I have four sensors on the board, and two are not connected. I am using parasitic power. I have tried other sensors but get the same result. I am providing the 4k7 pull-up via a 4-way SIL resistor. 'BEES' sensor is on pin-17, and 'PLATE' sensor is on pin-18.

28-Pin MM, Firmware 5.04.08

The rogue result of 1045 is the same if I switch sensors, or change them for totally different ones.

Does anyone have any ideas as to what I might have done wrong? Perhaps I should power them directly do you think? (not via parasitic power)
Smoke makes things work. When the smoke gets out, it stops!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3467
Posted: 11:48am 20 Oct 2018
Copy link to clipboard 
Print this post

I see you have a correct (reasonable) reading of Plate at some points--21. 1045 in binary is 10000010101. If you strip off that high bit, you have &B10101, which is 21.

I don't know what this is telling us, but probably something.

I have lots of DS18B20s and have never seen a reading like this, but I've also never used parasitic powering.
Edited by lizby 2018-10-21
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9753
Posted: 10:51pm 20 Oct 2018
Copy link to clipboard 
Print this post

Yes, I get correct readings at some points, but totally wrong ones at other times.
I've just checked the last PCB version that only had two sensors, and they were running on parasitic power, and they worked just fine. Same firmware, same 28-pin chip, and the two sensors I am playing with now are on the same pins as the previous version - I am just not connecting to the other two sensors at this time. I make no reference to the other two sensors in the code just yet, I am just trying to replicate what WAS working fine. Unless the 4k7 SIL resistor can somehow be responsible for this....

It is reasonably easy to hack the PCB and connect the sensors direct to the 3v3 supply rather then running them on parasitic power, but it worked last time, so I really did not think this would happen, and is a bit of a curve-ball!

I will hack the PCB for the two sensors I am trying to use, so they are powered directly from 3v3 and see if the temperatures come in correctly.
Smoke makes things work. When the smoke gets out, it stops!
 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 05:35am 21 Oct 2018
Copy link to clipboard 
Print this post

You did do an ohms check on the 4.7K resistor ? Not clear to me if you did.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9753
Posted: 05:42am 21 Oct 2018
Copy link to clipboard 
Print this post

Yes, I certainly did - before I installed it, to make sure it was a bussed 4k7 - and it was.

I hope to try the hack out soon and see if they work better on standard 3v3 power instead of parasitic power.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9753
Posted: 06:09am 21 Oct 2018
Copy link to clipboard 
Print this post

OK, with a seperate 3v3 supply to the sensors, everything works as expected.
I still have the 4k7 SIL pullup on the data lines, but now they have their own 3v3 supply, the temperatures are reporting correctly.

Perhaps best to always use standard power and not parasitic.
Smoke makes things work. When the smoke gets out, it stops!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3467
Posted: 11:47am 21 Oct 2018
Copy link to clipboard 
Print this post

One possibility is that the combination of parasitic power, 3.3V, and 4K7 pullups is marginal. The Maxim datasheet shows a MOSFET supplying additional power when in parasitic mode, bottom of page 7:

https://cdn.sparkfun.com/assets/4/a/8/8/8/DS18B20.pdf .

That would seem to counter the simplicity of the parasitic powering.

Edited by lizby 2018-10-22
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9753
Posted: 12:02am 22 Oct 2018
Copy link to clipboard 
Print this post

Yes, indeed. From this point forward, I will use conventional power for these devices. What threw me, was it worked in the first version just fine, so I figured....

  DS18B20 PDF, page 5 said  In parasite power mode, the 1-Wire bus and CPP can provide sufficient current to the DS18B20 for most operations as long as the specified timing and voltage requirements are met (see the DC Electrical Characteristics and AC Electrical Characteristics). However, when the DS18B20 is performing temperature conversions or copying data from the scratchpad memory to EEPROM, the operating current can be as high as 1.5mA. This current can cause an unacceptable voltage drop across the weak 1-Wire pullup resistor and is more current than can be supplied by CPP. To assure that the DS18B20 has sufficient supply current, it is necessary to provide a strong pullup on the 1-Wire bus whenever temperature conversions are taking place or data is being copied from the scratchpad to EEPROM. This can be accomplished by using a MOSFET to pull the bus directly to the rail as shown in Figure 4. The 1-Wire bus must be switched to the strong pullup within 10µs (max) after a Convert T [44h] or Copy Scratchpad [48h] command is issued, and the bus must be held high by the pullup for the duration of the conversion (tCONV) or data transfer (tWR = 10ms). No other activity can take place on the 1-Wire bus while the pullup is enabled.

The DS18B20 can also be powered by the conventional method of connecting an external power supply to the VDD pin, as shown in Figure 5. The advantage of this method is that the MOSFET pullup is not required, and the 1-Wire bus is free to carry other traffic during the temperature conversion time. The use of parasite power is not recommended for temperatures above +100°C since the DS18B20 may not be able to sustain communications due to the higher leakage currents that can exist at these temperatures. For applications in which such temperatures are likely, it is strongly recommended that the DS18B20 be powered by an external power supply.


Very interesting. So it would seem that although parasitic power is possible, it is probably not to be recommended, as when the device does the conversion, parasitic power can be marginal. You learn something new every day.

Edited by Grogster 2018-10-23
Smoke makes things work. When the smoke gets out, it stops!
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1106
Posted: 03:46am 22 Oct 2018
Copy link to clipboard 
Print this post

Rightly or wrongly, I have DS18B20s operating for a number of years now with 1k8 parasitic resistors for long runs with no apparent problems.

Started higher & dropped the values until they worked. I think I have even been down to 1k5 on a 3V3 supply.

The only thing that I was really worried about was the self heating of the device with the higher current through them. I haven't noticed a problem in that area.

May be interesting to compare one of my long 2 wire connections with a 3 wire connection one day. I might even read the stuff on the link above


ChopperP
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025