Taking Electronics To A Different Level

A circuit diagram in a book on a desk with computers and microcontrollers

One part wants 3.3V logic. Another wants 5V. What do you do? Over on the [Playduino] YouTube channel, there’s a recent video running us through a not-so-recent concern: various approaches to level-shifting.

In the video, the specific voltage domains of 3.3 volts and 5 volts are given, but you can apply the same principles to other voltage domains, such as 1.8 volts, 2.5 volts, or nearly any two levels. Various approaches are discussed depending on whether you are interfacing 5 V to 3.3 V or 3.3 V to 5 V.

The first way to convert 5 V into 3.3 V is to use a voltage divider, made from two resistors. This is a balancing act: if the resistors are too small, the circuit wastes power; if they are too large, they inhibit fast signals.

The second approach to converting 5 V into 3.3 V is to use a bare resistor of at least 10K. This is a controversial approach, but it may work in your situation. The trick is to rely on the voltage drop across the series resistor to either drop enough voltage or limit the current flowing through input protection diodes, which will clamp the voltage but also burn out with too much current flow.

The third approach to converting 5 V into 3.3 V is to use chips from the 74AHC series or 74LVC series, such as inverting or non-inverting buffers. These chips can do the level shifting for you.

The easiest approach for going in the other direction is to simply connect them directly and hope you get lucky! Needless to say, this approach is fraught with peril.

The second approach for converting 3.3 V into 5 V is to make your own inverting or non-inverting buffer using, in this case, an N-channel Enhancement-mode MOSFET. Use one MOSFET for an inverting buffer and two MOSFETs for a non-inverting buffer. Just make sure you pick N-MOSFETs with 3.3 V or 5 V gate drive voltage VGS. Alternatively, you can use a buffer from the 74HCT series.

The video provides a myriad of approaches to level shifting, but you still have to decide. Do you have a favorite approach that wasn’t listed? Have you had good or bad luck with any of the approaches? Let us know in the comments! For more info on level shifting, including things to watch out for, check out When Your Level Shifter Is Too Smart To Function.

9 thoughts on “Taking Electronics To A Different Level

      1. Glad to see it was covered. I only read your description :)

        It works really well if you get the BSS138 in a dual package and use r packs. You can make a 4 channel level shifter from 4 parts. (like I did here https://github.com/Ccecil/3v3-5v-LevelShifter ).

        I stole the dual package idea from the “Arduino nano every” which I was tapping into the RX/TX lines on. They use this setup between the usb MCU and main MCU. Except they don’t use rpacks.

  1. Zener diode! As long as going from higher to lower voltage. That’s a hack I’ve used in flashlight drivers like in the case of a tiny13 which wants absolutely no more than 6V, but with a supply of 2S/8.4V 18650s. Works fine on mechanical switch lights that physically break the circuit when off, not so great for momentary switch where power is applied 24/7.

      1. Well, thankfully I don’t need to deal with any more resume-related garbage for however much longer I’ll be around, but. If it doesn’t explode or burn up, and the single cell driver works reliably for years and years with 2S input & 6V LED, what’s the problem? It’s a hack. Is there some other definition of that word being used here?

  2. As long as speed is not important, you can use resistive voltage dividers, opamps or whatever, but if you want both a decent speed, and keep it affordable then the “old” logic families are still interesting.

    Some examples:
    3V3 uC output to LS ttl IC has some extra beef for line driver (stepper motor optocouplers)
    3V3 uC output to HCT logic for “general purpose 5V outputs.

    With 5V to 3V3. I think the good old LS logic is mostly suitable, but you’d have to check the I/O levels. Some 10 to 30 years ago it was quite common to have some tables on hand for voltage levels of different logic families and in which ways they can be combined.

    You can of course also use specifically designed “logic converter” IC’s. But they cost money and take up PCB space. If a circuit can be designed by using a few IC’s of some (old fashioned) logic family, then both the conversion and some extra function can often be done with one IC. (“bytewide” or shift register, etc).

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.