Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Level Shifter

Status
Not open for further replies.

Scarr

Member
Hi All,

I want to use a level shifter, these are really small and hard to work / test with. I have one on a PCB but it's not working as expected. The reason this is not working could be something else and not the level shifter + wiring, so I thought I would break it down into sections. To do this I made a breadboard version of a level shifter using a PNP (2N4403) and a NPN (BC548B) and to simulate I added 22k resistors in the same positions as the . This still does not work but I think this is because the transistors are not 100% the same . If I reduce the NPN base resistor to 10k (was 22k) it works, but this does not help me determine if I have got it right with my BCR22PN level shifter.
The RX_IN in 5v and the RX_OUT it 3.3v on a Xmega MCU RX pin.

So I have a couple of questions:
  • Looking at my picture should this work as a level shifter?
  • Am I correct in saying the my breadboard simulator does not work because of the difference in the transistor specs.
Finally to confuse me even more I created a Multisim siumlation of the breadboard setup "2N4403 + BC548B with 22k's" and this worked without the need to change the base resistor to 10k!!! but I suspect this is because in Multisim is a perfect world with no real world losses.

Thanks in advance

Steve
 
Last edited:
You need a pull up resistor to 3.3V on the output. pin-6

I don't know why the 10k/22k problem. Does a 1k or 10k from pin3 to ground make it work?

The input (pin-5) switches at 2.5 volts (about).
 
Hi Ron,

Do I need a pullup? when I measure the RX pin on the MCU it's at 3.3v already and it stays there even when the input to the 22k / NPN is moving between 0-5v. It's like the NPN is not pulling it down hard enough, hence me trying a 10k to improve the pull down.

FYI with 22k I see about 0.7v (but its right on the edge of 0.7v might be <0.7v) on base of NPN and with 10k I see about 0.8v on base.

Steve
 
Do you think it is possible the RX pin on the micro is configured as an output and is being driven high?
 
Ronv, I don't have the HW in front of my right now but you could be right, if you are your a genius for figuring this out so quickly!!, I will keep you posted.

Steve
 
Well, I have to drop my head in shame, I had the port configured as OUTPUT this was causing the issue :oops: Ronv you are a star.

Thanks everyone who even took the time to look at my post.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top