In any of these cases the red status LED on the sensor lights up. The Sensor DS18B20 is connected to the Raspberry Pi 3 B+ to the 5v on the GPIO pins. Using the 3.3v pin makes the light of the sensor light up but does not show anything on the Pi. When connecting to the 5v pin the following happens.

When attaching a DS18B20 to my Raspberry Pi I usually see 3 ID's in my /sys/bus/w1/devices folder. after a little while 1 of these 3 disappear and the other 2 change name. The sensor is not readable because there is no "w1_slave" file in any of these folders. furthermore the ID's look nothing like anything else I see in tutorials or questions on the internet.

Screenshot of Raspberry pi with the connected DS18B20

I have already gone back with the sensor to the shop I bought it from explaining the issue to them. They said they have never heard this before (I believe them) and they gave me a new one. The previous sensor would not show anything at all while connected to 3.3v on the Rapsberry Pi. I haven't tested the 5v on the old sensor because I came with the 5v idea after I received a new one

A thing to note about the sensor is that it is a tiny circuitboard with the resistor already properly connected.

Here are 2 Pictures of what the actual sensor looks like, the red LED is on in the picture but not visible because of the flash.

The Pi and the sensor connected

I have already searched the web for this problem but there is nothing like it. All the settings on the Pi seem fine, at least the ones other problems and tutorials talk about (the dtoverlay=w1–gpio setting has been set correctly for example).

  • As the resistor is on-board you probably ought to be powering from 3V3. Powering from 5V risks damage to the Pi GPIO as you will be pulling the input GPIO to 5V. The photos are not clear. Which Pi pins are connected to which board pins?
    – joan
    Commented Aug 10, 2018 at 19:21
  • RIght now I have reconnected the red power wire to 3.3v the black signal wire to GPIO pin 17 and the blue wire to ground. After a reboot of my Pi, which also executes the modprobe commands after reboot, I get an empty /sys/bus/w1/devices. I have also read out GPIO 17 with the commands "echo 17 > /sys/class/gpio/gpiochip0/subsystem/export" and "cat /sys/class/gpio/gpiochip0/subsystem/gpio17/value". The readout is 0.
    – Maarten
    Commented Aug 11, 2018 at 10:10
  • In the original picture red was connected to 5v, blue to ground and black to GPIO4.
    – Maarten
    Commented Aug 11, 2018 at 10:11

3 Answers 3


I'm starting on this so I apologize if I make a mistake as a rookie.

Marteen, I have had the same problem with the sensor and after a lot of searching on the WEB I did not find solution, until I compared the pins of the chip itself (DS18B20) with those of the module KY001. In my case, and I think in yours from what I see in the photos, one mistake was to trust the function of each pin according to the manufacturer of the module and other mistake was to believe that it is "plug & play". Let me explain: the info I had from the KY001 module was that the pin "-" corresponds to the ground, the central pin corresponds to the VCC (3.3v) and the pin (S) corresponds to the data bus. I also assumed that the resistance coming from the circuit acts as pullup resistance indicated by all, in the end, in my case it is "all false".

1.- The resistance that is welded on the plate is only the current regulation resistance for the LED, which only indicates that the plate KY001 is powered.

2.- The pin (-), the blue one in your photography, corresponds to the data bus (I have connected it to GPIO4).

3.-The central pin (red one in your photo) does correspond to VCC (I have connected it to 3.3v).

4.- The pin (S) (black one in your photo) corresponds to the circuit mass (I have connected it to GND)

5.- I connected an external pullup resistor (5K1 because it was the one I had) to KY001 between the pins of VCC (3.3v) and GPIO4 of the Raspberry PI 3B + that I have (between blue and red cables of your photo)...

It works perfectly!!!! I almost cried with emotion !! ;-P I hope this solution works for you too. Regards

this is my scheme

Anyway I recommend you check in which "row" of holes the sensor is welded because depending on that detail, the pins may not match my indications

  • Thank you so much for taking your time to respond to my question! I’ve had the sensor dangling and non working for months now and will get on it as soon as I get home tonight. Again thank you for your response! I will get back to you ASAP
    – Maarten
    Commented Feb 23, 2019 at 16:00

What you see there is a distorted bus, most likely because of using wrong/mixed voltage levels.

If you use the GPIO Onewire, your 1.5kΩ pullup (not 4.7kΩ as often advised!) has to go to +3.3V. Not +5V. A "raw" DS18B20 supports that. If you have a module which powers the DS18B20 with +5V, you need a level-shifter.

That's as simple as a single BS170 transistor (or 2N7000 or another small-signal N-channel enhancement MOSFET) and two resistors.


simulate this circuit – Schematic created using CircuitLab

  • imgur.com/a/gf0krV6 This is what the actual sensor looks like, is it true that the included resistor should make my setup "plug and play". I don't know anything about electronics and would like to know what I should do to make it work. Sadly I do not understand what I need to do from your answer :)
    – Maarten
    Commented Aug 10, 2018 at 19:08
  • Try powering the sensor from 3.3 volts. Then you won't need the voltage divider.
    – NomadMaker
    Commented Aug 10, 2018 at 19:43
  • That's a 4.7kΩ pullup. If you connect the sensor Vdd line to +3.3V, it might work. I recommend a much smaller pullup, you can go as low as 1kΩ at 3.3V or 1.5kΩ at +5V (but you need the level-shifter then!). It gives faster low-high transition times, which is crucial for the function of the bit-protocol of Onewire.
    – Janka
    Commented Aug 10, 2018 at 19:58
  • Powering from the 3.3v pin makes the status LED turn on but no sensors appear in ../w1/devices
    – Maarten
    Commented Aug 10, 2018 at 20:01
  • 1
    If you connected it once to +5V, you might have fried GPIO4 on the Raspberry Pi.
    – Janka
    Commented Aug 10, 2018 at 20:08

Silly question, have you enabled the 1-Wire sensor in raspi-config and rebooted?

sudo raspi-config

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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