1

I am trying to setup DS18B20 for Raspberry Pi. I have followed the instructions from Adafruit Lesson 11

  1. updated RBPI kernal to 4.19
  2. setup wiring (see below) with 10k resistor
  3. verified signal (yellow to black) using multimeter ~ 2.4-2.6V
  4. updated the config.txt file in boot directory

restarted and then ran the following code.

~ $ sudo modprobe w1-gpio
~ $ sudo modprobe w1-therm
~ $ cd /sys/bus/w1/devices
/sys/bus/w1/devices $ ls
/sys/bus/w1/devices $

there is nothing returned after the "ls" command indicating that the directory is empty. According to the instructions, if successful then I should see a device listed 28-xxxx.

DS18B20 setup instructions from Adafruit Lesson 11

wiring

DS18B20 : RBPI

red : Pin 1 (3.3V)

black : Pin 9 (GND)

yellow : Pin 7 (GPIO4)

wiring setup 01 wiring setup 02

  • your device black wire seems to be connected to breadboard column 19 where as the pi seems to be on 21 - also, with that mess of wires on the pi, it's hard to guess which gpio you are connecting to on the pi - there's 2 orange 2 black and 2 red on the pi - what are you connecting to? – Jaromanda X Mar 21 at 10:30
  • the yellow wire from the Ds18B20 connects to the orange wire ... which you say is pin 7 - but there is no orange wire on pin 7 of the pi – Jaromanda X Mar 21 at 10:34
  • A grey wire appears to be on pin 7 (GPIO 4). Is that connected to the DS18B20 data pin? – joan Mar 21 at 11:21
  • Those instructions are ante-deluvian - nothing to do with current Raspbian – Milliways Mar 21 at 11:32
1

The issue was tri-fold:

  1. wiring of the pull-up resistor should be as follows: wiring

  2. 1-wire protocol was OFF. Simplest way to switch that ON is through sudo raspi-config -> interfaces.

  3. w1-gpio and thermal driver were missing. As soon as they were installed, sensor surfaced in /sys/bus/w1/devices/ and was producing desired output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.