5v to 3.3v Logic Level Shifting Made Simple

When I first started playing around with electronics I was like the other 90% of people to do so.  I started by playing around with micro controllers and other simple items.  And while I had no idea what I was really doing for a long time, there was one thing I learned very early on.  And that is that level shifting is not only often a requirement, but is often confusing to the beginner.

Often a beginner needs to create a 3.3v signal from a 5v signal.  Ok, so you use a voltage divider.  No problem.  But what if you need to create a 5v signal from a 3.3v signal?  Well, then you get dozens of homebrewed circuits often times taking 2-4 resistors, a diode or more, or maybe transistors to invert logic.  It gets confusing.  And for someone needing to learn the basics, that is not a good thing.

Even after I had learned a lot about electronics I still struggled with what the best way to convert between voltage levels was.  90% of what I needed to do was based on 3.3v and 5v logic.  So I knew that I could narrow down my requirements to being simple, requiring very few components, and being easy to understand.  And that is when I discovered the 74LS07 IC.

The 74LS07 is an Open Collector Buffer.  Meaning that the buffer’s output has two logic levels.  And that is not 1 and 0.  No, instead it is High-Z or 0.  Meaning that it’s out put is either high impedance (meaning not connected to anything), or it is equal to ground.  What that means is that we can use a pull-up resistor to tie the output to whatever level it is that we want within the specifications of the part.  See the truth table here:

Great, so we can easily convert to 3.3v from 5v, but we still have to convert from 5v to 3.3v!  Well, that is taken care of in this design as well.  You see, the inputs on the LS07 accept input levels as low as 2v!!!  Thats right 2v inputs are able to activate the output!!!  Check out the recommended specs, here:

So that means that we can reverse the design to create a 3.3v signal from a 5v signal.  See the examples below.

Now, how does this work?  Well take a look at Texas Instrument’s Official circuit for each of the 6 buffers in a 74LS07.

Let me guess, if you’re a beginner you don’t understand what is going on, right?  Well, lets simplify this for you (keep in mind, this is just to give you an idea of what is essentially happening).

You see, a PNP transistor such as this would only “turn on” when the input is not receiving any current.  So, we can think of this for demonstration purposes as 0v.  And we can think of it as 5v when the transistor is “turned off”.  So when the input is at 5v, the out put is Hi-Z (or left floating if you will).  When the input is at 0v, the output shorts to ground through the transistor making the output 0v.

So by using a pullup resistor to bring the output to the desired output, we have now crafted a level shifter.  And per the datasheet, we can have output voltages as high as 30v!  I’m not sure what the maximum input voltage level is, as it is outside of what my needs are.  And I’m too lazy to look at the datasheet.  But I’m guessing it is a little above VCC at the minimum.

The simple use of this one IC and a few resistors completely takes care of most peoples needs for logic shifting!

But why use this rather than voltage dividers and the diode circuits?  Well, that is an easy question to answer.  Most of those circuits are SLOW.  And by that I mean that the rise and falling edges of the signal may work for some applications when they will not even come close to others.  Not to mention they can become inefficient and consume quite a bit of current.  But since this circuit is purpose built, the power consumption is lowered. And with the use of low value resistors we can increase the spead of the rise time of the signal (the falling edge speed is essentially TTL speed).

That means we have a circuit that uses less power, is faster, and uses less parts than the other options.  Sounds like a win/win to me.

Leave a Reply

Your email address will not be published. Required fields are marked *