Using PNP Example

Hello all, for Pixmusix, John,

I recently viewed your query and the following comment on using the PNP transistors. Interesting.
I have done a little playing around and the outcome is following.

I have used components I had on hand.

In this process I would always start with the item I need to control. In this case the lamp, which is to be lit at 4 different levels. I have a 24V 6.5W lamp so powered it at 12V, 9V 6V & 3V, resulting currents were 175mA, 150mA, 110mA & 75mA.

Looking at the PNP lamp section of the circuit below I initially connected the base through a resistance decade box to ground the resulting base resistance required to give the above collector currents to the lamp are, 2.2k, 22k, 47k & 68k.

To drive the arrangement with the 4 x GPIO you required (and assuming these to be 3.3V) I did use 4 x NPN BC548 transistors. With base current supplied from the 3.3V I applied 1M resistors to each , reducing the base current but allowing ON / OFF of the NPN’s.
The resulting PNP base resistors are 15k, 22k, 33k & 68k. The actual values of current and components are here and there but the resulting circuit is the output.
A couple of hours on a Good Friday afternoon.
I hope you find this of interest.
Bryan

1 Like

Hi Bryan
Yes the idea is sound but I would have a couple of queries.
Firstly the NPN base resistors seem a bit high. That would only be a base current of about 2.7µA. Are you sure the NPNs are fully ON at that figure or as the through current even the 15k is somewhat less than 1mA it may not matter.

I am not sure it is a good idea to leave the transistor bases floating. Although if the driving logic PULLS them to ground when OFF, thus not floating, it would be OK.

Did you measure these voltages or calculate them. If the lamp is incandescent the resistance would change quite dramatically between cold (off) and hot (fully on).

You forgot the “k” for R4 (15k) in the schematic.
Cheers Bob

Robert,

Thank you for your comments. The whole process was breadboard wired all currents measured.
I agree with the base currents and the 1M resistors however this was a quick assessment and the resulting ON/OFF operation fitted the purpose.
Yes, floating bases is not ideal however it would depend on the logic source equipment.
The missing k was a typo.

The original post was based on the function of PNP. I would suggest based on the +ve logic drive signal and available source current the process could be functioned as a 1 x NPN setup driving the lamp. One off power OR gate with 4 x base drive current values via the 4 base resistors.
All good fun.
Regards

Hi Bryan

Yes isn’t it.
As the PNP transistor is configured as an amplifier (Linear ???) with the lamp as collector load you could get really clever and convert a number to 4 bit binary and have 10 levels of illumination with the 4 resistors and NPN transistors.

I think this was something like Pix’s original set up except he had the lamp in the emitter side (Ground side) of the NPN transistor. This can’t work as the base has to be 0.6V above emitter so you would have needed a 12V drive signal which could get messy.
He then transferred the lamp to the collector side which I think he got working in some fashion. Speaking on a general note the down side of this is the low side of the lamp is always above ground and depending on lamp construction would not always be convenient.
I think we decided the PNP approach was more versatile.

Another problem. Most (could probably read “All”) logic device will provide none tenths of nothing whet is comes to current source. None of the ones proposed by Pix at the time would supply enough current to turn a transistor on.
Anyway I think Pix got something to work and has put that problem to bed.
Nothing wrong with further experiment though.
Cheers Bob
Cheers Bob

Hey Bryan.

Just checking in to say thanks for your interest and research.
It looks really promising and I am intending to build it myself.
I haven’t had a chance yet, so watch this space.

Cheers Bryan. :slight_smile:

Hi @Bryan160034

Thanks for your patients while I experimented with this.
I love this design and you’ll be pleased to know I’ve adopted it into my project.

Kinda did but kinda didn’t.
My original design looked like this, with the adjustment of putting the lamp first.
It had two issues:

Firstly, putting the lamp first was possible but challenging in the context of existing wiring.

Secondly, I wanted to use 2watt resistors so I had plenty of head room. I had calculated 120ma * 12v = ~1.45w. Unsurprisingly it’s hard to source weird low values like 14Ω 2w resistors.
I resorted to combining some combination of 50Ω, 75Ω & 120Ω 0.5w resistors in parallel to distribute the power and chase those low values. That took me down another rabbit hole of how power is distributed over parallel resistors of different values.

So, I suppose I technically did get that working, but it got ended up finicky and ugly.


Here is what I came up with based on @Bryan160034’s design.

These are the resistor values that worked best with my lamp.
It elegant and clever too. Learned a lot building it.

I did wonder about this too.
The AtTiny85 has internal pull-down resistors I could take advantage of.

In the event that PB0, PB1, and PB2 are LOW, then Q2 would be essentially floating.
My instinct Is that I should put some kind of pullup/pulldown resistor on the base of Q2.

I could add a 200k+ pull down resistor, which would parallel to R10, R11, and R12. Not sure I like that solution.

I could add a pull up resistor, which would create a voltage divider.
Transistors are current controlled, not voltage controlled, so maybe that’s fine, but it still “feels” a little weird to me. Then again I see voltage dividers on transistors in circuits all the time in text books.

Is this something to be concerned about or am I worrying about nothing.

1 Like

Hi Pix

I don’t like it either. Surely you have drawn Q2 upside down. The transistor is PNP and as such the collector has to be more NEGATIVE than the emitter. Would make more sense if emitter and collector are reversed.
Please clarify this before further comments attempted.
Cheers Bob

Oh yeah thats so weird why is the emitter at the bottom. There must be a way to fix that in my software so the pnp resistor is the right way round like Bryans.

Edit “right way round for my circuit” i mean.

Hi Pix
Select the item then mirror vertically.
Looks like this in the tool bar. Assuming this is KiCad.
image
Cheers Bob

1 Like

That did it. I recon I just hit a hotkey by accident and didn’t notice.
Something I’ll need to check for in future.

I’ve fixed up the schematic in my earlier post

Hi Pix
That looks a bit better.
I was about to edit my earlier post. I think the word “Flip” is used and sounds better than and more descriptive than “mirror” which I mistakenly used.

Now your “Pull down” resistor to ensure that Q2 base does not float would connect to 12V even though it would be technically “pull down” as it is making sure Q2 turns OFF when required.
A resistor of 200k should be OK here and would not affect the Q2 base resistors R8, R10, R11 and R12 to any noticeable extent.

Good idea. Actually sticks out like a neon light.
Cheers Bob

Don’t think so. I think that is the default orientation when you place the component.

1 Like

I figure once I’ve made a million of these diagrams I’ll eventually start to these important details will become second nature to me.

Hope so
Cheers Bob

Hello Gents,
Good conversation, however, could I suggest we pull the PNP base UP and not DOWN?

1 Like

Hi Bryan
I said that.

All in the interpretation of UP and DOWN. PNP devices are nowhere as common as they used to be these days although they very much have a place in the scheme of things. Normally pretty much hidden inside many ICs.

You could say either.
Pull up connects to positive by default and pull down connects to ground.
Or.
Pull up holds a device ON by default and pull down holds a device OFF.

Main thing to remember is that the voltages on PNP are the reverse of NPN.
Cheers Bob

1 Like

After 55 years you still wont have it all.
Ha Ha

1 Like

Hi Bryan

Ain’t that the truth.
I first started in this business as an occupation Feb 1964 and I still find you really can learn something every day. Electronics is such a fast moving and evolving business I find that at 89 it is impossible to keep up or even get close. So I just try and keep track of some of the broad issues and believe what those on a higher pay scale tell me. The pace is a bit mind boggling mostly so I just try to keep an open mind on the whole scene. Nothing more I can do really as I am slowing down somewhat these days.
Cheers Bob

1 Like