Bidirectional 3.3V ⇄ 5V MOSFET Logic Level Shifter Lab — Engineering Notes & Troubleshooting
Need a 3.3V ESP32 or Raspberry Pi to talk cleanly with a 5V Arduino or 5V I2C sensor? A single BSS138 N-MOSFET and two 10 kΩ pull-up resistors automatically translate logic signals in BOTH directions with zero direction-control pin!
Ideal for I2C (100/400 kHz) and UART serial up to 115200 baud. For ultra-fast 800 kHz WS2812B or 10 MHz SPI, use a push-pull 74AHCT125 buffer instead of 10 kΩ pull-up shifters!
- Always power BOTH reference rails: LV connects to 3.3 V, HV connects to 5.0 V, and both GND pins tie together!
- How it works: When LV pulls LOW (0V), V_GS = 3.3V turns the MOSFET ON and pulls HV to 0V. When HV pulls LOW, the MOSFET's internal body diode first pulls LV down until V_GS turns the channel fully ON!
| Symbol | Component | Real-World Engineering Tip |
|---|---|---|
| LVL4 | 4-Channel BSS138 Bidirectional Shifter | Never try to power a 3.3V sensor FROM the LV pin — LV is a voltage reference input, not a 3.3V regulator output! |
Real-World Bench Scenario: Connecting a 5V Arduino Uno to a 3.3V ESP32 over I2C/UART: wire Uno 5V→HV, ESP32 3.3V→LV, tie GND, and bridge SDA/SCL through HV1/LV1 and HV2/LV2!
Bench Challenge: Bidirectional Test: Flip the signal direction (3.3V → 5V vs 5V → 3.3V) and toggle Logic 0/1 to watch the BSS138 MOSFET channel switch ON and OFF!