Connecting 3.3V and 5V electronics

Check power ratings, signal levels and pull-ups before joining modules.

Power supply voltage and GPIO voltage are separate specifications. A development board may accept 5V through USB while its processor still uses 3.3V signals. Likewise, a breakout may accept 5V on a regulated supply input but still expose GPIO whose voltage limits must be checked separately.

For the classic ESP32 DevKit, use 3.3V-compatible signals at GPIO. Never connect a 5V output directly to an ESP32 input. The UNO R3 uses 5V logic, but whether it reliably recognises another board's 3.3V HIGH depends on the specified input thresholds and the interface. Check the actual devices rather than applying a universal rule.

For a one-way, low-speed 5V digital output feeding a high-impedance 3.3V input, a resistor divider can sometimes be suitable. With 10k ohms between the source and input node and 20k ohms between the node and ground, the nominal voltage is 5 x 20 / (10 + 20) = 3.33V. Resistor tolerance, source voltage, input impedance and edge speed still matter. A divider is not a regulated supply and is not a general-purpose bidirectional level shifter.

For I2C, inspect where SDA and SCL pull-ups connect. A 5V-powered breakout with pull-ups to 5V can expose the ESP32 to 5V even if the sensor itself uses an onboard regulator. Use a compatible breakout, safely configure its pull-ups, or use an appropriate I2C level translator. The ESP32 Light Meter keeps the sensor and its bus pull-ups at 3.3V.

Before powering a mixed-voltage circuit, list every supply pin, signal direction and permitted voltage. Confirm the ground reference and avoid tying together unrelated regulated positive supplies. Use a multimeter to check steady voltages when practical; it does not reveal every brief transient or fast waveform.

Reference: consult the datasheet for your exact ESP32 module and sensor breakout. The ESP32 I2C API documentation is at https://docs.espressif.com/projects/arduino-esp32/en/latest/api/i2c.html