Ds18b20 - ds18b20 reading -127

I fund an old topic about the ds18b20 reading -127 (now closed!) but i wanted to add that the problem was not addressed properly hence no solution was found to that topic:
solution : I experimented with the Dallas temperature sensor and to get the sensor to read (and display) the correct temperature need to connect a 4.7k resistor between the + and data pin of the sensor. (no library problems were found! )

The pull-up is a necessary part of the connection because of open-drain nature of the transceiver section of the DS18B20 sensor.

dsscrP

Hi.
I don't know what this topic says you quoted, but
DS18B20 can also work in " PARASITE POWER" mode, using only 2 wires. GND and DQ.
See at:

topic : PARASITE POWER.

It can't be too difficult to address, and the solution is well-known:
-127 means no, or improper, connection.
Check your wiring.
End of story.

However, per figure 6 on p.7, a hard pullup and MOSFET are required for proper operation.

I believe THIS is the topic sparkone is referring to. A hard pullup was suggested but no followup from the OP. Don't you hate it when that happens?

1 Like

You mean something like Fig-1; where, K1 is to be replaced by a MOSFET?


Figure-1:

Correct

No great surprise. It often happens when the bleeding obvious is posted by somebody who knows what they are doing - resulting in embarassing silence. All Photoncatcher did was wire up the sensor the way God and Dallas intended. No mention of MOSFET and no parasite power either.

the old topic ! had blamed the library but it was not the case ; connecting as pictured showed correct readings rather than -127....sometimes wrong connections by mistake bring up errors hence pictured for reference. ( & quite often than not its not always about dificulty of atask rather getting the basics right! ) Hope it helps someone! ta

Your graphic shows wrong polarity, if looking at the TO92 package flat side with leads at bottom, Vcc (+) is on right, GND (-) is on left.
DS18B20_pinout

The posted connection of DS18B20 seems to be wrong when compared with the following taken from data sheets:

Then please, repost your above diagram showing pin numbers and inscribing DS18B20 on the flat side of the chip.


Changed! thanks

Here it is:

thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.