Electronics: Using a Logic Level Shifter
electronicshardwareguide
Connecting a 5V sensor (like an Arduino) directly to a 3.3V microcontroller (like an ESP32) can destroy the pins.
1. Bidirectional Shifters
Use a MOSFET-based bidirectional shifter for I2C or SPI. These allow data to flow both ways.
2. Wiring
- Connect
LVto 3.3V. - Connect
HVto 5V. - Connect
GNDto common ground.
3. Signal Pins
Connect your 3.3V signal to the LV1..4 side and your 5V signal to the corresponding HV1..4 side.
4. Testing
Check the voltage on the 'LV' side with a multimeter while sending a signal. It should never exceed 3.3V.