Jump to content
  • 0

Help wanted changing resolution of DS18B20 on Orange Pi



Hello, I have got my Orange Pi PC+ reading a DS18B20, but it only gives 0.5 degree increments so I believe the resolution is set to 9 bit. This is nowhere near good enough for the application I plan to use it for.


When I cat w1_slave I get:

90 01 80 01 1f ff 02 04 5c : crc=5c YES

90 01 80 01 1f ff 02 04 5c t=25000


I have attempted to use this: https://github.com/danjperron/BitBangingDS18B20

but it appears to be specifically for RaspPi.


Does anyone know how I can change the resolution to 11 or 12 bit?


Many thanks

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

There is a thread where someone tweak the kernel to get this functionality :


But it seem that he never completed the task to provide actual patch for Armbian build.


Looking at kernel history, I saw that someone else done it a different way :


It should be done like :

echo 12 > /sys/bus/w1/devices/28-000005a2fac5/w1_slave

But comments say that this change is volatile and will be reset at next power recycle :

Writing a value between 9 and 12 to the sysfs w1_slave file will change the precision of the sensor for the next readings. This value is in (volatile) SRAM, so it is reset when the sensor gets power-cycled. To store the current precision configuration into EEPROM, the value 0 has to be written to the sysfs w1_slave file. Since the EEPROM has a limited amount of writes (>50k), this command should be used wisely.
Link to comment
Share on other sites

When discussing a problem make sure to provide full logs!

  • 0

rc14_one:/sys/bus/w1/devices/28-0115832712ff/driver# echo 12 > 28-0115831d2eff/w1_slave
-bash: 28-0115831d2eff/w1_slave: Permission denied


setting manual write permission to w1_slave


rc14_one:/sys/bus/w1/devices/28-0115832712ff/driver/28-0315826d08ff# echo 12 > w1_slave
-bash: echo: write error: Input/output error


I was using latest armbian debian jessie.

How can I implement that to it?

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...