3.3V vs 5V: can I connect this sensor/module to my board?
There are two separate questions you must answer:
- Power voltage: what voltage the module is powered from (VCC)
- Logic level: what voltage the signal pins use (DATA, SDA/SCL, TX/RX)
Arduino (classic) vs ESP32 basics
- Many Arduinos use 5V logic (Uno, Nano, Mega).
- ESP32 uses 3.3V logic.
A 5V signal into an ESP32 GPIO pin can damage it. Always confirm the signal voltage.
When it is usually safe
- I2C sensors labeled 3.3V to 5V are often safe because the module includes level shifting or pull-ups designed for both.
- Analog sensors can be safe if the output stays within the board's ADC range.
When you need a level shifter
- ESP32 reading a 5V UART TX signal (use a divider or level shifter).
- ESP32 driving a 5V device that expects 5V logic (often still works, but not guaranteed).
Quick checklist
- Share a common ground (GND to GND).
- Read the module specs for VCC range and logic level.
- If uncertain, assume the ESP32 needs 3.3V-safe signals.
Bottom line
Do not mix 5V signals into ESP32 pins. Treat power and logic as separate. If the module is not explicitly 3.3V-safe, use a level shifter or choose a 3.3V version.
Related: Arduino vs ESP32: What's the difference? · What are I2C, SPI, and UART, and which one should I use? · How do I use external power safely?