Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 20th August 2008, 04:47 PM   (permalink)
Default Singing the PNP Blues

I'm trying to use bipolar transistors as the output stage of a circuit controlled by an NXP LPC9221 µC. The illustration shows two of the configurations I've tried, and one about which I have questions.

"On" and "Off" mean current flows or does not flow through the load resistor, in response to a given output from the controller.

The "switch" represents the µC pin, connecting to either +3.3v or ground.



Fig 1: shows a low-side NPN based switch. This works fine, but I want to move the transistor to the high-side of the load.

Fig 2: shows my attempt to use a PNP, on the high side, to switch current to a load. In this instance, the transistor never turns off, even when I set the output high. I suspect that's because of the difference in voltage between the load and controller circuits.

Fig 3: shows what I believe will do what I want, switch 12v, from the high side of the load, using a 3.3v signal.

I'd like to know, is there a better solution to this problem, one that uses only one transistor?
Atomsk102 is offline  
Old 20th August 2008, 05:17 PM   (permalink)
Default

No there's not, and NONE of your solutions work either!

Check my PIC tutorials under Hardware Extras for how to do it.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 20th August 2008, 05:43 PM   (permalink)
Default

In figure 2, the base resistor of the transistor is never connected to its emitter voltage to turn it off.
In figure 3, when the NPN transistor turns on, the PNP transistor also turns on then both transistors burn out because there is no resistor in series with the base of the PNP transistor to limit the base current.
__________________
Uncle $crooge
audioguru is offline  
Old 20th August 2008, 06:46 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin View Post
No there's not, and NONE of your solutions work either!

Check my PIC tutorials under Hardware Extras for how to do it.
Strictly for my own educational purposes, what's the difference in what he shows and your tutorial. (See attached)
Attached Images
File Type: jpg sinksource.JPG (44.0 KB, 35 views)
__________________
All those who believe in psycho kinesis, raise my hand.

AllVol is offline  
Old 20th August 2008, 07:07 PM   (permalink)
Default

Quote:
Originally Posted by AllVol View Post
Strictly for my own educational purposes, what's the difference in what he shows and your tutorial. (See attached)
hi AllVol,

The fig #1 looks OK to me.

With fig #2, the pnp, its the base drive voltage thats the problem.

For an emitter voltage of +12V, the base is always at -12V via the base resistor to 0V or [12 -3.3] = -8.7V.

So it never turns OFF.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 20th August 2008 at 07:08 PM.
ericgibbs is offline  
Old 20th August 2008, 07:16 PM   (permalink)
Default

I see what you mean, audioguru. Does this look any better?


Last edited by Atomsk102; 20th August 2008 at 07:18 PM.
Atomsk102 is offline  
Old 20th August 2008, 07:23 PM   (permalink)
Default

Quote:
Originally Posted by Atomsk102 View Post
I see what you mean, audioguru. Does this look any better?

It looks good now.
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Old 20th August 2008, 07:27 PM   (permalink)
Default

In Fig. #2, can you set the LPC9221 I/O pins to a high Z state?
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Old 20th August 2008, 08:01 PM   (permalink)
Default

Quote:
Originally Posted by Atomsk102 View Post
I'd like to know, is there a better solution to this problem, one that uses only one transistor?
You have a 3.3v signal swing and a transistor only needs a ~1v signal swing to go from saturation to cutoff, so you don't need voltage gain at this point; use a Zener diode with resistors as a level shifter and input attenuator for this high-side switch.

Use the PNP of fig. 2 with a 1K base resistor. Run a 100Ω resistor from the base resistor free terminal to +12v. From this same base resistor terminal hook up the cathode of a 9.1v Zener diode, then the Zener anode connects through a 100Ω resistor to the switch wiper.
With zero base current, there is then 10 mA flowing through this base drive circuit.

When the switch is at +3.3v the Zener is just turning off and the transistor is shut off by resistor going to +12v.
When the switch is at gnd, current flows through the Zener and so it is on and it turns the transistor on. The Zener cathode will be at ~+10v with respect to gnd.

