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.

In shortChips 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

5 V to 3.3 V5 V outputDivider 2k / 3.3k or level shifter3.3 V input
5 V to 3.3 V

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

Can output A drive input B?Try it Yourself

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.

SolutionDirectionSpeedNotes
Resistor dividerhigh to low voltage onlyslow signalscheap: 1 kohm and 2 kohm for 5 V to 3.3 V
Level shifter IC (74LVC245, TXS0108)bidirectional or one wayfastproper solution for SPI and parallel
BSS138 MOSFET shifterbidirectional, open drainI2C speedscommon on small modules
74HCT bufferlow to high voltagefastHCT inputs accept 3.3 V as high
5 V tolerant pinsinput from 5 V-check the datasheet pin type: FT in STM32
Careful:The words "5 V tolerant" apply to specific pins only, and only when the chip is powered. Read the pin description in the datasheet before relying on it.

Quick quiz

1. What is the common mistake when connecting 5 V to 3.3 V logic?

2. Which method works for bidirectional I2C level shifting?

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.