Informic Logo
BOM Consolidation
PCBA Build Support
PCB Fabrication
In-stock: aim to dispatch in 3 days

Logic Level Shifters Explained: Choosing Voltage Translation for I2C, SPI, and UART

Logic Level Shifters Explained: Choosing Voltage Translation for I2C, SPI, and UART

Keywords: logic level shifter, I2C level shifter, TXB0104 vs TXS0104, BSS138 level shifter, voltage translation, 3.3V to 5V level shifting

Meta Description: BSS138, TXB, TXS, or direction-controlled? How signal type decides the right level shifter for I2C, SPI, and UART between 3.3V and 5V systems.

Every mixed-voltage design eventually meets the same wall: a 5-volt microcontroller talking to 3.3-volt sensors, or a modern 1.8-volt processor driving legacy 5-volt peripherals. The fix is a logic level shifter, but the catalog hides a crucial fact behind nearly identical part names: different shifter architectures behave completely differently on different buses, and the wrong choice produces unreliable I2C, glitchy SPI, or dead UART lines. The selection logic is simpler than it looks once one question is answered first.

Why Translation Is Needed: Thresholds and Damage

Two failure directions motivate every level shifter. Downward, a 5-volt output can damage or stress a 3.3-volt device whose input is not 5-volt tolerant. Upward, a 3.3-volt output may not register reliably as a logic high on a 5-volt receiver, depending on the receiver's threshold.

The thresholds explain why. TTL-family inputs accept 0 to 0.8 volts as low and 2 to 5 volts as high, while CMOS inputs at 5 volts expect 0 to 1.5 volts low and 3.5 to 5 volts high, so a TTL-style 2.7-volt high falls inside a CMOS input's uncertain region and can be misread. Noise margins quantify the slack: 0.3 and 0.7 volts for TTL low and high, versus roughly 1.45 volts for 5-volt CMOS, and margins shrink at lower supply voltages, which is exactly why the 3.3-volt generation is less forgiving. The classic fixes from the textbook era, a pull-up resistor to raise a marginal TTL high, or an open-collector stage whose high level is set entirely by the receiving side's pull-up rail, are the direct ancestors of today's level-shifter architectures.

Open-Drain Versus Push-Pull: Answer This First

The single most useful selection question is whether the signal is open-drain or push-pull.

Open-drain and open-collector signals, I2C above all, are driven low actively and released high through pull-up resistors. Push-pull signals, SPI clock and data, UART transmit, general-purpose outputs, are actively driven to both rails. The distinction matters because architectures exploit it: a bidirectional shifter built around a MOSFET pass device works naturally on pull-up-defined open-drain buses, where either side may pull the line low, while actively driven push-pull signals with known directions are better served by directional translators that never fight the driver. Identifying each signal's type and direction before choosing hardware prevents most level-shifter failures before they happen.

Signal type Examples Shifting approach
Open-drain, bidirectional I2C SDA and SCL MOSFET pass-device shifter (BSS138 class) or TXS class
Push-pull, fixed direction SPI MOSI, SCK, CS; UART TX Direction-controlled translator, buffer, or divider
Push-pull, either direction Generic GPIO Direction-controlled translator per line
Unknown mixed Shared buses Identify signal behavior first; do not guess

The Discrete MOSFET Method: Simple and Predictable

Four-channel MOSFET logic level converter module wired between boards

The classic circuit uses a single N-channel MOSFET per channel, typically a BSS138, with a pull-up resistor on each voltage side: the gate ties to the low-voltage rail, the source sits on the low-voltage side, the drain on the high side. Either side pulling its node low turns the MOSFET on and pulls the other side low; when released, the pull-ups restore each side to its own rail. No direction pin exists because the signal itself sets the direction. Philips' application note on bidirectional level shifting remains the canonical analysis of this circuit, and the popular four-channel converter modules are exactly this circuit repeated four times with shared rails.

