ajsraceway
Posts: 1
Joined: Wed Mar 26, 2014 3:52 pm

DS18B20 Precision Changed

Wed Mar 26, 2014 4:14 pm

I've been logging temperatures from a couple of DS18B20s. Originally, I was getting full 12-bit precision in the readings, but recently, the precision has dropped to 9-bit.

For example, when I cat my w1_slave, my output now looks like this:

Code: Select all

28 01 42 0b 1f ff 08 10 4f : crc=4f YES
28 01 42 0b 1f ff 08 10 4f t=18500
The temperature is always multiples of 500, when it used to have significant digits all the way to the end. Also, according to the DS18B20 datasheet, the 4th register (5th field in the output above) is 1f, which corresponds to 9-bit. 7f would be 12-bit.

I realize that 9-bit still gives 0.5 C resolution, but it makes my temperature log plots look a bit too granular. Does anyone have any idea how I changed the precision and how to change it back?

So far, I've tried rebooting as well as issuing:

Code: Select all

sudo modprobe -r w1-gpio
sudo modprobe -r w1-therm
but nothing has helped. Could it be a wiring issue?

Some context:
  • Running Raspbian Wheezy
  • One DS18B20 mounted directly on breadboard with 4.7k pull-up resistor on the data line. Another DS18B20 in series, but on a short CAT5 cable. Both are returning the 9-bit reading.
EDIT:
Solved my own problem. Looked over the wiring and found a short between ground and 3.3V after the first and before the second temperature sensor. Don't know why that setup even worked, let alone resulted in reduced precision being reported. Precision is back to normal now.

Return to “Troubleshooting”