esp32 with multiple 1-wire thermometers on multiple pins #12343
Unanswered
garyn87048
asked this question in
ESP32
Replies: 2 comments 1 reply
-
Hi,
Use the" Skip ROM command" (0xCC) followed by "Convert T" (0x44) to initiate measurement cycle for ALL 18b20 at the same time, wait 750 ms and then fetch the values from one by one without the 750 ms delay between.
See the data sheet for "Skip ROM".
Regards
Folke
… 2023-08-31 kl. 05:39 skrev garyn87048 ***@***.***>:
Hi!
I have a small aquatic farm and I'm offloading some of the automation tasks from RPi to esp32. I have approximately ten ds18b20 1-wire thermometers scattered throughout the room. Yes, they all do work now on just one bus and it took some tinkering with resistor sizes, wire lengths, and wire gages. Luckily, the devices were added over time and I had a pretty good idea which new member was disrupting the party. :-)
Question: on esp32, would it be reasonable/advisable to split thermometers into groups of 3-4 devices so that each group is read from a unique GPIO pin? My goal is to primarily avoid the 750ms delay per device and I'm wondering if micropython can juggle the interrupts which could possibly be occurring simultaneously between pins. If simultaneous pins will work, is there a practical upper limit to the number of pins I can load in this manner?
Thought ask first before trying and I can post success/failure, if that would be helpful.
Thank you!!
Gary
—
Reply to this email directly, view it on GitHub <#12343>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC37DHMLB6FIMUJMA6L5KILXYABN5ANCNFSM6AAAAAA4FNQ2RY>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi Gary,
If you use Micropythons own driver/class for onewire/ds18x20 like for the ESP8266 (see <https://docs.micropython.org/en/latest/esp8266/tutorial/onewire.html <https://docs.micropython.org/en/latest/esp8266/tutorial/onewire.html>>), you can see an example of use. Note that the ROM is omitted when calling convert_temp() in the given example "ds.convert_temp()" in the outer for loop! You will get the temp readings from ALL the attached ds18b20 without having to wait 750 ms for each reading of attached ds18b20. (Only once after each batch trigger).
N.B. I have not tested this now, but remember using a similar method some 8 years ago. See also <https://forum.micropython.org/viewtopic.php?t=8279 <https://forum.micropython.org/viewtopic.php?t=8279>>
Regards,
Folke
… 2023-08-31 kl. 07:50 skrev garyn87048 ***@***.***>:
Nice! I'll set this up tomorrow!
—
Reply to this email directly, view it on GitHub <#12343 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC37DHJJA2H6IJ642BFZ4JDXYAQ2NANCNFSM6AAAAAA4FNQ2RY>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I have a small aquatic farm and I'm offloading some of the automation tasks from RPi to esp32. I have approximately ten ds18b20 1-wire thermometers scattered throughout the room. Yes, they all do work now on just one bus and it took some tinkering with resistor sizes, wire lengths, and wire gages. Luckily, the devices were added over time and I had a pretty good idea which new member was disrupting the party. :-)
Question: on esp32, would it be reasonable/advisable to split thermometers into groups of 3-4 devices so that each group is read from a unique GPIO pin? My goal is to primarily avoid the 750ms delay per device and I'm wondering if micropython can juggle the interrupts which could possibly be occurring simultaneously between pins. If simultaneous pins will work, is there a practical upper limit to the number of pins I can load in this manner?
Thought I'd ask first before trying and I can post success/failure, if that would be helpful.
Thank you!!
Gary
Beta Was this translation helpful? Give feedback.
All reactions