I am having a DS18B20 temperature sensor in a 3-wire setup (using a pullup resistor of 4.7 kOhm from data to 3.3v) on a Raspberry Pi model B+. It always return the value as shown below when using cat w1_slave
to get the data:
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000
It is not the problem of a particular DS18B20 as I have replaced it with another one and get the same result.
I also tried to unplug the three jumper wires from the Raspberry Pi header and connect into an Arduino without touching any circuit or connections on the breadboard, the same circuit works perfectly on my Arduino Pro Mini (3.3v). So it is not the problem in circuitry.
I also tried it on two different Raspberry Pi and get the same result.
The /boot/config.txt
is enabled with the setting of dtoverlay=w1-gpio
and gpiopin4 is used as default for input (in fact I tried different gpio pin configurations, but the results are the same).
Any one has the similar experience? Am I missing something?
Update
Here is the photo of my breadboard wiring:
As per @joan's comment, I also decided to solder the DS12B18 and the pull up resistor direct to the back of Raspberry Pi header connector to make sure verify that the problem is not due to pure join to connectivity (see the picture), but I get the same result.