The method's strengths match I2C precisely: bidirectional by construction, predictable, cheap, and forgiving of modest bus capacitance. Its limits are the pull-up's limits: rising edges are soft, set by resistance and capacitance, so the circuit suits open-drain buses at ordinary I2C speeds and modest push-pull rates, but it is too slow and too soft-edged for fast SPI or long wires. It is also purely digital, shifting logic levels, never scaling analog voltages.

Managed Translators: TXB, TXS, and the Auto-Direction Trap

SOT-23 MOSFET and pull-up resistors on a converter channel

Texas Instruments' auto-direction families look interchangeable on page one and differ fundamentally underneath, a trap that has cost real projects real debugging time.

The TXB class actively drives both sides through output stages, sensing direction automatically, and supports fast push-pull signaling, up to 100 megabits per second in its higher-voltage configuration, over supply ranges from 1.2 volts to 5.5 volts. The TXS class instead uses a pass transistor between the sides with weak internal pull-ups and one-shot edge accelerators: drive current comes from the external devices, the architecture is the BSS138 circuit concept plus acceleration, and its sweet spot is open-drain buses such as I2C, with push-pull rates far lower than TXB. The 8-bit TXS0108 pushes acceleration further with dynamic pull-ups and dual one-shots for up to 110 megabits per second, and carries a warning the others lack: its one-shot circuits can retrigger or time out on heavy capacitive loads, producing oscillation and bus contention, a behavior that surfaces in the field as level-shifter boards that work on short wires and fail on even modest cable runs.

Family Architecture Best fit Caution
BSS138 discrete MOSFET plus pull-ups I2C, open-drain Speed limited by pull-ups
TXB class Active drive, auto direction Fast push-pull Cannot tristate individual lines well
TXS class Pass transistor, one-shots Open-drain, I2C One-shot sensitivity to loading
TXS0108 Accelerated 8-bit Short, fast runs Retriggering oscillation risk on capacitance

Direction-Controlled and Single-Supply Translators

When directions are known, the cleanest hardware is a direction-controlled translator: a direction pin set by the designer eliminates the bus-contention risk that auto-direction devices manage statistically. Dual-supply parts in the AVC and LVC classes translate between rails such as 1.2 to 3.6 volts and 1.65 to 5.5 volts respectively, include partial-power-down Ioff protection that isolates ports when either supply collapses, and behave identically on every bus type because direction is never inferred. For unidirectional lines, single-supply translators with overvoltage-tolerant inputs handle down-translation without a second rail, and simple resistor dividers remain a legitimate answer for one-directional, modest-speed UART lines. The LSF family deserves mention as the managed descendant of the MOSFET method: a passive FET switch with external pull-ups translating between nearly any two rails from 1 to 5 volts, bidirectional without a direction pin, on both open-drain and push-pull buses that tolerate pull-up-defined edges.

Choosing by Interface

Two boards at different logic voltages linked through a converter module

Interface Recommended approach Why
I2C between 3.3 V and 5 V BSS138 discrete shifter Open-drain, bidirectional, pull-up-defined highs
Fast SPI with known directions Direction-controlled translator or buffers Push-pull, speed-critical, direction fixed
UART 5 V TX into 3.3 V RX Divider or directional translator One direction needs reduction
UART 3.3 V TX into 5 V RX Often direct, verify threshold Many 5 V inputs accept 3.3 V highs
Mixed unknown bus Identify signal types first Architecture must match signal behavior

The meta-rule holds across every real project: level shifters are selected by signal type, not by channel count or part availability. An 8-channel automatic board that works on one bus and fails on another is not defective; it is mismatched.

Wiring Discipline and Common Mistakes

Level-shifter failures cluster around wiring, not silicon. Both voltage-reference pins must be powered before signals appear, and neither may float. Grounds between voltage domains must be shared unless isolation is intended. I2C pull-ups must rise to a voltage every device on the bus tolerates, and parallel modules often stack several pull-ups that together over-strengthen the bus. Long wires and cable capacitance break edge-accelerated translators first, so leads stay short for TXS-class parts. Disabling redundant external pull-ups on connected modules avoids fighting the shifter's internal ones. And the assumption that a 3.3-volt output always satisfies a 5-volt input threshold is checked, not assumed, because the margin arithmetic says sometimes it does not. Five-volt-tolerant inputs deserve their datasheet read too: tolerance usually applies within a powered device, with limits that change while the device's own supply is absent, a state the Ioff feature in managed translators handles explicitly and a discrete circuit may not. When distances get long or grounds get questionable, the right component is not a level shifter at all but RS-485, CAN, a digital isolator, or an optocoupler.

