I have 3 x esp32 devices reading temperature from ds18b20 temperature probes,
same build same sketch.
1 device runs 100 %
1 device, had 2 reading errors in 24 hours, and shows reading as -127 (so didnt get reading from probe)
1 device, had 6 reading errors in the same 24 hour period, also giving -127 readings, before the error readings and after the error readings the device runs fine for hours and gets readings every 30 min. ..so not sure what could be causing this . if it was faulty wires or power supply it should be giving alot more of these errors. .if anyone could help that would be awesome thanx.
Hard to answer. It can be a problem on 1-Wire bus. Too long wires, not reliable connection, unsuitable design of the bus, other circuit influence, etc. For an example switching relays can cause a problem.
If the occurrence is rare it is not so bad.
It is not easy to find the right solution. Easy one is to try decrease pull-up resistor or to add small 68-100ohm serial resistor on the data pin close to each sensor.
If the ROM does not follow the pattern 28-xx-xx-xx-xx-00-00-xx then the DS18B20 sensor is a clone [5].
Also, there are two Arduino sketches provided to test DS18B20 sensors:
discover_fake_DS18B20.ino performs some harmless tests and indicates if they show deviations from authentic DS18B20. Not designed to work with parasitic power.
classify_fake_DS18B20.ino is a minimal implementation matching a sensor to a specific Family (see below) based on the response to undocumented function codes. Output is specific but rather boring. Use at your own risk.
Hi there..no none of them outdoor..they are all set up to read temperatures from fridges.
Im suspecting the fridge motors are causing noise interverance or electrical spikes when the motor starts up.
I have also tried capasitors and ferret beads.
OneWire requires a single 4.7K pullup resistor, connected between the pin and your power supply. When using very long wires, or with counterfeit DS18B20 chips and 3.3V power, a resistor in the 1K to 2.7K range may be required.