DS18B20 error "-0.06"

I mounted 9 sensors with temperature readings on a LCD screen and on Google Spreadsheet via IFTTT every three minutes.
8 sensors are wired over 25 m via existant wires. (Unfortunately, I can’t change them for UTP cable)
The last sensor is approx 1 m from the Photon.

The system works but I receive a lot of “-0.06” temperature results. Approx. 65 false readings a day.

My program has CRC check for either ROM readings and for data readings : so i suppose the -0.06 error is really given by the DS18B20 itself.

I changed the pull-up resistor from 4.7 to 2.2 k, and other values but neither of this tests were solving the problem.

I noticed that a large part of the false readings are coming from the sensoir with the shortest wire.

Can somebody tell me what the signification is of that -0.06 reading ?
And how to avoid those false readings ?
THX on beforehand.

25 meter, thats a long cable! Is it at least twisted pair and shielded? Do you have a scope to check the signal quality (shape) at either end of the cable?

I suspect your bad codes come from too much (cable) capacitance and perhaps environmental noise. Things you can look into:

  1. Drive the sensors with the slowest permittable timing.
  2. Pull up resister at both sides
  3. Make sure you have a star point grounding

Use a scope to check signal quality it will tell you if you drive the line too fast etc.


I agree with @joost. However, good data quality logic is ALWAYS important. You should be able to filter extraneous or known-bad data. You can also use Kalman filtering to clean your data. :wink:

1 Like

My wire is a simple lightning-wire. As said it’s impossible to replace because this wires go through walls and ceilings.

I don’t have an oscilloscope to verify.

How can I modify the speed ?

Trying to filter the bad data with my programs causes that program to block…

I tried to exclude all values < 0, but after a while the program blocks.


@chip, without seeing your code it is hard to imagine why your code would block.

Hard to fix stuff like this without a scope imho, borrow one if you can. Instead of going 2K2 on the pull up, try a 10K at both sides and verify you’ve got a good star ground.

On the communication speed; I took a quick stroll through the OneWire library (I assume you are using) and noticed that all the timing is hard coded (why people why do you do this?) - so you would have to go in a fudze with those values. Without a clear indication where the signal quality goes of the cliff, I would leave that exercise for a rainy day.

I think the “-0,06” error is not a temperaturefigure but an errorcode of the Ds18B20 itself.
Does somebody know what the meaning of the DS18B20 “-0.06” errorcode could be ?
Thx for your help !

I found out the “-0.06” value I get is the conversion of the HEX-value (18 times F)
FFFFFFFFFFFFFFFFFF : see the picture in attachment. All other conversions give realistic temperatures.

Does somebody knows why I get this error from the DS18B20 ?

THX in advance.

If you are getting all F’s, you are reading the pull-up resistor, not the DS18B20, I think. Are you sure the CRC is correct? Lots of libraries read the CRC but you have to turn on the part where you check the CRC.

Some people have had better luck using a 2.2k or 1k pull-up to +5V but you need to use a 5V tolerant pin.

There is a Dallas (now Maxim) document that talks about one-wire on long wires and your wires definitely long! They recommend using an active pull-down element (MOSFET) with slew-rate control. This limits the ringing in the long wires and makes the network more reliable. They also show a slew-rate limiting RC filter that you could try.


You might have a much easier time figuring out how to make this work if you could borrow and oscilloscope.

1 Like

THX for your help !
It happens, extremely seldom, that I get the message : bad CRC. So I think the CRC control is working correct.
I already tested 2.2 and 1k resistors, but the results are worse. With a 10 k resistor I get no results at all.

I will read the documents you are speaking about.

For the MOSFED and scope suggestion : my electronic knowledge isn’t that high, so this is chinese for me.
(to be honest : I have an oscilloscope Fluke 99, but I don’t know how to use it, and if I could use it, I’m not capable to interpret the results…)

Again, thx for your help ! I surely will read the gven documentation.