Logic Level Shifting Using Uni-Directional & Bi-Directional Level Shifters

Consider the microcontrollers, sensors, and communications modules that you work with when building a project. Some boards, like the Arduino Uno and Nano, operate at 5V, while others operate at 3.3V, like the Arduino MKR WIFI 1010, the ESP8266-based Wemos D1 Mini, and one variation of the Pro Micro.

The HC-05 Bluetooth module, for example, operates at 3.3V, but many sensors can operate at either 5V or 3.3V. Voltage dividers can be helpful when you need to mix signal types, but what if you'd like a component to shift things around in a more elegant manner? The answer, of course, is the aptly named level shifter.

What Does a Level Shifter Do?

A level shifter translates logic signals from one level to another. Usually, this shift takes place between 5V and 3.3V, but you can use other voltages as needed, such as 2.5V or 1.8V. Important specs to look for include:

- How much the shift may introduce time delay.

- What voltages are available.

- Whether shifts take place in one direction or are bi-directional, allowing signals to travel back and forth as needed.

Let's discuss a few shift dividers you might consider in your future designs or experiments.

Uni-Directional Level Shifting with the 74LVC245

One basic level-shifter is the 74LVC245 chip from Texas Instruments. This shifter can convert logic levels from inputs up to 5.5V down to between 3.6V and 1.65V, depending on the Voltage (VCC) powering the device. The direction-control (DIR) pin selects the shift's direction from one or more of the eight A or B input or output pins to its counterpart on the other side of the chip.

You can see this setup in the image below, where 5V powers a sensor module. The output in blue feeds to the A3 pin, which then passes to pin B3, set at a 3.3V level. Two important items to note:

1. The 3.3V supplied from the Wemos D1 mini board to the chip's VCC pinout dictates the output level and could theoretically be as low as 1.65V, depending on the needs of your circuit.

2. The output-enable (OE) pin is pulled to ground, while the DIR pin is connected to VCC, allowing shifts to occur from A to B pins.

Level shifter_IMAGE 1

74LVC245 in action

The shifter converts the 5V output from the sensor to a 3.3V signal to the Wemos board, causing the LED to light up in response (per a simple example program), while averting the danger of frying things from non-approved voltage levels. As noted on its datasheet, 3.3V or 5V devices can drive inputs, allowing it to resolve a mixed signal environment into a consistent output voltage. This particular chip only passes signals one way — or one way at a time depending on the state of the DIR pin — so if you need translation in both directions simultaneously, you'll want a different solution.

Bi-Directional Level Shifting

You have several shifter options when you need data to travel back and forth between different voltage levels. One such device is the TI TXB0108 chip. This shifter features banks of both A and B voltage level pins, similar to the 74LVC245. However, the TXB0108 doesn't have a DIR pin, as each input and output can detect and shift signals in either direction independently and automatically.

An OE pin is available to enable or stop data transmission, and VCCA and VCCB pins specify the voltage levels of both input and output banks. Notably, VCCA's maximum recommended voltage is 3.6V, while VCCB is 5.5V. Finally, VCCA is not designed to exceed VCCB.

Level shifter_IMAGE 2

BSS138 breakout subbed in for 74LVC245. Note object in sensor activating Wemos D1 mini ESP8266 board through this breakout.

While the TXB0108 is great for many applications, it doesn't work well with I2C, which uses an unusual pull-up arrangement to transfer data back and forth. For this specific job, you might instead turn to Adafruit's BSS138 MOSFET breakout with 10K pull-ups. The board features four bi-directional data lines, and unlike the other two shifters on this list that top out a little over 5V, this one can work with 10V on the high side. While most traditional level shifter applications wouldn't call for 10V, it's something to keep in mind for that oddball project that might not mesh well with the more "normal" components you have in your toolbox.

Level Shifters: Helping Components Work Together

While it would be great if every component played nicely with every other device without accommodations, level shifting is necessary for many situations. Whether this means a simple voltage divider or one of the more refined solutions, accommodating different signal level needs into your design is possible, though it may require an extra component or two.

Neue Beiträge

Leider ergab Ihre Suche kein Ergebnis

Aktuelles über Elektronikkomponenten­

Wir haben unsere Datenschutzbestimmungen aktualisiert. Bitte nehmen Sie sich einen Moment Zeit, diese Änderungen zu überprüfen. Mit einem Klick auf "Ich stimme zu", stimmen Sie den Datenschutz- und Nutzungsbedingungen von Arrow Electronics zu.

Wir verwenden Cookies, um den Anwendernutzen zu vergrößern und unsere Webseite zu optimieren. Mehr über Cookies und wie man sie abschaltet finden Sie hier. Cookies und tracking Technologien können für Marketingzwecke verwendet werden.
Durch Klicken von „RICHTLINIEN AKZEPTIEREN“ stimmen Sie der Verwendung von Cookies auf Ihrem Endgerät und der Verwendung von tracking Technologien zu. Klicken Sie auf „MEHR INFORMATIONEN“ unten für mehr Informationen und Anleitungen wie man Cookies und tracking Technologien abschaltet. Das Akzeptieren von Cookies und tracking Technologien ist zwar freiwillig, das Blockieren kann aber eine korrekte Ausführung unserer Website verhindern, und bestimmte Werbung könnte für Sie weniger relevant sein.
Ihr Datenschutz ist uns wichtig. Lesen Sie mehr über unsere Datenschutzrichtlinien hier.