2.8V to 5V Level Shifter problem

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey,so I was using the following circuit(picture attached) for level shifting my GPS 2.8V signal to 5V TTL to interface with my Atmega8.

Whenever I give 5V as input to transistor 1,the 2nd transistor should theoretically be cut-off,and give me 5V as the final output. But instead I get output as 2.2V or so,which means current is flowing in the collector,even when second transistor is cut-off.

I checked Vbe for transistor 2,and its about 0.01V which suggests cut-off,but I hhave no idea why current is flowing and causing drop across my collector resistor.

Any explanations and/or remedies?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's a very complicated level shifter. Think common base level shifter instead like the STK500 does them.

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No need for all those resistors, it's a simple Darlington Pair arrangment you're after.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are using 2 npn because you need to level shift it to 5V and also to keep it's phase. The first npn inverts the signal so you are using a second one in class A.

Just another idea is:

        2.8V
        ___
         |
         \
         / R      D(schottkey)
         \        |\|
Rx ---------------| |----------------- Tx(5V)
                  |/|

        5V
        ___
         |
         \
         / R      D(schottkey)
         \        |\|
Rx ---------------| |----------------- Tx(2.8V)
                  |/|

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

Last Edited: Tue. Dec 15, 2009 - 10:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
That's a very complicated level shifter. Think common base level shifter instead like the STK500 does them.

Can you please post a larger picture circuit seems cropped?

Also regarding the darlington circuit,if I supply 2.8V,wont current flow in Resistor +Led,making output at collector low.

Basically I'd be getting inverted outputs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got my original circuit working.

I had connected an LED from collector of transistor 2 to GND,thinking when I'll get 5V I will see the LED glow.

But turns out this was obviously providing a path to ground ,for current through the PULL-UP resistor of transistor 2.

As soon as I removed the LED,got 4.98V on my multimeter :-),thanks for all the help.

Still wouldn't mind a common base circuit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
That's a very complicated level shifter. Think common base level shifter instead like the STK500 does them.
John showed the LED driver design, not the STK500 level shifters. The picture below left shows two STK500 level shifters for MOSI and MISO which does not invert the signal. Click on the link to get a larger image. It uses five SMD components per level shifter and can see them used on a STK500. For example there are three level shifters near the ISP10PIN header.

The picture below right shows 2 level shifters using MOSFETs described first in a Philips I2C application note. Using an array of four 10K resistors and a two transistor SOT363 package, two of these level shifters can be built using only two SMD components. The advantage of the MOSFET level shifter is that it is bi-directional as well. The disadvantage is that you need to know which voltage is higher (VTG or VCC) and in this case VTG must be less than or equal to VCC. I have used 16 of these level shifters on a board I am currently building. Most shift between VTG and 5V and 4 shift between VTG and 3.3V.

--Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi 007,
I recognize that drawing. Glad it works for you. Inexpensive, too, if you have the parts lying around...

Nice alternatives by Michael and Mike.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a derivate of a levelshifter I designed a year ago: it's sooo good to have these things at hand :)

See notes in schematic

Nard

Attachment(s): 

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Plons

Thanks a ton for that custom diagram. My next struggle is in finding 1 pitch mm connectors for my EM406 gps. Can't interface with AVR on breadboard without them.

@DocJC

Circuit is super cool,easy to understand,and cheap. Any input above 0.6V can be converted to 5V.Cool.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
John showed the LED driver design, not the STK500 level shifters.
John showed a STK500 level shifter as shown on sheet 8 of 9 of the STK500 manual.
John has used that cirucuit for about 30 years for level shifting, first time was used to shift a 1Vpp B&W video signal to about 15Vpp to drive vacum tubes grids so that normal TVs could be used for video distribution in lecture theathres.
Johh uses that circuit with SD card running at 3V to interface to 5V AVR.

Pretty clever John :lol:

Now if anyone does not understand common base circuits please do a bit of reading. :)

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Now if anyone does not understand common base circuits please do a bit of reading. :)
I did some reading. I thought common base grounds the base of the transistor. If you look at the rest of the STK500 circuit, it shows that when you ground the emitter, the LED turns on. This circuits looks like a common emitter inverter to me which means that the inverter shouldn't be used for a level translator.

The STK500 circuit I took from the STK500 schematic is used in several places to convert the RxDB/TxDB, ISP MOSI/MISO/SCK, and 4 dataflash SO/SI/SCK/CS signals.

--Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
This circuits looks like a common emitter inverter to me which means that the inverter shouldn't be used for a level translator.
I think you have a bit of learning to do. :)
It's a common BASE circuit. The base is tied up to the lowest rail via a resistor to supply some current.
The signal is fed into the EMITTER, there is NO phase inversion with that circuit, emitters and collectors are ALWAYS in phase.
It can translate levels from about 0.7V (let's say 1V) to the VCEO of the transistor.

The way it works in the STK500 is as follows: The base is connectet to Vtarget which, of course, needs to be lower than VCC (5V in this case)
When the EMITTER goes below 0.7V Vtarget the transistor is fully on and it will then follow the emitter voltage +~0.2V.
There is NO current gain in the transistor as the current flows down to the AVR's pin. So it can olny carry whatever the AVR pin can carry unlike a common EMITTER circuit (the one where the emitter is connected to ground) which can carry whatever current the transistor can carry.

edit the way the circuit is shown on the Wikipedia will never work as it would need at least -0.7V to the emitter, so the "usual" thing is to have the base biased at a level above 0V but can still be considered virtual ground especially with AC by simply putting a cap from the base to ground. In the case above it's not a good thing to do otherwise the AVR pin would need to discharge the cap via the base\emitter junction.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly