====== Dallas 1-Wire Support ====== * Support for Dallas 1 Wire is included on Kernel 4.9.34 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 #26 XE.INT16 (GPX2.0)** XU3 / XU4 CON10(30 pin) All GPIO and AIN pins use VDD_IO (1.8V) for the signals. \\ So the level converter is required to connect the sensor. Hardkernel Shifter-Shield is not working well with multiple 1-wire devices due to a timing issue.\\ So we used Sparkfun [[https://www.sparkfun.com/products/12009|Level converter board]] \\ \\ \\ {{:en:1-wire_with_level_converter.png?750|}} * **Connection: Level converter** CON10 Pin 1 (P5V0): Level converter HV \\ CON10 Pin 2 (GND): Level converter GND \\ CON10 Pin 29 (VDD_IO): Level converter LV \\ CON10 Pin 30 (GND): Level converter GND \\ CON10 Pin 26 (XE.INT16): Level converter LV1 \\ Sensor signal : Level converter HV1 \\ {{:en:level_shifter.jpg?nolink|}} * **Connection: With External-Supply** {{:en:1-wire-external-power.png?750|}} Pin 1 (Left): Ground (-) \\ Pin 2 (Middle): Level converter HV1 \\ 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** {{:en:1-wire-parasite-power.png?750|}} Pin 1 (Left): Ground (-) \\ Pin 2 (Middle): Level converter HV1 \\ 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@odroid:~$ cd /sys/bus/w1/devices/ odroid@odroid:/sys/bus/w1/devices$ ls 10-000802f3be04 w1_bus_master1 odroid@odroid:/sys/bus/w1/devices$ As you can see my sensor is detected as **10-000802f3be04**, each sensor has a different id. So yours will be different. * Read the temperature: odroid@odroid:/sys/bus/w1/devices$ cd 10-000802f3be04 odroid@odroid:/sys/bus/w1/devices/10-000802f3be04$ cat w1_slave 37 00 4b 46 ff ff 06 10 da : crc=da YES 37 00 4b 46 ff ff 06 10 da t=27375 odroid@odroid:/sys/bus/w1/devices/10-000802f3be04$ Temperature is t=27375 or 27.375 degree's Celsius. Multiple sensors can be connected on the same line as the draw below. {{:en:untitled_sketch_bb2.png?750|}} odroid@odroid:/sys/bus/w1/devices$ ls 10-000802f384e2 10-000802f3be04 w1_bus_master1 odroid@odroid:/sys/bus/w1/devices$ Two sensors in parallel.