Electronic – Problem into shifting from 3v3 to 5v using a BJT

bjtdigital-logiclevel-shiftinglogic-level

I've encountered a problem when I've made a small circuit to shift logic level of my 3v3 MCU to a 5v signal. Probably I've misunderstood usage of BJTs. Here's schematic:

enter image description here

As said, my purpose is to switch from 3v3 supply line of my MCU to 5v to transfer data to external slave device (just sending).

What I get with my scope is:

  • Vmcu = 3,38V
  • D-n-BJT side = 3.18v Low and 3,82v High
  • BJT base side = 4,30v Low and 4,38v High
  • STRP-D-n side = 5,00v
  • BJT device is BC856S,115 .

What I get is a 5V constant output, on base side I've as low level 4,30v and high level 4,38v . On MCU output pins I've 3,18v low level and 3,82v high level.
In case I open a base resistor (disconnect it from BJT and probe MCU output), for example I remove R53, I get normal output level as 0,00v low level and 3,38V high level.

What I've wrong in this schematic? Maybe I've wrong resistors values?

Otherwise, in case resistors are not the problem (or the only) and changes on layout should me made, how I can do a lessees complex correction to this circuit avoiding to make a new one? (just because I've already etched it).

Best Answer

Your schematic will produce a constant 5 volt output but more on that later.

You have PNP transistors connected upside down and that moves the normal input junction from being base/emitter to base/collector. Transistors can be made to work like this on low voltage supplies but, it's not ideal and β will be low. Not unheard of though!

Operationally, in your circuit, the base/collector junction will always be forward biased because your input voltage is a maximum of 3.3 volt. This means that the transistor will always be "on" hence, this is why you see 5 volts at the emitter. Your circuit cannot raise it's input (feeding R53 or R54) to a high enough voltage to turn the transistors "off".

For these reasons, the circuit will not do what you want so, I suggest you google "using a BJT as a logic level shifter". There are solutions if you look on the internet such as this one: -

enter image description here