We're no longer updating This wiki!!

This is an old revision of the document!


Dallas 1-Wire Support

  • Support for Dallas 1 Wire is included on Kernel 3.14.29-29 and upwards. Make sure you are updated.
  • Will cover an example of a temperature sensor well known DS1820 other 1 wire IC's are supported too.

Default GPIO for 1-Wire is Pin #7 (GPIOX_21, GPIO113)

  • Connection: With External-Supply

Pin 1 (Left): Ground (-)

Pin 2 (Middle): Pin #7 C2 (GPIOX_21, GPIO113)

Pin 3 (Right): VCC (3.3V)

You also need to add a resistor from 4.7k to 10k between pin 2.

  • Connection: Supplying the Parasite-Powered

Pin 1 (Left): Ground (-)

Pin 2 (Middle): Pin #7 C2 (GPIOX_21, GPIO113)

Pin 3 (Right): Ground (-)

You also need to add a resistor from 4.7k to 10k between pin 2.

  • Load the required kernel modules:
    modprobe w1-gpio && modprobe w1-therm
  • Check if your sensor is working:
    odroid@odroid64:~$ cd /sys/bus/w1/devices/
    odroid@odroid64:/sys/bus/w1/devices# ls
    10-000802f41d67  w1_bus_master1
    odroid@odroid64:/sys/bus/w1/devices#

As you can see my sensor is detected as 10-000802f38c57, each sensor has a different id. So yours will be different.

  • Read the temperature:
odroid@odroid64:/sys/bus/w1/devices$ cd 10-000802f38c57
odroid@odroid64:/sys/bus/w1/devices/10-000802f38c57# cat w1_slave
33 00 4b 46 ff ff 03 10 30 : crc=30 YES
33 00 4b 46 ff ff 03 10 30 t=25562
odroid@odroid64:/sys/bus/w1/devices/10-000802f38c57#

Temperature is t=25562 or 25.562 degree's Celsius.

Multiple sensors can be connected on the same line as the draw below.

odroid@odroid64:/sys/bus/w1/devices# ls
10-000802f38c57  10-000802f41d67  w1_bus_master1

Two sensors in parallel.

Change the Default GPIO pin for 1-Wire interface
Ex) Default GPIO pin change to GPIOX_19(GPIO111)

odroid@odroid64:~$ sudo apt-get install device-tree-compiler
odroid@odroid64:~$ fdtget /media/boot/meson64_odroidc2.dtb /onewire gpios
31 113 0
odroid@odroid64:~$ fdtput /media/boot/meson64_odroidc2.dtb /onewire gpios 31 111 0
odroid@odroid64:~$ fdtget /media/boot/meson64_odroidc2.dtb /onewire gpios
31 111 0
odroid@odroid64:~$ sudo reboot

DS1820 change to connection Pin #11

Pin 1 (Left): Ground (-)

Pin 2 (Middle): Pin #11 C2 (GPIOX_19, GPIO111)

Pin 3 (Right): Ground (-)

en/c2_hardware_1w.1456728578.txt.gz · Last modified: 2016/02/29 15:19 by ck.kim
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0