Multiple OneWire DS18B20 Instances?

joglz8
Posts: 20
Joined: Wed Jan 09, 2019 9:46 am

Multiple OneWire DS18B20 Instances?

Postby joglz8 » Thu Jan 18, 2024 9:50 pm

This is kind of a long storey with some questions at the end.

I need to collect data from 12 DS18b20 one wire temperature sensors. I have learned (form experimenting) that the most I can have on one GPI/O, instance, is 7. The reason for this is that they are scattered about a building and there is a fair amount of wire between them.

I tried setting up two instances of one wire on two GPIO and had problems using the arduino OneWire and DallasTemperature libraries. I could only get one instance to run at a time on an ESP8266 (a WEMOS R1 D1). If I used the sensors.getTempFByIndex it would see both buses, but when I tried to read temperatures by their hex address it would only work on one bus and the other was un-accessable. I think that I read somewhere it was due to some clunky arrays or tables or something in the OneWire library.

So now I am setting up an ESP32-S3-DevKitC-1-N8R8 to do the same job.

Has anybody been able to get two instances of OneWire to work?

How?

Any ideas of other things I could try?

Thanks,
JP.
Old controls guy, SW Ontario, Canada .

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: Multiple OneWire DS18B20 Instances?

Postby liaifat85 » Fri Jan 19, 2024 3:19 pm

These links can help you regarding how to connect multiple DS18B20 sensors with one microcontroller.
https://randomnerdtutorials.com/esp32-m ... e-sensors/
https://www.theengineeringprojects.com/ ... duino.html

Who is online

Users browsing this forum: No registered users and 119 guests