Frequently Asked Questions

Can I connect a 5V microcontroller directly to a 3.3V sensor?

Only if the sensor's input is specified as 5-volt tolerant, and many are not. A 5-volt output into a non-tolerant 3.3-volt input stresses or damages it. A 3.3-volt output into a 5-volt receiver may work but must be checked against the receiver's input-high threshold, since some inputs require more than 3.3 volts to guarantee a logic high.

Why is a BSS138 MOSFET shifter the default choice for I2C?

I2C is open-drain and bidirectional: devices pull the line low and pull-ups define the high level, which is exactly the circuit the BSS138 shifter implements, with either side able to pull low and each side's pull-up restoring its own rail. It needs no direction pin, scales across bus speeds and capacitance within reason, and behaves predictably, unlike automatic translators whose one-shot edge accelerators can fight bus conditions.

What is the difference between TXB and TXS translators?

TXB devices actively drive both sides with output stages, sensing direction automatically, and suit fast push-pull signaling up to around 100 Mbps. TXS devices use a pass transistor with weak pull-ups and one-shot edge accelerators, with drive current supplied by external devices; they suit open-drain buses like I2C and slower push-pull signals. Same first three letters, completely different architectures.

Why does my automatic level shifter board oscillate or fail on wires?

Most likely a TXS0108-class device: its one-shot edge accelerators can retrigger or time out on capacitive loads from wires, connectors, and bus pull-ups, producing oscillations and bus contention. The vendor documentation itself warns that even ordinary jumper lengths can trigger the behavior on some buses. Keep leads short, match the device to the signal type, or switch to a discrete MOSFET shifter or directional translator.

Do I need a level shifter for UART between 3.3V and 5V devices?

Sometimes not. The 5V-to-3.3V direction needs reduction or a tolerant input; the 3.3V-to-5V direction often works directly because many 5-volt inputs recognize 3.3 volts as high, but this depends on the receiver's threshold. A resistor divider handles the downward direction at modest speeds, and a directional translator handles reliable or faster designs.

What do I check before blaming the level shifter?

Wiring and configuration first: both voltage-reference pins powered and not floating, grounds shared between domains, I2C pull-up voltage safe for every device on the bus, parallel pull-ups from multiple modules accounted for, lead length and bus capacitance within the architecture's tolerance, and each signal's type, open-drain or push-pull, actually matched to the shifter architecture. Level-shifter failures cluster around wiring, not silicon.

Sources and Further Reading

  1. Big Mess o' Wires, "A Tale of Three Bidirectional Level Shifters" (TXB0104 vs TXS0104 vs TXS0108 architectures, one-shot oscillation warning): https://www.bigmessowires.com/2023/08/22/a-tale-of-three-bidirectional-level-shifters
  2. Universal Solder, "BSS138 Level Shifter vs TXS0108E: Choosing the Right Converter" (open-drain versus push-pull selection by interface): https://www.universal-solder.ca/comparison-level-shifter
  3. SparkFun, "Bi-Directional Logic Level Converter Hookup Guide" (MOSFET circuit analysis, hookup for serial, SPI, and I2C): https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all
  4. Texas Instruments, "Good Designs Need the Right Translation" (single-supply, auto-direction, and direction-controlled translator classes, Ioff protection): https://www.ti.com/document-viewer/lit/html/SSZTBY9
  5. All About Circuits textbook, "Logic Signal Voltage Levels" (TTL and CMOS thresholds, noise margins, interfacing mismatches): https://www.allaboutcircuits.com/textbook/digital/chpt-3/logic-signal-voltage-levels

Table of Contents

Translate »

Ask About Component Availability

Send exact part numbers and quantities for review. Availability, lead time and response time will be confirmed individually.