I’m looking for help wiring Dallas Ds18b20 temperature sensor with an ESP32 microcontroller. I’m having difficulty understanding the documentation, and I’m not sure how to get it set up properly. If anyone has experience with this, I would really appreciate any advice. Thanks!
Which temp sensor?
Dallas Ds18b20
this should help
https://jemrf.github.io/RF-Documentation/esp32-temperature.html
hello,
this sensor become unreliable when overheat with a pemanent power supply, so it’s better to use an extra pin to power only when you read the sensor: like this:
esphome:
name: horloge-fontaine
on_boot:
priority: -100
# ...
then:
- delay: 5s
- switch.turn_off: dallas_power
- delay: 25s
- switch.turn_on: dallas_power
sensor:
- platform: dallas
name: "Temperature alimentation 5Vdc Fontaine"
id: alim5v_temperature
address: 0xf30000000b2ebf28
switch:
- platform: gpio
id: dallas_power
pin: D6
dallas:
pin: D4
update_interval: 30s
Enjoy!
Thank you so much for sharing your great guide! It’s really helpful.
Is that only with 5v? Have you seen the same with a 3.3v supply?
this sensor need a 3V3 power suply, not 5v.
You can do without, it just depend if you want a reliable reading and longer lifetime
It supports 3.0 to 5.5v, so I think that you are saying that it suffers from self-heating when supplied with 5.0v, is that right?
Hello, it’s been over a year since the last reply here, but this might help other people. I have managed to fix this issue by wiring the dallas sensor to GPIO23. Before I had it wired to either GPIO 0, 2 or 4 and none of them worked. So just try other GPIOs until you find the one that works.
Also I’m only using 1 dallas sensor, so I’m not sure if it helps with multiple.
Hi
using the DS18B20 probe with 5v, is the pullup resistor always 4.7K? Or do you need another value?
Thanks
@Olivier974 @RonnieLast
The value is not important, anything between 4.7k to 10k will.do the job.
Dumb question: how does the above turn on off the sensor regularly? It only does it at boot time, right? Should on_boot be on_loop?
That’s to mitigate self-heating of the sensor. But I have used these for years and have never observed self-heating. If the sensor is self-heating then it’s faulty in my book.
no, the code is executed all the time and it prevents over heating, which i already encountered with some of dallas sensors.
Can I ask, what level of overheating do you see?
I’d wonder if this is an issue with the non-authentic Dallas as the market is swamped with fakes. That’s why you see price differences of around 5 Euro’s from one supplier to the next.
"Besides ethical concerns, some of the counterfeit sensors actually do not work in parasitic power mode, have a high noise level, temperature offset outside the advertised ±0.5 °C band, do not contain an EEPROM, have bugs and unspecified failure rates, or differ in another unknown manner from the specifications in the Maxim datasheet. "