PNP transistor

Dippy

Moderator
If the circuit is all at 5V and you are using 'signal level' transistors then use a PICAXE output @ low to switch it on .. via a resistor. Output @high will switch it off. Things can change if using power transistors.

If the PICAXE is being used to control a 'secondary' part of a circuit at a higher voltage then it is safer to use NPN to PNP as you suggest. And the base of the PNP would probably need a res to the high side to ensure proper switch-off.

I'll leave drawing schematics to others as I have hurt my finger.
 

alexthefox

Senior Member
i have 12v circuit with 7805 for pic and input. wont to drive buzer (12v). now i drive it with npn bc517 darlighton, but wont with bc516 pnp darlighton too. can i do like you say? low level= outpun on, high level= output off?
 
Last edited:

KMoffett

Senior Member
OK, since I didn't see an example in the manuals.

This is an illustration of a PNP driven directly off the PICAXE for a 5v LED/resistor load, and through a NPN/PNP combination for a 12V lamp.

For a 12V buzzer, you can drive an NPN from the PICAXE, through a bias resistor, with the emitter to common, the collector to the buzzer, and the buzzer to +12v (examples in the interfacing manual). Make sure you add a diode across the buzzer...cathode (band) to +12.

Ken
 

Attachments

Last edited:

alexthefox

Senior Member
OK, since I didn't see an example in the manuals.

This is an illustration of a PNP driven directly off the PICAXE for a 5v LED/resistor load, and through a NPN/PNP combination for a 12V lamp.

For a 12V buzzer, you can drive an NPN from the PICAXE, through a bias resistor, with the emitter to common, the collector to the buzzer, and the buzzer to +12v (examples in the interfacing manual). Make sure you add a diode across the buzzer...cathode (band) to +12.

Ken
thk, but i did with npn like manuals and i work fine. i just ask if i can drive with pnp.
 

BeanieBots

