Level shifting is the process of converting a digital signal from one voltage to another so that two devices running at different voltages can communicate safely. A 3.3V microcontroller talking to a 5V sensor, for example, needs a level shifter between them to translate the signal voltages each device expects. Without it, you risk damaged components, corrupted data, or a circuit that simply doesn’t work.
Why Different Voltages Exist
For years, 5V was the standard operating voltage for most microcontrollers and digital logic. That’s changed. Newer chips frequently run at 3.3V, and some operate as low as 1.7V. The sensors, displays, and other peripherals you connect to those chips have followed the same trend, but not in lockstep. You’ll regularly encounter projects where a 3.3V board like a Raspberry Pi needs to talk to a 5V device like an older Arduino, or where a modern low-power sensor needs to feed data into a legacy 5V system.
The core problem is simple: a device expecting 3.3V logic treats anything near 5V as dangerously high, potentially frying its input pins. Going the other direction, a 5V device might not recognize a 3.3V signal as a valid “high” at all, reading it as noise or an indeterminate state. Level shifting solves both problems by translating signals up or down to match what each side expects.
How a Basic Level Shifter Works
The simplest and most common level shifting circuit uses a single MOSFET transistor and two pull-up resistors. One resistor connects to the lower voltage supply (say 3.3V), and the other connects to the higher voltage supply (5V). The MOSFET sits between the two sides and acts as a gate that opens or closes depending on the signal.
When neither side is sending a signal, both pull-up resistors hold their respective lines high: 3.3V on the low side, 5V on the high side. The MOSFET stays off because there’s no voltage difference across it. When the low-voltage side pulls its line down to 0V, the MOSFET turns on, which also pulls the high-voltage side down to 0V. Both sides now read a logic low. When the high-voltage side pulls down instead, current flows through a built-in diode inside the MOSFET, pulling the low-voltage side down too.
This single-transistor design is popular for hobby projects and prototyping because it’s cheap, uses minimal parts, and handles bidirectional communication. It does invert timing slightly and isn’t ideal for very high-speed signals, but for many applications it works perfectly.
Unidirectional vs. Bidirectional Shifters
Level shifters come in two broad categories based on which direction signals need to travel.
Unidirectional shifters move signals in one direction only, either stepping voltage up or stepping it down. They’re straightforward to build and manage because there’s no ambiguity about which side is sending and which is receiving. If you have a sensor that only outputs data to a microcontroller, a unidirectional shifter is all you need. The trade-off is obvious: they can’t handle communication protocols where both devices need to send and receive on the same wire.
Bidirectional shifters handle signals flowing in both directions. These come in several flavors of increasing complexity:
- Dedicated-port designs use an external control signal to determine which direction data flows at any given moment. This gives precise control but requires an extra pin and can introduce small delays when switching direction.
- Direction-indicator designs use special ports to figure out the direction automatically, reducing switching delays but adding internal complexity.
- Auto-sensing designs detect which side is actively driving the line and adjust on the fly. These are the most flexible and easiest to use, but their internal logic is the most complex, and they can occasionally behave unpredictably in edge cases.
Auto-sensing bidirectional shifters are specifically designed with weaker output drivers so that either side of the bus can easily override them. This makes them a natural fit for communication protocols like I2C, where both the controller and peripheral share the same data line.
Common Communication Protocols
The type of level shifter you need depends heavily on which communication protocol your devices use.
I2C
I2C is a two-wire protocol where both the clock and data lines are bidirectional, with devices pulling lines low to communicate. This makes auto-sensing bidirectional shifters the standard choice. These shifters typically include integrated pull-up resistors. The key constraint is capacitive loading: keeping the total capacitance on each bus side below about 70 picofarads ensures clean signal edges at the rated data speeds. Longer traces and extra connectors add parasitic capacitance that can slow down signal transitions and cause communication errors, so keeping your wiring short matters.
SPI
SPI uses separate lines for sending and receiving, so each individual line only carries data in one direction. This means you can use unidirectional shifters, but the devices need stronger output buffers than what auto-sensing shifters provide. The main concern with SPI level shifting is speed. Rise and fall times get slower in direct proportion to how much capacitive load sits on the line. Feeding a level shifter a signal that transitions too slowly can cause false triggering, where the shifter misreads a gradual voltage change as multiple rapid switches.
Signal Integrity Pitfalls
A level shifter that technically works at low speeds can fall apart as your data rate climbs. The most common problems come down to how quickly signals transition between high and low states.
Every wire, connector, and component on a circuit board adds a tiny amount of capacitance. That capacitance acts like a small bucket that needs to fill and drain with each signal transition, rounding off the sharp edges of your square waves. At low speeds this barely matters, but at higher data rates those rounded edges start eating into the time window where the receiving device samples the signal. The result is corrupted data or missed communications entirely.
Trace length creates a second issue: reflections. A signal traveling down a long trace can bounce back from the far end. If that reflected signal arrives back at the shifter within about 10 to 30 nanoseconds, it can interfere with the shifter’s internal timing and produce glitches on the output. The practical fix is straightforward: keep traces short, minimize the number of connectors between the shifter and the devices, and stay within the capacitive loading limits listed on the shifter’s datasheet.
Choosing the Right Approach
For simple projects connecting a 3.3V microcontroller to a 5V peripheral, a MOSFET-based circuit with a couple of resistors is often all you need. It’s inexpensive, easy to solder, and works well for signals up to a few hundred kilohertz.
For faster or more complex systems, dedicated level-shifting ICs are a better choice. These come pre-designed for specific protocols and voltage ranges, with internal pull-up or pull-down resistors and output drivers matched to the protocol’s requirements. When selecting one, the key questions are: does the signal need to travel in one direction or both, what voltage ranges are involved, how fast the data rate is, and how much capacitance your board layout adds to the lines.
Breakout boards with level-shifting ICs already mounted are widely available for prototyping. These typically handle four or eight channels and support common voltage pairs like 3.3V to 5V or 1.8V to 3.3V, making them a drop-in solution when you’re building on a breadboard or testing a design before committing to a custom PCB.

