Can connecting a 5V device without level shifting cause these errors?

I'm integrating industrial sensors with AWS IoT Core using ESP32, configuring MQTT communication to send sensor data to the cloud. The 5V TTL serial device is a temperature sensor using RS232 protocol. When connecting it directly to the ESP32's 3.3V UART pins, I notice occasional garbage values in received data through serial monitoring tools. This caused incorrect sensor readings to be sent to the cloud, resulting in inaccurate IoT analytics. To troubleshoot, I've observed the garbage values using a serial terminal and scope measurements. I haven't tried reducing the baud rate yet, but I have verified the issue persists across multiple cloud connections. Can connecting a 5V device without level shifting cause these errors?
3 Replies
UC GEE
UC GEE6d ago
Hey @Daniel kalu Connecting a 5V TTL device directly to the ESP32's 3.3V UART pins in your project without level shifting can indeed cause errors like garbage values in the received data. The ESP32's GPIO pins does not tolerate 5V; exceeding of the maximum input voltage in your project can lead to incorrect readings or even damage the microcontroller over time. For reliable communication, I will advise you to use a level shifter or a dedicated RS-232 to TTL converter to ensure proper voltage levels and protect the ESP32.
Marvee Amasi
Marvee Amasi6d ago
Can connecting a 5v device without level shifting cause these errors .. yes it really can. I know that ESP32's UART pins are designed for 3.3V logic levels. So as you connected a 5V TTL device directly, the higher voltage was what caused signal integrity issues that you are facing. You should stop doing such cus over time your ESP32 pins will damage. The 5V signal is outside the ESP32's safe input range, causing the garbage values.
Daniel kalu
Daniel kalu6d ago
To resolve garbage values, I'll implement a level shifter or dedicated RS-232 to TTL converter. Thanks for the help 👏🏼
Want results from more Discord servers?
Add your server