EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Simon on July 01, 2013, 08:14:42 pm

Title: Problems level shifting with NPN & PNP transistors
Post by: Simon on July 01, 2013, 08:14:42 pm
This is really wired, I have my arduino output PWM signal that I need to level shift to 24V PWM signal to drive a brushless motor. I have a PN2222A NPN transistor being driven by the output via a 1K resistor, then I have the emitter/base of the PNP transistor going into the collector of the NPN via a 10K resistor. Now on the collector of the NPN i have my PWM signal, at the other side of the resistor i have constant +24V, what the ? i thought this was a basic configuration what have i missed ?
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: free_electron on July 01, 2013, 08:18:06 pm
Looks normal to me. The emitter base of the pnp is a diode. If you measure there you will always see vsupply -0.7 volt.
If you were to measure the current you will see the pwm signal. If you measure voltage you will see vsupply -vbe
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Simon on July 01, 2013, 08:24:55 pm
Yea your right of course, so problem is my PNP is not switching off because i always get 24V from the collector, do i need a resistor from the emitter to base on the PNP ? (mosfet style)
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Simon on July 01, 2013, 08:32:25 pm
my PNP collector only goes up to 10V on the high state not 24V so suggests that current is always passing in the PNP base (via the NPN collector) which keeps it on.

Is there any way current can backflow though the base of the NPN and into the arduino pin that is connected to ground ?
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Simon on July 01, 2013, 08:47:27 pm
I had the NPN back to front ! duh stupid me. so colector and emitter were swapped
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Andy Watson on July 01, 2013, 08:50:44 pm
do i need a resistor from the emitter to base on the PNP ? (mosfet style)
I would, something like 1k between B-E. This will lower the impedance and speed-up the switching. You don't say what sort of load you're driving but if it's >100mA you might want to take the hfe of the PNP in to consideration and adjust the value of the 10k accordingly.
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Andy Watson on July 01, 2013, 08:52:27 pm
I had the NPN back to front ! duh stupid me. so colector and emitter were swapped
That wouldn't have been helping the situation ;)
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Simon on July 01, 2013, 08:52:59 pm
as per above - fixed, I have my fan running at a very steady 934 rpm. The PNP is just supplying a PWM signal to a brush-less fan motor with over 100K input impedence  so no load problems
Title: Re: Problems level shifting with NPN & PNP transistors
Post by: Simon on July 01, 2013, 08:53:29 pm
I had the NPN back to front ! duh stupid me. so colector and emitter were swapped
That wouldn't have been helping the situation ;)

Indeed  |O |O |O |O |O :bullshit: