Saturday, February 23, 2013

Simple 3.3V–5V level shifter

In present day electronic we find many sensors or modules working in 3.3V logic levels.In other terms LVTTL devices (Low-voltage TTL). But even now we mostly use 5V TTL logic level uC or other devices with them. Hence, we need to change logic levels between 3.3V <---> 5V when interfacing both of them together. There are many dedicated chips for this and there was none available in the country. So I decided to build some simple circuits to do this conversion using transistors. Here,you can use any general purpose  NPN transistors available in your country such as 2N39042SC828,BC547…etc. You need to supply 3.3V & 5V as shown in the schematics as Vcc. This won’t be a problem as you may already have these two power rails in your circuit as you use both for chips as Vcc. I have tested this on my 3.3V Bluetooth module interfaced with 5V PIC16F887.It worked well.

to5

from5

27 comments:

  1. R1 & R5 can be omitted,i just built two NOT gates here in unison to make a buffer

    ReplyDelete
  2. Can anyone explain to me how the 3.3-5V level shifter circuit shown above actually works? Please explain the circuit and how the voltages across the collectors and emitters change and why, thank you

    ReplyDelete
    Replies
    1. It's like this,When input is 0V,Q1 is OFF and Q1's collector will be 5V,then Q2 will be ON, and Q2's collector is at 0V (as Vce of Q2=0)
      When input is 3.3V,Q1 is ON and Q1's collector will be 0V(as Vce of Q1=0),then Q2 will be OFF, and Q2's collector is at 5V,It's simple two NOT gates combined :D

      Delete
    2. How would I connect an Omron G2R-1-E 5V Realy to that circuit?

      Delete
    3. I haven't used that particular relay,You can connect is using a simple transistor relay drive with a transistor,resistor and a diode :D
      This link may help you (check for relay drives)
      http://www.rentron.com/rf_remote_control.htm

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Can this circuit used between arduino due 3.3 v to 5v character lcd ??

    ReplyDelete
    Replies
    1. This should work,I'm using this to inteface my 3.3V Bluetooth module to micro controllers. I have used just some zener diodes for my 3.3V graphic lcd,I'll write about it on next post

      Delete
  5. When input goes low, Q1 should turn off and its collector voltage should increase. I observe this behavior, but with an issue: it takes a long time for Q1 to turn off (but it turns on rapidly).
    This limits its use to 1MHz....any solution ? Why is that ?
    Thanks.

    ReplyDelete
    Replies
    1. I didn't use this in such speeds,may be you need a faster switching transistor then,Those data will be on the transistor datasheet :D

      Delete
    2. You need to add pull down resistor at the base circuit. Just add 10k ohms to the ground.

      Delete
  6. Stick a resistor between the base of the input transistor Q3 and ground, this will speed up the turn off of this transistor, that is what is limiting the switching speed. Use a 1K resistor as this is what you are using everywhere else.

    ReplyDelete
    Replies
    1. Sorry I meant Q1 transistor.

      Delete
    2. Thanks for the idea :D It gives the "pull down" to Q1,should speed up :)

      Delete
  7. Hello all , I have to code a level converter In verilog and implement it in FPGA and show the output..!! Please it's my assignment and I hand to finishit asap.. !! please someone reply if you have any brief idea about that

    ReplyDelete
  8. I have a proteus file in this regard..! how can I upload it here?!

    ReplyDelete
  9. This isn't working as a level shifter its working as voltage regulator

    ReplyDelete
  10. In the first pic,, When Q2 is OFF, the output is available after the 1.5k resistor. but how that will be equal to 5v being your Vcc is 5v and there's a presence of 1.5k before the output.

    ReplyDelete
  11. You're correct, but depending on the input impedance of the load, it will be close.
    The 1.5K will form a voltage divide with the load impedance.

    ReplyDelete
  12. These are nice and simple circuits but they do have a down side.
    They have quite high current consumption.
    Circuit 1 will consume 3mA and circuit 2, 7mA when at logic level zero/low.

    ReplyDelete
  13. Thank you very much for your comments. I built these are these was no alternative to buy in local market

    ReplyDelete
  14. Testing it with M590 GSM Modem and Arduino and seems to work also whithout R1 and R5 Thanks a lot !

    ReplyDelete
  15. FOR HIGHER SPEED YOU CAN USE MOSFET

    ReplyDelete