DS18b20

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

DS18b20

#1 Post by joost d » 03 Dec 2022, 14:47

I can't get a DS1820 to work.
I use:
ESPEasy-mega-20221105
ESP32 with only a DS1820.
See attachment for configuration.
What strikes me is that in the log only the following appears 1 time at "Submit":
1325715: EVENT: TaskExit#Tempsensor=1.0
1325815: EVENT: TaskInit#Tempsensor=1.0
No more! While I expect such a log entry every second!

Also I don't see anything under "Device Address:"
I have two DS1820 sensors. This is a problem with both.

Am I doing something wrong....
Attachments
Naamloos.png
Naamloos.png (33.87 KiB) Viewed 1029 times

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS18b20

#2 Post by Ath » 03 Dec 2022, 15:04

Do you have a pull-up resistor (4.7k) installed from data to 3.3V? That's required for this sensor to work.
/Ton (PayPal.me)

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: DS18b20

#3 Post by joost d » 03 Dec 2022, 19:21

I tried that resistant too without result.

BTW: Is it correct, if I say that even without a sensor, every second there must be log entry like:
243398: EVENT: TaskExit#Temp=1.0.
If yes, then maybe there is something wrong with the _P004 plugin ....

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: DS18b20

#4 Post by joost d » 03 Dec 2022, 19:52

Solved :-)
Instead of GPIO-14, as indicated in the documentation (ESP8266) I have now used GPIO-4 for my ESP32........

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS18b20

#5 Post by Ath » 03 Dec 2022, 19:58

Ah, GPIO-14 can be configured to be used for SPI devices, causing all kind of trouble when SPI is enabled (though you shouldn't be able to select it), or maybe another device on the ESP you're using is hardwired to GPIO-14?
/Ton (PayPal.me)

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: DS18b20

#6 Post by joost d » 03 Dec 2022, 20:08

The 18b20 is the only divice connected to the ESP32.
SPI is disabled.

Btw: Resistance is necessary! Contrary to what is said elsewhere on the internet.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS18b20

#7 Post by Ath » 03 Dec 2022, 20:18

joost d wrote: 03 Dec 2022, 20:08 The 18b20 is the only divice connected to the ESP32.
SPI is disabled.
Ok
joost d wrote: 03 Dec 2022, 20:08 Btw: Resistance is necessary! Contrary to what is said elsewhere on the internet.
Yes, that's also explicitly mentioned in the plugin documentation. The only reason multiple sensors can share 1 wire is because they use an open collector output, so a pull-up resistor is mandatory. And none have that built in, or it would limit the number of devices that can share that wire. The 1-wire protocol supports at least 100 devices on a single wire (but that would be a hell of a job to configure), ESPEasy supports up to 4 sensors per task, and has 32 tasks available on ESP32, to, it *should* be doable :lol:
/Ton (PayPal.me)

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: DS18b20

#8 Post by joost d » 03 Dec 2022, 20:37

@Ton:Thanks for the explanation.

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

Re: DS18b20

#9 Post by TD-er » 03 Dec 2022, 21:54

But having loads of those on the same wire would also limit the sample interval per sensor.
You can approximately read upto 12 Dallas sensors each second (12 bit resolution -> 750 msec per measurement) because we're sending the start measurement commands in a row and 750 msec later collect the data of each.
Maybe you can read upto 24 - 30 sensors with a 2-sec interval each, but then the ESP is almost 100% busy reading these sensors and can't do much else.

joost d
Normal user
Posts: 53
Joined: 24 Dec 2020, 17:55
Location: Netherlands/ Haarlem

Re: DS18b20

#10 Post by joost d » 03 Dec 2022, 22:38

Don't worry, I have only one sensor :)

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests