DS18B20 won't work with 10m cable

The resistor should be AT the sensor.

So theoretically in the sketch above, the resistor from the end of network ( near ESP) could be removed ? Also i have there an resistor from the adaptor, i will try to remove that one also.

Did you try to get it to work with only one sensor?

Yes, at first try was with only one resitor, but placed at the END of network, near the ESP
It worked with one sensor, when added the second crashed
Also, withe 3 sensors, all with 0,9m cable connected to same adaptor at ESP, worked good

Have you measured the voltage at the sensors?

As a short update:
After setting up the 4k7 rezistor at the senzor end cable ( between 0,9m sensor cable and the 10m cable) the sensors started to work fine

Later update:
After 3 days of perfect working, now suddenly i get again “unknown” value of temperature. I had no intervention on the system, so suddenly stopped to work !

INFO ESPHome 2023.6.3
INFO Reading configuration /config/esphome/esphome-web-3073fc.yaml...
INFO Starting log output from esphome-web-3073fc.local using esphome API
INFO Successfully connected to esphome-web-3073fc.local
[10:09:14][I][app:102]: ESPHome version 2023.6.3 compiled on Jul  6 2023, 00:07:01
[10:09:14][C][wifi:543]: WiFi:
[10:09:14][C][wifi:379]:   Local MAC: C8:F0:9E:30:73:FC
[10:09:14][C][wifi:380]:   SSID: [redacted]
[10:09:14][C][wifi:381]:   IP Address: 192.168.100.134
[10:09:14][C][wifi:383]:   BSSID: [redacted]
[10:09:14][C][wifi:384]:   Hostname: 'esphome-web-3073fc'
[10:09:14][C][wifi:386]:   Signal strength: -78 dB ▂▄▆█
[10:09:14][C][wifi:390]:   Channel: 11
[10:09:14][C][wifi:391]:   Subnet: 255.255.255.0
[10:09:14][C][wifi:392]:   Gateway: 192.168.100.1
[10:09:14][C][wifi:393]:   DNS1: 192.168.100.1
[10:09:14][C][wifi:394]:   DNS2: 0.0.0.0
[10:09:14][C][logger:301]: Logger:
[10:09:14][C][logger:302]:   Level: DEBUG
[10:09:14][C][logger:303]:   Log Baud Rate: 115200
[10:09:14][C][logger:305]:   Hardware UART: UART0
[10:09:14][C][dallas.sensor:075]: DallasComponent:
[10:09:14][C][dallas.sensor:076]:   Pin: GPIO16
[10:09:14][C][dallas.sensor:077]:   Update Interval: 60.0s
[10:09:14][D][dallas.sensor:082]:   Found sensors:
[10:09:14][D][dallas.sensor:084]:     0xea000000198ae028
[10:09:14][D][dallas.sensor:084]:     0xd800000018feea28
[10:09:14][D][dallas.sensor:084]:     0x3f0000001a210128
[10:09:14][C][dallas.sensor:089]:   Device 'Temperature #1'
[10:09:14][C][dallas.sensor:089]:     Device Class: 'temperature'
[10:09:14][C][dallas.sensor:089]:     State Class: 'measurement'
[10:09:14][C][dallas.sensor:089]:     Unit of Measurement: '°C'
[10:09:14][C][dallas.sensor:089]:     Accuracy Decimals: 1
[10:09:14][C][dallas.sensor:097]:     Address: 0xea000000198ae028
[10:09:14][C][dallas.sensor:098]:     Resolution: 12
[10:09:14][C][dallas.sensor:089]:   Device 'Temperature #2'
[10:09:14][C][dallas.sensor:089]:     Device Class: 'temperature'
[10:09:14][C][dallas.sensor:089]:     State Class: 'measurement'
[10:09:14][C][dallas.sensor:089]:     Unit of Measurement: '°C'
[10:09:14][C][dallas.sensor:089]:     Accuracy Decimals: 1
[10:09:14][C][dallas.sensor:097]:     Address: 0xd800000018feea28
[10:09:14][C][dallas.sensor:098]:     Resolution: 12
[10:09:14][C][dallas.sensor:089]:   Device 'Temperature #3'
[10:09:14][C][dallas.sensor:089]:     Device Class: 'temperature'
[10:09:14][C][dallas.sensor:089]:     State Class: 'measurement'
[10:09:14][C][dallas.sensor:089]:     Unit of Measurement: '°C'
[10:09:14][C][dallas.sensor:089]:     Accuracy Decimals: 1
[10:09:14][C][dallas.sensor:097]:     Address: 0x3f0000001a210128
[10:09:15][C][dallas.sensor:098]:     Resolution: 12
[10:09:15][C][captive_portal:088]: Captive Portal:
[10:09:15][C][mdns:108]: mDNS:
[10:09:15][C][mdns:109]:   Hostname: esphome-web-3073fc
[10:09:15][C][ota:093]: Over-The-Air Updates:
[10:09:15][C][ota:094]:   Address: esphome-web-3073fc.local:3232
[10:09:15][C][api:138]: API Server:
[10:09:15][C][api:139]:   Address: esphome-web-3073fc.local:6053
[10:09:15][C][api:143]:   Using noise encryption: NO
[10:09:52][W][dallas.sensor:261]: 'Temperature #1' - Scratch pad checksum invalid!
[10:09:52][D][sensor:094]: 'Temperature #1': Sending state nan °C with 1 decimals of accuracy
[10:09:52][W][dallas.sensor:261]: 'Temperature #2' - Scratch pad checksum invalid!
[10:09:52][D][sensor:094]: 'Temperature #2': Sending state nan °C with 1 decimals of accuracy
[10:09:52][W][dallas.sensor:261]: 'Temperature #3' - Scratch pad checksum invalid!
[10:09:52][D][sensor:094]: 'Temperature #3': Sending state nan °C with 1 decimals of accuracy

The internet is full of junk, no one known how electronic works, instead of google or bing something use datasheet provided by ic manafacturer. No one want to read datasheet because human are lazy.

  1. voltage drop - [no issue] [dallas sensor work with less 1.5v]
  2. cable type - [no issue] [one wire protocol immune to noise]
  3. cable length - [no issue] [one wire work reliably over 60 meter]
  4. cable capacitance - [issue]

In your case, just pust only one 1K ohm resistor 3.3v ~ data_pin at esp32, remove other resistor including plugable terminal.

2 Likes

Thank you !
After 2-3 hours of non working, the sensors ( all 3 of them) started again to work fine. Without any intervention from my side. Wierd
Only thing happed, was that before not working, was a heavy rain … without any contact to the connectors tough

I will apply your advice with first problem interntion

Wierd :slight_smile:

I see that in the past 2 says constantly in loose signals couple times a day
Where that one 1k ohm should be placed ? Right before esp or at the link between cables (of 91 cm and the 10m cable ) ?

Thank you !

Is the sensor cable running alongside mains power cables at any point?
If so, move it away from them.

The device is being provided with power. (3.3v)
According to the data sheet, with power, the sensor does not need a ‘strong’ pullup resistor as it is not required to perform using parasitic power.
I agree, cable capacitance could be an issue. Maybe try a 4k7 at both ends of the cable which should reduce transients and any possible ringing…

Hello,
sensors are trough one wire system, so the main power wire s in the same cable.
Is weird though, the sensors are disconnecting and connecting by themselves, without any intervention from my side.

No i have the following connections:

I think you misunderstood my comment relating to the mains power cable:-

Check the 10m route your 4 wire sensor cable takes to reach the sensor.

Does the sensor cable run close to any other cables?
Power cables to pumps / refrigerators / a-c units ?
Signal wires being close to mains power cables can suffer from interference.
Particularly when motors switch on, they can cause a lot of interference.
Variable speed motors are really bad.

That maybe why the signal comes and goes.

You should also connect the sensor cable screen (the foil surrounding the 4 wires) to the GND connection.

That should also help if it is caused by interference.

Thank you ! i really misinterpreted your message.

I do not have any cables near the sensor area, or the cable of sensor way.
I think s related to the resistors, because each time i re-do the connections, sensor apereas online for few hours. But after this, again get the unknown status

Wat would be the “ideal” resistors use (and where), currently my setup is presented above
Thank you !

I suspect you have already found the problem from reading your posts.

If the signal is good again, after you re-make the connections, it suggests they are not really good enough.

One termination board at either end should be more than sufficient for a 10m cable with a supply feed for the sensors.
Is the cable known to be good?
Check the 3.3v voltage is present at the far end of the cable.
Both when it is working and not.
Ensure there is no water/condensation on the sensor wiring and termination boards.
Connect the screen and the unused wire to GND.
Try another length of cable as a temporary test.

Hey! can you share how you acomplish this.

Thanks!!

By connecting individual cables in parallel.

Or what is it you are actually asking?

This is borderline silly. If anyone wants your SSIDs, they just get near your router and scan the WiFi. The only thing that needs to be hidden are passwords and API keys.

“state nan °C” NAN is “Not a Number”.

Dallas specs recommend the pullup resistor be at the sensor end.