Moderator
Only if you common the 12v + with the 5v + and connect the load to 12v -
(don't forget to disconnect the common 0v first:eek: )
Then drive in the way Dippy explained.
It would be a very confusing (un-natural) arrangement and not recommended because it would be too easy to make a mistake and blow up the PICAXE.
Also, if you wanted to drive the PICAXE (via a regulator) from the 12v line, you would need a negative (7905) type regulator because your system would be common line.
This is how we did things in the 1960's before NPN transistors were common!
 

hippy

Ex-Staff (retired)
thk, but i did with npn like manuals and i work fine. i just ask if i can drive with pnp.
And hasn't KMoffett shown how to do it with a PNP ?

Can you simply replace the NPN with a PNP ? Yes, if the lamp were powered from the same supply as the PICAXE, but, No, not if you want to connect it to +12V.
 

Dippy

Moderator
As far as I can see, Ken's drawing shows the two examples which I described (badly) in text. Isn't that what you asked Alex?

To drive a 'secondary' 12V part of a circuit using an NPN as a 'low sided' switch (please let's not get into the Low sided trivia I beg) is easy, either a simple NPN transistor or Darlington.
But doing it with a PNP 'high sided' (ditto no trivia) needs that second stage due to the behaviour of Bip transistors. Are you experienced with simple transistor stuff?
 
Last edited:

BeanieBots

Moderator
Are you guys just ignoring my description of how to use a PNP (with no NPN stage) to drive a 12v load from a 5v PICAXE?
Shame I don't do ASCII art. Maybe someone could oblige?

KMoffet's PNP example but the 12v is wired +12v to +5v and the load (LED cathode in example) to 12v (-ve). That is, -7v wrt PICAXE 0v.
 
Last edited:

BeanieBots

Moderator
Ahr, you can be so sweet sometimes;)
Just cos I'm an old fart that had to do these things before NPNs were around:eek:

Hippy's favourite way of doing a diagram.
0v at the top. The PICAXE Vcc to 0v,gnd to -5v and the load to -12v.
PICAXE output - res - PNP base... job done. (positive earth for those that remember those days).
 

BeanieBots

Moderator
No. That won't work.
As I said earlier, if you want to run the PICAXE from 12v and only use a single transistor which is PNP then you will also need a negative regulator such as 7905. The ENTIRE circuit has to be positive ground as I described. Your option is to either buy a 7905 or use a NPN tranny.
You also left the decoupling caps and regulator caps off your diagram!
Don't forget that serin also needs to be tied to ground if the programming circuit is not used.
 

Dippy

Moderator
Like BB says, that won't work.
Have ANOTHER LOOK at Ken's example. Replace his bulb symbol with yor buzzer.
 

alexthefox

Senior Member
No. That won't work.
As I said earlier, if you want to run the PICAXE from 12v and only use a single transistor which is PNP then you will also need a negative regulator such as 7905. The ENTIRE circuit has to be positive ground as I described. Your option is to either buy a 7905 or use a NPN tranny.
You also left the decoupling caps and regulator caps off your diagram!
Don't forget that serin also needs to be tied to ground if the programming circuit is not used.
yes, i didnt put just to post a quickly diagram
 

BeanieBots

Moderator
No. This is becomming painful!
YOU CANNOT USE A PNP TRANSISTOR AND HAVE 12v.

EITHER, run the buzzer from 5v AS SHOWN BY KMoffet's diagram.
OR use an NPN to drive the PNP AS SHOWN BY KMoffets's diagram.
OR run the PICAXE from a negative supply AS DESCRIBED BY ME.

You can't run a petrol car on diesel either.
 

alexthefox

Senior Member
No. This is becomming painful!
YOU CANNOT USE A PNP TRANSISTOR AND HAVE 12v.

EITHER, run the buzzer from 5v AS SHOWN BY KMoffet's diagram.
OR use an NPN to drive the PNP AS SHOWN BY KMoffets's diagram.
OR run the PICAXE from a negative supply AS DESCRIBED BY ME.

You can't run a petrol car on diesel either.
that is 7905 and not 7805. anyway wrong?
you sayd:
pic vcc--->0
pic gnd--->-5
out pic--->res--->PNP
is not the same of my diagram?
 
Last edited:

BeanieBots

Moderator
No. Completely different.
Your diagram shows a positive 7805 regulator supplied with +12v
A negative reg such as 7905 must be supplied with -12v.
The output of the regulator then has -5v which should be connected to pin 8 of the PICAXE.

Please, somebody jump in with a diagram.

PS.
Quick lesson how to draw the diagram.
Draw a line at the top of page. label it 0v
Draw another at the bottom. label it -12v
To the left, draw a regulator 7905
input to -12, 0v to 0v.
Now draw the PICAXE. Vcc to 0v (the top line) Gnd to -5v (Output of reg)
Then transistor PNP. arrow to 0v. other end to buzzer, buzzer to -12v
PICAXE OP to resistor to base.
(very similar to 'normal' circuit but upsdide down)

IT MUST BE A 7905 YOU CANNOT USE A 7805 THIS WAY.
JUST LIKE YOU CANNOT USE A PNP IN PLACE OF A NPN
 
Last edited:

hippy

Ex-Staff (retired)
Perhaps no so much complicated as easily open to confusion.

I drew my circuit before BeanieBots posted the description and it was extremely hard thinking in terms of a "0V" which is actually negative relative to a battery whose positive we are considering to be 0V ( or 5V when the regulator's -5V output is considered 0V ).

Voltages everywhere on the circuit depend upon what one wishes to call 0V and without that being stated every time no one will be sure someone else is referencing the same 0V; what someone sees as a logic low someone else may see as logic high.

I certainly wouldn't recommend this style of circuit these days as it's just begging for problems to arise, and I'd say it was more 'accident prone' with a much greater chance to inadvertently destroy the PICAXE by an accidental connection to -12V ( or -7V as I have it ).

All this, just to avoid using an NPN transistor :)
 

BeanieBots

Moderator
Hence my initial words of caution in my first reply.
Personally, I don't have any issue because when I learned electronics it was a fairly normal way of doing things as the only transistors available to the hobbiest were germanium PNP type.
What is does illustrate nicely, is the importance of correct and structured layout when drawing circuit diagrams.
This example is the most basic and simple of examples. Imagine how confusing things would get with a dual rail push-pull audio amplifier if top-down, left-right conventions were not followed.
(not to mention the old quad rail memory chip internal diagrams!)
 

Dippy

Moderator
Maybe I should have said 'overcomplicated' for a simple task :)

I would agree that in this case stick to an NPN for simplicity. The answer was given so many posts ago... it just seems like a dream now.

However, I wouldn't dismiss using PNP or P-chan MOSFETs. The high-sided switching layout is of tremendous use where your circuit requires a good ground or ground reference e.g. those little RF Tx modules or ADCing and my battery charger.

Germanium? Well, it still has its moments dunnit. (Notice no apostrophe).
 
Last edited:

BeanieBots

Moderator
Yes, germanium!
~0.3v Vbe for a darlington! Single cell amplifier anyone?

I don't think "complicated" is the correct term to use. "Confusing", maybe.
I have several circuits, (battery chargers in particular) where the PICAXE hangs from the line side to SIMPLIFY the design and avoid the need for level shifting NPN transistors. You just need to remember that if you earth that 0v, there will be a big pop and tears when you plug in the programming cable.
If I HAD to have the load connected to battery -ve, I would use the circuit shown in Hippy's diagram for SIMPLICITY. If that was NOT a requirement, I would use an NPN and a more 'conventional' design.
 

inglewoodpete

Senior Member
Germanium? Did someone say germanium? My Mullard designed 10+10 stereo amplifier is still going strong, although I had to replace all the electrolytics a few years ago, to get it back in spec. AD161/162 outputs with an AC128 driver. Some things are cast in the memory:)
 
Top