What Pins on the ESP32 can I use for 1Wire Data ?
I cant use any ADC2 Pins because I want to use WiFi while reading my DS18B20 sensors.
I need 4 Pins, because I want to build 4 independent 1Wire networks.
GPIO32 and 33 should work, but I am not sure if for example GPIO 34 and 35 would work too because thy are labled as input only.
Has someone ever tried this ?
Thanks!
There are 1-WireTM Master (driver) chips that connect to the host microcontroller via I2C or UART ...
I Have a total of 120m cable with all sensors combined. That could be too much even for these drivers. I think the safer way is to build multiple networks on different Pins
Maybe you can create 4x software 1-wire using the OneWire library.
Something like that:
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire wire1(GPIO_36);
OneWire wire2(GPIO_39);
OneWire wire3(GPIO_34);
OneWire wire4(GPIO_35);
DallasTemperature sensor1(&wire1);
DallasTemperature sensor2(&wire2);
DallasTemperature sensor3(&wire3);
DallasTemperature sensor4(&wire4);
void setup() {
sensor1.begin();
sensor2.begin();
sensor3.begin();
sensor4.begin();
}
Yes I want to do it that way. But will it work on the Pins you used ?
In that case you probably need the active drive as on those driver chips - rather than the simple port pin drive.
You could still have multiple 1-WireTM networks by using multiple driver chips...
See also:
They speak of "weights" (ie, total length of wires) up to 200m with DS2480B-type drivers
I haven't read the esp-32 doc so I can't tell for sure. Usually GPIOs work fine for about anything.
However, @awneil has a good point. It's possible you won't be able to reach that far.
You should test with one sensor over the long distance and see if you can communicate without a driver chip first.
Can you give me any information on how to use such a master like the ds2480b ?
I cant find any librarys or anything else ![]()
Then you'll have to work from the datasheets.
Again, might be worth asking in the AD forums ...
How did I manage to screw that so hard! ![]()
