Logic Levels: 5 V and 3.3 V Together: the short answer
Each chip decides what counts as HIGH and LOW from its own supply. 6 × VCC) as HIGH.
- Level
- Intermediate
- Time
- About 6 min
- Topic
- Digital logic
Connect 5 V and 3.3 V parts safely and know when you need a level shifter.
Before this: Digital Inputs and Outputs, Resistor Networks & Loading
Each chip decides what counts as HIGH and LOW from its own supply. A 5 V Arduino Uno treats anything above about 3.0 V (0.6 × VCC) as HIGH. An ESP32 or Raspberry Pi Pico runs at 3.3 V, outputs about 3.3 V for HIGH, and its pins are not designed for 5 V.
Going from 3.3 V to 5 V: a 3.3 V output is often enough for a 5 V input, since 3.3 V is above the Uno's 3.0 V threshold, but the margin is small. Check the datasheet value VIH for the input you drive. Going from 5 V to 3.3 V is the dangerous direction: a 5 V output into an ESP32 pin pushes current through its protection diodes and can damage it over time. Use a voltage divider (for example 1 kΩ over 2 kΩ gives 3.3 V from 5 V) for one-way signals, or a bidirectional level shifter module for I²C.
Many sensor modules have their own regulator and pull-up resistors. A module powered at 5 V may pull its I²C lines up to 5 V, so check the pull-ups (or measure SDA with nothing connected) before wiring it to a 3.3 V board.
Read the thresholds, not the supply voltage
A chip decides high or low by comparing the input with thresholds on its datasheet: VIH, the lowest voltage read as high, and VIL, the highest read as low. A 5 V Arduino Uno reads about 3 V or more as high, so a 3.3 V output can often drive it. Going the other way, a 5 V output into a 3.3 V-only pin can exceed the input's limit and damage it.
The ESP32 and the Raspberry Pi are 3.3 V devices. Their pins are not 5 V tolerant.
Ways to go from 5 V down to 3.3 V
For a slow one-way signal, a divider of two resistors, for example 1 kΩ and 2 kΩ, gives about 3.3 V from 5 V. It is slow with long cables or fast signals. A level shifter module with MOSFETs is the standard answer for I²C, which is bidirectional. A dedicated buffer such as the 74LVC series, powered from 3.3 V, accepts 5 V inputs and gives clean 3.3 V outputs for fast signals like SPI.
Going up from 3.3 V
Some 5 V parts need a higher high level than 3.3 V provides. A WS2812 LED strip on 5 V wants about 3.5 V or more on its data line, so a 3.3 V controller can be marginal. A level shifter or a buffer on the data line fixes it. Always check the high threshold of the receiving chip.
- Connecting a 5 V module output directly to an ESP32 or Pi pin.
- Using a resistor divider on a fast or bidirectional signal.
- Assuming 3.3 V is always enough to be read as high by a 5 V part.
- NMH = VOH(min) − VIH(min)
- high noise margin
- NML = VIL(max) − VOL(max)
- low noise margin
Work it with your own numbers: Logic level margins
Practise this lesson with Maker
The explanation above is free for everyone. The practice for Intermediate lessons in every domain are part of the Maker plan at ₹499 a month, and Pro includes them too.
With Maker you also get: a worked example, a hands-on task, a 3-question check.
