Problem with d1_mini board version and Dallas sensor

I have a problem with d1_mini board version and Dallas sensor cooperation. I use a 3.7K resistor and a sensor with a cable of about 3m. Unfortunately, the results are very inconsistent. I can see the sensor in logs but data does not seem to go thru. I have never had such problems with the esp01 board and I can’t figure out what the problem is and how to fix it. Below is, for example, an extract from the log where the errors are interspersed with working data.

[21:33:17][W][dallas.sensor:131]: 'water' - Resetting bus for read failed!
[21:33:18][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy
[21:34:17][W][dallas.sensor:131]: 'water' - Resetting bus for read failed!
[21:34:18][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy
[21:35:17][W][dallas.sensor:131]: 'water' - Resetting bus for read failed!
[21:35:17][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy
[21:36:16][E][dallas.sensor:112]: Requesting conversion failed
[21:36:16][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy
[21:37:17][W][dallas.sensor:261]: 'water' - Scratch pad checksum invalid!
[21:37:17][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy
[21:38:17][D][dallas.sensor:143]: 'water': Got Temperature=26.9°C
[21:38:17][D][sensor:093]: 'water': Sending state 26.93750 °C with 1 decimals of accuracy
[21:39:17][D][dallas.sensor:143]: 'water': Got Temperature=26.9°C
[21:39:17][D][sensor:093]: 'water': Sending state 26.93750 °C with 1 decimals of accuracy
[21:40:16][E][dallas.sensor:112]: Requesting conversion failed
[21:40:16][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy
[21:41:17][W][dallas.sensor:261]: 'water' - Scratch pad checksum invalid!
[21:41:17][D][sensor:093]: 'water': Sending state nan °C with 1 decimals of accuracy

Perhaps someone has experience with such a problem.
Thanks

I have a similar set up with the sensors on a bit longer line , by 1 meter. A 4.7KΩ resistor works for me. All so check your solder joints. I have experienced “NAN” reading when I realized I had a cold solder joint in the mix.

Hope its of help.

1 Like

Cold solder was the first thing to check.
As hinted here Multiple DS18B20 dallas.sensor: Scratch pad checksum invalid! I think it could be something with ESPHome coding? It looks like a really similar thing. I did add just for testing purposes another sensor and now the second one is mostly (still not all the time) giving me the correct readings but the first one is still malfunctioning with lots of “Scratch pad checksum invalid” errors.
The readings are really erradical and the reasons inconclusive so far

May be you have your self some dodgy dallas sensors.

A year ago I bought a bag of 100 dallas sensors from a Chinese vendor, for cheap. After trying about 25 sensor and all failing in some way(mostly all dead) I tossed the rest of the lot.

Hardware malfunction is always a possibility but I have tested this with 2 boards and 3 different sensors. Also, the sensor from the same batch works happily with esp01 board. At this point, the more likely option for me, as suggested in another thread mentioned here, is that the fault lies with the ESPHome itself. I mean ESPHome doesn’t seem to want to work well with the mini board and dallas combination. Anyway, I have no more parts to test with.

If you are familiar with Tasmota, try the same devices with it. You could even try flashing Wled and try the user mod to add a dallas senor to test devices.

If they work. Then you have proven the fault lies with Esphome.
I have 4 Esphome d1-mini 1mb devices with a number of dallas sensors. All never miss a beat.

Nan means Not a Number. Usually something wrong with your wiring.
Post your code please.
Check your wiring:
image

As I described above I tested with 3 different sensors, so it must be something wrong with all of them, or 2 boards i have, or all of them. It’s absolutely possible, but still somewhat unlikely.
I dont write any code in ESPHome. ESPHome does it. The only input from my side is pin and sensor addresses as described in papers.

ESP does not write any code.
Please post your full code if you want help.

As you say, unlikely that all boards and/or all sensors are broken.
The only constant factor is probably your code…

What are u talking about!
I don’t have any code to post. As I already said only user input needed for dallas sensors is pin and sensor address + board ID!

I got such a result that if I use about 2.5K resistor with this board about 50% of the data comes through. Since I don’t have more hardware to test with, and I don’t have more ideas, it will probably stay like this until I get some other boards. I’ll probably ditch the Wemos D1 mini in future.

Fine. No code.
Enjoy!

Sure. Go troll somewhere else

1 Like

If you’re using ESPHome, there should be a .yaml file with code stored within.
If you click on the ESPHome device, and edit it, that is the yaml code you can share.

1 Like

I already migrated this device to Tasmota. It works great with that

This was actually great advice! I migrated this device to Tasmota and it works without any problem there.

Awesome! I’m glad you have got the module and sensor working together.

Now if you have the time you could make a bug report at Esphome. GitHub - esphome/issues: Issue Tracker for ESPHome

Put as much detail as you can.
Then the folks there can fix it, hopefully.

1 Like