Home / Learn Chip Programming / Logic Families, Voltage Levels and Level Shifting
Logic Families, Voltage Levels and Level Shifting
Chips with different supply voltages must agree on what counts as 0 and 1. This lesson shows how to connect 5 V and 3.3 V parts safely.
Theory in plain words
What it is
Each family defines input and output voltage thresholds: VIL, VIH, VOL, VOH. A connection works only if the output levels satisfy the input thresholds with margin.
Why we use it
Connecting a 5 V output to a 3.3 V only input can destroy the input. A 3.3 V output may not reach VIH of a 5 V TTL input. Level shifters solve this.
How it works
Compare VOH(out) >= VIH(in) and VOL(out) <= VIL(in). Check the absolute maximum input of the receiver. Use a resistor divider (slow signals), a level shifter IC (74LVC245, TXB0108) or an open drain with pull-ups (I2C).
Where it is used
- Mixing Arduino (5 V) with ESP32 or sensors (3.3 V)
- Interfacing old TTL with modern CMOS
- I2C bus with different voltages
Compatibility checker
Try 5 V CMOS to 3.3 V CMOS: the first two rows say yes but the safety row says no. That is the classic mistake that kills 3.3 V pins.
| Solution | Direction | Speed | Notes |
|---|---|---|---|
| Resistor divider | high to low voltage only | slow signals | cheap: 1 kohm and 2 kohm for 5 V to 3.3 V |
| Level shifter IC (74LVC245, TXS0108) | bidirectional or one way | fast | proper solution for SPI and parallel |
| BSS138 MOSFET shifter | bidirectional, open drain | I2C speeds | common on small modules |
| 74HCT buffer | low to high voltage | fast | HCT inputs accept 3.3 V as high |
| 5 V tolerant pins | input from 5 V | - | check the datasheet pin type: FT in STM32 |
Quick quiz
1. What is the common mistake when connecting 5 V to 3.3 V logic?
It can damage the 3.3 V input.
2. Which method works for bidirectional I2C level shifting?
MOSFET open-drain shifters handle both directions.
Common questions
What is the common mistake when connecting 5 V to 3.3 V logic?
Applying 5 V to an input rated for 3.6 V max. It can damage the 3.3 V input.
Which method works for bidirectional I2C level shifting?
BSS138 MOSFET shifter. MOSFET open-drain shifters handle both directions.