DS18b20 does not work

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Andrew Mamohin
Normal user
Posts: 102
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

DS18b20 does not work

#1 Post by Andrew Mamohin » 25 Jan 2023, 09:28

Hi!
I bought once again several different DS18B20 sensors (to-92 and a metal tube). But, not one of them works with EspEasy on ESP32 (I tried three different ESP32). I can't choose the address. Automatic choice also does not work. Earlier, I bought many such sensors and all of them work in me in different projects (including at EspEasy).
Sy4FHv50Rt.jpg
Sy4FHv50Rt.jpg (3.48 KiB) Viewed 9347 times
But, they work for Arduino!
This is a print of my sketch at Arduino:

Code: Select all

Found sensors: 1
Mode power is Normal
Device 0 Address: 28CC414CB12109A4
Device 0 Temp C: 22.81
What should I do?
Andy.

TD-er
Core team member
Posts: 9221
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DS18b20 does not work

#2 Post by TD-er » 25 Jan 2023, 10:00

Which build are you using?
I know the DS18b20 is working on both ESP8266 and ESP32, at least with the most recent code as I have it running here on my desk.
There has been an issue if you had "plugin stats" enabled, so that's why I have been looking at it in the last 2 weeks.

Also you need to make sure there is a pull-up resistor present as is shown here: https://espeasy.readthedocs.io/en/lates ... e-pictures

I know some Arduino libraries try to enable an internal pull up, which is not done in ESPEasy.
This may work, but due to the fact the internal pull-ups are quite weak, it does cause stability issues. Especially with multiple sensors and/or long wires.

User avatar
Andrew Mamohin
Normal user
Posts: 102
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: DS18b20 does not work

#3 Post by Andrew Mamohin » 25 Jan 2023, 10:08

TD-er wrote: 25 Jan 2023, 10:00 Which build are you using?
I am flashing the file ESP_Easy_mega_20221224_collection_A_ESP32_4M316k.factory.bin

Of course, I put a resistor. I'll probably have to replace the sensor in some work project. It's not that easy because all these sensors work in my smart home.
I think these new sensors are somehow different (Chinese fake).
Andy.

TD-er
Core team member
Posts: 9221
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DS18b20 does not work

#4 Post by TD-er » 25 Jan 2023, 10:14

I have bought the most improbable low priced "Dallas" look alike sensors from Ali, DX and Banggood, just to make sure the ESPEasy Dallas plugin will work with those.
Also placed them with > 3 on small breadboards to make sure this also does work as that's one of the reported issues with the fake ones that they're not working with > 3 pieces on a chain.

So unless you really bought some sensors which are even worse than the garbage I used to test here, it should probably work :)

This is one of the last GH Action builds made on the current 'mega' branch code:
https://github.com/letscontrolit/ESPEas ... 3967004008

Can you try this one?
Also, which pin do you use on the ESP32?

User avatar
Andrew Mamohin
Normal user
Posts: 102
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: DS18b20 does not work

#5 Post by Andrew Mamohin » 25 Jan 2023, 12:21

TD-er wrote: 25 Jan 2023, 10:14
I solved the problem. At first I even stopped the heating boiler to replace the sensor. There is an old version of the espeasy. The new sensor worked on it. Then I connected the old sensor to the new board (I have two of them). He did not work. Then I flashed the new board with the ESP_Easy_mega_20210802_test_A_ESP32_4M316k.bin file. The sensor is working! Then I flashed ESP_Easy_mega_20221224_collection_A_ESP32_4M316k.bin from above and the sensor also worked.
So I did with the second new ESP32.
Conclusion: if you flash on a clean board ESP_Easy_mega_20221224_collection_A_ESP32_4M316k.factory.bin, then the sensor does not work. If you flash the old version first, and then upgrade ESP_Easy_mega_20221224_collection_A_ESP32_4M316k.bin, then the sensor works.

P.S: I am a downshifter. I buy the cheapest sensors :)
Andy.

TD-er
Core team member
Posts: 9221
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DS18b20 does not work

#6 Post by TD-er » 25 Jan 2023, 12:32

Hmm that's extremely strange...
I wonder why this might happen.

Does it still work on the latest build if you power cycle the unit?
Can you also check with the latest build I linked to see if it works on that build on a clean install?

User avatar
Andrew Mamohin
Normal user
Posts: 102
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: DS18b20 does not work

#7 Post by Andrew Mamohin » 25 Jan 2023, 14:28

TD-er wrote: 25 Jan 2023, 12:32
I checked with the new firmware. The sensor is working! Then I cleared the ESP again and flashed ESP_Easy_mega_20221224_collection_A_ESP32_4M316k.factory.bin. The sensor is working!
I can assume that some bugs remained in my devices from experiments with Tasmota.
I'm sorry to trouble you! But, for two days I connected 6 new sensors to two different devices on different pins. And they didn't work. So I panicked...
Andy.

TD-er
Core team member
Posts: 9221
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DS18b20 does not work

#8 Post by TD-er » 25 Jan 2023, 14:35

Maybe we should use big friendly letters and start each page of the documentation with "Don't Panic" :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest