Skip to content

Dallas 1 Wire Temperature Sensor

Calin Crisan edited this page Feb 2, 2020 · 16 revisions

This page will help you install and use a Dallas 1-wire temperature sensor (typically a DS18B20) with qToggleOS.


Instructions

  1. Connect your Dallas sensor to the Raspberry Pi board, on a GPIO of your preferenc (use GPIO4 if in doubt).

  2. Add the following line to your /data/etc/dtoverlays file:

     w1-gpio gpiopin=4
    

    Replace 4 with the GPIO number you use. Add multiple entries if you plan to use multiple sensors connected to the same board, on different GPIOs.

    For more details on dtoverlays, see this.

  3. Find the address of your sensor(s):

     # ls -1 /sys/bus/w1/devices/*/w1_slave | grep -oE '28-[^/]+'
     28-00000deadbee
    
  4. Follow the instructions from qtoggleserver-dallastemp to install and add support for Dallas temperature sensors to your qToggleServer.

  5. Reboot. The temperature port should show up in your qToggleServer.

    Alternatively, you can restart the following services manually:

     # service dtoverlays restart
     # service qtoggleserver restart
    

Troubleshooting

  • You should see the detected devices in /sys/bus/w1/devices:

      # ls /sys/bus/w1/devices/
      28-00000deadbee w1_bus_master1
    
  • Make sure the modules w1-gpio and w1-thermo are loaded:

      # lsmod | grep w1
      w1_therm               16384  0 
      w1_gpio                16384  0 
      wire                   40960  2 w1_therm,w1_gpio
    
  • Make sure your sensor is properly connected and has the needed resistor between Data and VCC pins.

Clone this wiki locally