Need help wiring temperature sensor with ESP32

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?

1 Like

Dallas Ds18b20

this should help

https://jemrf.github.io/RF-Documentation/esp32-temperature.html

1 Like

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!

1 Like

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 :wink:

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.