If the input "switch" can't sink 10 mA, change the two resistors to 1k but then your RL has to have a higher value and your base resistor can probably go to zero Ω.

Last edited by Willbe; 20th August 2008 at 08:03 PM.
Willbe is offline  
Old 20th August 2008, 09:13 PM   (permalink)
Default

There is a way to do this using one pnp transistor. The circuit is shown below. Note that to turn the pnp off, you must put the output pin into a high impedance state, or change to an input. This is what most of us do when confronted with these types of limitations. HTH.
Attached Images
File Type: gif pnp.gif (5.3 KB, 27 views)
__________________
"Everything that is done in the world is done by hope." -Martin Luther
"There are two ways to live your life. One is as though nothing is a miracle. The other is as though everything is a miracle."-Albert Einstein

Last edited by Analog; 20th August 2008 at 09:41 PM.
Analog is offline  
Old 20th August 2008, 09:56 PM   (permalink)
Default

Quote:
Originally Posted by rezer View Post
In Fig. #2, can you set the LPC9221 I/O pins to a high Z state?
Apparently not high enough Z.

The device has three output modes, Bi Directional, Push/Pull, and Open Drain.

I tried Push/Pull and Open Drain, but neither one could make the circuit in Fig 2 shut off.

I'm re-working my hardware to test the modified Fig 3 circuit now.
Atomsk102 is offline  
Old 20th August 2008, 10:14 PM   (permalink)
Default

Quote:
Originally Posted by Atomsk102 View Post
I'm re-working my hardware to test the modified Fig 3 circuit now.
Maybe your test instruments are leading you astray.

I'd start from zero.
What voltage & current can your input signal source or sink and what voltage & current does your load need?
I can't imagine needing the power gain of two transistors to accomplish this [level shift of (12/2 - 3.3/2) = 4.5v and gain of 12/3.3= 3.6] interface function.

Also, CMOS gates can be used as linear inverting/non-inverting amplifiers, so if you have some spare gates and a Zener, you can use them.

Willbe is offline  
Old 20th August 2008, 10:21 PM   (permalink)
Default

Thanks Willbe:

I had a feeleing that a Zener could do the job, but I didn't know how to set up the circuit.

Analog:

That may work too. I might not have had the pull up installed correctly, when I tried it.
Atomsk102 is offline  
Old 20th August 2008, 10:23 PM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
hi AllVol,

The fig #1 looks OK to me.

With fig #2, the pnp, its the base drive voltage thats the problem.

For an emitter voltage of +12V, the base is always at -12V via the base resistor to 0V or [12 -3.3] = -8.7V.

So it never turns OFF.
In figure two, didn't the OP just make a mistake in his schematic, leaving the switch, which represents his uC output, high. In the verbage, he has the output being low, which would work, wouldn't it?
__________________
All those who believe in psycho kinesis, raise my hand.

AllVol is offline  
Old 20th August 2008, 10:38 PM   (permalink)
Default

Quote:
Originally Posted by Willbe View Post
What voltage & current can your input signal source or sink and what voltage & current does your load need?
My input can handle about 20mA, source and sink. It runs at 3.3V, but the device can tolerate 5V at the inputs.

I don't have the exact numbers on the current requirements of each load yet, but they all require 12V in.

For testing, I just used LEDs and 2N3906s. I figured, if I needed more current, I could go to something like a TIP125, later on.
Atomsk102 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Singing Card neo2478 Electronic Projects Design/Ideas/Reviews 7 21st June 2007 10:24 PM
home network blues OutToLunch Chit-Chat 5 4th April 2007 09:51 PM
Student with the pic blues, all code, no action rostifa Micro Controllers 10 22nd March 2006 09:31 AM
16F877 programming blues. dwarshout Micro Controllers 9 27th October 2005 04:21 PM



All times are GMT. The time now is 05:43 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker