Go Down

Topic: DS18B20 - occassional zero temp readings (Read 1 time) previous topic - next topic

dominator99

I run a Uno with 5 DS18B20 digital temp sensors in my central heating sketch.
The sketch can run for hours or days with no problems but occassionally all 5 temp readings go to zero.
Resetting Uno with reset button makes no difference; removing all power from Uno to reset it is the only solution to this problem.

Any ideas, anyone??

thanks

Dr_Ugi

I can't help you with the sensors themselves, but I have been having trouble with a DHT22 temperature and humidity sensor which works for hours and then refuses to read.

My solution was to drive the sensor with power from a digital pin and if I sensed several void readings in a row then I just cut power to the sensor for 5 seconds, restored it for 5 and then carried on.  Side-steps the issues quite effectively!

Don't know how much power your sensors take or whether you can power them easily from your Ardu' but if the wiring is there then a transistor on a digital pin (via a resistor) should allow you to power them all off a single control pin.

MarkT

Unless I've some real information all I can say is "you have a bug".  Circuit?  Code?
[ I won't respond to messages, use the forum please ]

dominator99

Hi MarkT

I can't see the problem being circuitry or code as most of the time it runs without problem.

I get the usual, occassional dodgy temp readings from some the DS18B20 sensors (-127C & 85C) but these I get around with coding.

This problem sets all 5 readings from the sensors at 0C!!

As mentioned in the original post, resetting the Arduino Uno via the reset button doesn't solve the problem, only a complete power down works - very strange.

I'm thinking maybe a transient mains spike putting an excess voltage onto the Uno board from the psu which, in turn, spikes the DS18B20 sensors & since a reset,using the reset button, doesn't remove voltage from Uno board or the DS18B20 sensors, that's why a soft reset doesn't work.

I'll try another psu & let you know the outcome.

PS  by the way, I live close to an electricity sub station & my mains incoming voltage is 251V-258V!! (should be 253V max under regs - 230V +- 10%)

tkbyd

You "shouldn't" need it, but the following might help...

Have your system pull the data line reading the DS1820s low for two seconds every once in a while. That should reset them.

Also: Don't use parasitic power.

Do use the checksum returned with the temperature readings.

I wonder if there is something in your circuit which slowly charges up a capacitance somewhere, and that is interfering.

MarkT


Hi MarkT

I can't see the problem being circuitry or code as most of the time it runs without problem.

I can...  But without more information I'm unable to help - you are asking for help.  I've a network of 11 DS18B20s that have run for months without a single bad reading, BTW.
Quote


I get the usual, occassional dodgy temp readings from some the DS18B20 sensors (-127C & 85C) but these I get around with coding.

This problem sets all 5 readings from the sensors at 0C!!

As mentioned in the original post, resetting the Arduino Uno via the reset button doesn't solve the problem, only a complete power down works - very strange.

The effect of a reset and a power down on the state of the microcontroller's RAM isn't identical.
Quote


I'm thinking maybe a transient mains spike putting an excess voltage onto the Uno board from the psu which, in turn, spikes the DS18B20 sensors & since a reset,using the reset button, doesn't remove voltage from Uno board or the DS18B20 sensors, that's why a soft reset doesn't work.

I'll try another psu & let you know the outcome.

PS  by the way, I live close to an electricity sub station & my mains incoming voltage is 251V-258V!! (should be 253V max under regs - 230V +- 10%)
[ I won't respond to messages, use the forum please ]

brian_huebner

I am experiencing this same problem in my sketch right now.  Did you ever find the culprit and solution?   I have checked my circuitry alone with a simple sketch and it works fine, but when I incorporate it into a sketch with multiple other sensors and a pachube link, I get the occasional zero temp reading.  Which leads me to believe its in the programming.  I have tried the pin mode low for 2 seconds and that did not fix the problem.  please help.  Thanks.

Kariky

I had same problem occasionally too, i suppose that was because of long wires to sensors. Problem was solved by adding a 2k2 resistor between signal and ground (if remembered correct. Resistor still exists in bread board, no more wires connected)  :smiley-roll:
My software has no bugs, only random features.

Go Up