logic level converter/Why you need one/01. Two voltages, one wire
Why you need one · 01 of 11

Two voltages, one wire

A wire does not carry a 1 or a 0. It carries a voltage, and the chip at the far end decides what that voltage means. A 3.3 V board and a 5 V part decide differently, and one of the two mismatches quietly damages a pin.

A HIGH is a voltage

Digital pins deal in two states, HIGH and LOW. On the wire those are voltages: LOW is close to 0 V, and HIGH is close to the chip's own supply. An ESP32's HIGH is 3.3 V. An Arduino Uno's is 5 V.

The receiving pin decides what counts as what. Pick a sender and a receiver:

The receiving pin decides what counts as HIGH
5 V → ESP32 (3.3 V)
Sending board
Receiving pin
Sender's HIGH
5.0 V
Counts as HIGH from
2.5 V
Pin can take
3.6 V
This one hurts the pin. 5.0 V is past the 3.6 V the receiving pin is built for. It may keep working for weeks, which is why people think it is fine. It is not. Put a converter between them.

Two results matter. 3.3 V into an Uno works, with a little to spare. 5 V into an ESP32 goes past the most its pin can take.

Where the extra voltage goes

A pin does not simply "get too much voltage". Every input has a small protection diode connected to its chip's supply. Once the pin is more than a little above 3.3 V, that diode starts to conduct.

What a 5 V signal does inside a 3.3 V chip
wired straight
Between them
Voltage at the pin
0.0 V
Pin is rated to
3.6 V
Current into the rail
none
The pin does not pop. It leaks. Once the pin is a little above 3.3 V, the protection diode starts conducting, and the 5 V part pushes current through it into the chip’s own supply. A tiny diode carrying current it was never meant to carry is how a board works for a month and then gets flaky.

From then on, the 5 V part is pushing current into the 3.3 V board's supply through a part the size of a grain of dust. Nothing smokes. The pin works for a while, then gets unreliable, and by then nobody remembers the wiring.

When you need a converter

  • Anything 5 V sending towards a 3.3 V board. Always, even one wire.
  • A shared bus with a 5 V part on it, such as I²C. The 5 V side's pull-up resistors hold the wire at 5 V whenever it is idle, so the 3.3 V board sees 5 V without anyone sending anything.
  • A 5 V part that wants more than 3.3 V to see a HIGH. A WS2812 LED strip is the common one.

If the part is happy on 3.3 V, power it from 3.3 V instead. Then there is nothing to convert.

When it does not work

My 5 V sensor has been wired straight to my ESP32 for weeks and it works

That is the normal way this goes wrong, not proof that it is fine. The protection diode on the pin carries current every moment the sensor outputs a HIGH, and pins that have done that for a while tend to fail later and intermittently. Put a converter in now. If the pin already behaves oddly, move the wire to a different GPIO.

I do not know whether my module is 3.3 V or 5 V

Look at what powers it. A module's signal pins normally swing between 0 V and whatever its VCC pin is fed. Many modules sold as 5 V run happily on 3.3 V — if its own page says so, power it from 3V3 and there is nothing to convert.

My Arduino Uno reads the ESP32's 3.3 V signals without a converter

Expected. An Uno counts anything above about 3.0 V as HIGH, so 3.3 V gets through with 0.3 V to spare, and nothing is harmed. A converter only makes that small margin certain. The direction that needs one is the Uno sending back.

My LED strip flickers on a 3.3 V pin but everything else is fine

A WS2812 strip on 5 V wants its data at 3.5 V or more, so a 3.3 V pin is in the grey zone. It is the one common 5 V part that misreads 3.3 V. An LED strip from a 3.3 V pin covers the fix.

Where this goes next

Two supplies in, the same signal out at a different height, in either direction.

What a converter does

Edit this page — content/books/llc/two-voltages-one-wire.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum