Dallas 1-Wire Support
- Support for Dallas 1 Wire is included on Kernel 3.10.67-52 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.
You have to edit /etc/modprobe.d/blacklist-odroid.conf file to enable the 1-wire driver because the driver exists in the blacklist by default.
Default GPIO for 1-Wire is Pin #7 (GPIO83)
- Connection: With External-Supply
Pin 1 (Left): Ground (-)
Pin 2 (Middle): Pin #7 C1
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 C1
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:
root@odroid:~# cd /sys/bus/w1/devices/ root@odroid:/sys/bus/w1/devices# ls 10-000802f41d67 w1_bus_master1 root@odroid:/sys/bus/w1/devices#
As you can see my sensor is detected as 10-000802f41d67, each sensor has a different id. So yours will be different.
- Read the temperature:
root@odroid:/sys/bus/w1/devices# cd 10-000802f41d67 root@odroid:/sys/bus/w1/devices/10-000802f41d67# 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 root@odroid:/sys/bus/w1/devices/10-000802f41d67#
Temperature is t=25562 or 25.562 degree's Celsius.
Multiple sensors can be connected on the same line as the draw below.
root@bigsmall:/sys/bus/w1/devices# ls 10-000802f37119 10-000802f41d67 w1_bus_master1
Two sensors in parallel.