Hello,
I migrating an old Arduino project to ESP32S, this concurrently uses 5V sensors for everything. I wonder if these sensors can be all hooked up or need TTL conversion, here is the list:
1, HC-SR04 Ultrasonic Sensor, According to this tutorial this sensor can be hooked up no problem to the ESP32s:
https://randomnerdtutorials.com/esp32-h ... c-arduino/
The sensor itself needs to be operated from 5V otherwise it malfunctions. The thing about these sensors is when you operate them from 5V there will be 5V on their digital pin as well if I connect it to the ESP32 then the voltage goes down to 3.3V level, I'm not sure that regardless what that guide claims connecting this is healthy for the micro...
2, Regular 4 channel relay boards, again these have to be operated from 5V otherwise the relays can be flaky (don't always pull in or don't pull in at all) however this does not put high voltage on the pins as it's opto isolated
3, Rain droplet sensors: https://esp32io.com/tutorials/esp32-rain-sensor
Again the article claims it can be connected directly to the micro but I noticed the same thing if you operate these from 5V there will be 5V on the digital pins
The bottom line is: is connecting 5V to the regular analog/digital pins of the ESP32s3 damages the device any way or it can handle it?
Thanks for the guidance
Interfacing the ESP32S3 with some 5V sensors
-
- Posts: 1
- Joined: Sun Aug 04, 2024 7:52 pm
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: Interfacing the ESP32S3 with some 5V sensors
In theory: no. The datasheet clearly specifies the limits of what is acceptable on its IO pins; anything outside of that range might have unspecified effects.
In practice: Generally the IOs of an ESP32 are pretty sturdy. If you limit the current going into them (by putting an 10K series resistor between the sensor and IO pin) they will likely happily survive for a long time. It's not something I'd recommend for a production device, but if you're building an one-off and are around to service it if needed, it probably won't hurt.
In practice: Generally the IOs of an ESP32 are pretty sturdy. If you limit the current going into them (by putting an 10K series resistor between the sensor and IO pin) they will likely happily survive for a long time. It's not something I'd recommend for a production device, but if you're building an one-off and are around to service it if needed, it probably won't hurt.
-
- Posts: 1688
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Interfacing the ESP32S3 with some 5V sensors
If you're hooking up a 10k resistor between a 5V-output and the ESP's input anyway you can also add another 20k between the input and GND and be within specs
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: Interfacing the ESP32S3 with some 5V sensors
That is true.
Who is online
Users browsing this forum: No registered users and 43 guests