Troubleshooting DS18B20 temperature sensor

I have a photon with Device OS 1.0.1 and can’t find any working examples/ libraries for the DS18B20 temp sensor.
I have wired the sensor correctly, and tried almost every example with no luck. I have it connected to GROUND, 3v3 , and D4 with a 10K resistor between 3v3 and GND.
@ScruffR we have tried your solutions/libraries from other threads, but to no avail.
All I need is a simple way to read the temp , any help would be appreciated.

@PhotonSaviour, the resistor needs to be between the data pin (the one connected to D4) of the DS18B20 and 3V3 to act as a “pull-up” resistor.

1 Like

Yes, this is what I did, sorry.

Which library did you try? Do you have more than one DS18B20 to test? Did you try on a different GPIO pin (eg. D2)?

@peekay123 I tried the code from this Maker Kit Link: https://docs.particle.io/tutorials/hardware-projects/maker-kit/
, which required the Onewire library.

I also tried all of the dallas-temp libraries and the DS18B20 libraries.

I have two sensors, one of which i can confirm has never been connected in any manner other than the one it is now. I have switched between d3,4, and 5 for all of my attempts.

@PhotonSaviour, did you try the official OneWire library in the Web IDE?

https://build.particle.io/libs/OneWire/2.0.3/tab/DS18.cpp

It includes a example to read a DS18B20 sensor:

https://build.particle.io/libs/OneWire/2.0.3/tab/example/DS18x20_Temperature.ino

@peekay123 Downloaded the desktop IDE thingy (so i could use serial monitor) and I got the library and example onto the photon. Switched between ports D2, D3, and D4, (and tried both sensors) but the monitor always read " no more addresses"

Which "thingy" is that exactly? The Particle Workbench? The Particle CLI?

@peekay123
Particle Dev" as seen here : https://docs.particle.io/tutorials/developer-tools/dev/

@PhotonSaviour, that tool is no longer well supported. I highly recommend using the Particle Workbench or the Particle CLI.

Can you post a picture of your Photon/DS18B20 setup?