Forum Controllers/PLC

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Connecting DS18B20 temperature sensor to 10 I/Os Digital Module CPU ESP32

Avatar
MFL Group s.r.o.

I'm trying to connect DS18B20 sensor to 10 I/Os Digital Module CPU ESP32. I thought that I can use for that purpose SCL and SDA pins which seems to be internally connected to ESP32 SCL and SDA GPIO pins (GPIO22, GPIO21), but reading temperature using that pins is not working.


Also SCL and SDA pins on ESP32 should be usable as normal input or output, but when I try to set one of those as output and turn it on and off in some interval (blink) there is still HIGH signal on given pin.


Can I use that pins for this purpose?

Or am I using them wrongly?

Is there better way to connect 1-wire sensor?

Avatar
Discard
1 Answer
0
Best Answer

It should be possible to use the I2C pins as 1-wire. Which code are you trying to use for both the blinking test and the DS18B20 readings?

You could also try this example, see if it works: https://www.industrialshields.com/blog/arduino-industrial-1/how-to-control-temperature-with-dallas-ds18b20-sensor-and-arduino-plc-2

Avatar
Discard