what I think* I know
I really struggle with PNP transistors.
To be honest, I’ve been looking for an excuse to use one as a learning opportunity.
As I understand it, transistors like have their load on the collector side.
This is my case, where I need a lamp towards the end of my circuit.
my goals
I have a situation where I’m trying to get a flickering effect on a lamp. I don’t want to use PWM dimming, since the lamp won’t last long. Instead I want to vary the resistance in series with the lamp.
I’ve done some measurements and the range I need is 0Ω - 120Ω ohms (where the lamp emits no light at 120ohms).
For my flickering effect, 80Ω is about the dimmest I want it to go.
So, all that said, here is my design.
The idea here is that I can vary the resistance in series with the lamp by switching Q2, Q4 and Q5. Various combinations will produce various currents. If I ever want my lamp fully lit I can bring the base of Q6 low.
my problem.
I believe a PNP’s emitter must have a higher voltage than it’s collector, but in my case my supply is 12v and I want exactly 12v at the lamp for maximum brightness. 
My second thought was that current needs to flow through to base to ground, so does that mean that, when I bring pin2 of my MCU low, I’m connecting my tiny85 to 12v? 
Do I need a P-ChFET in place of Q6 or can I make this work with a transistor.
(p.s. I’m open to simpler ideas
)
1 Like
Hi Pix
A PNP transistor could be likened to an NPN with reversed polarity. So in effect the collector has to be NEGative WRT the emitter. Think of it upside down with a negative supply and the lamp as the load. The base also will be about 0.6V negative WRT the emitter. This will be achieved by taking the Tiny pin 2 to ground.
As for the other 3 transistors the same applies, the bases have to be 0.6V above the emitter which I don’t think can happen with only 5V as the base supply from the Tiny. High side switches in this configuration all have to be PNP. As a matter of fact you will never get the lamp to turn off as to do so the bases would have to be returned to 12V.
The only way this will work properly would be to make all the transistors NPN and transfer them to the low or ground side of the lamp or in other words make all NPN and put the lamp where the fuse is and all emitters to ground.
Where did the 4k6 resistors come from. Did you note take any notice of what I said in another thread about preferred value resistors. Commonly available will be 4k3 or 4k7. This value is not terribly critical in this application but I mention for the sake of getting some accuracy into the system. Good luck with 4k6 if you really need them.
Cheers Bob
1 Like
Yep. That’s the subtle redisign that fixes my problem. A banger. Thanks Bob.
Yeah I think I just misremembered the value.
They should be 4.7k.
To be honest those resistors might have to be smaller to saturate the PN100s from 5v.
I’m expecting 100-150ma through the lamp.

I’ll experiment when I build it.
Hi Pix
I forgot to mention in the last reply.
The current through the lamp will change quite drastically from dim (filament colder) to bright (filament hotter) as the actual lamp filament has a resistance from quite high when at full voltage and brightness (you can calculate approximately from lamp wattage) to pretty low (you can measure with DMM) when off and varies at all points between so is a bit hard to calculate without very detailed lamp specs which are not normally available.
So you might have to play with R5, R6, R7 to get the brightness you want.
Cheers Bob
What type of “lamp” are you using? Incandescent of sorts?
Anyway, I suggest putting the lamp just below the fuse (F3) so the NPN’s (and ATTiny) can be ground refenced. I don’t see a need for a PNP (or PCh Mosfet) unless using for a power off option?
Another issue is to take into account is power dissipated by the resistors.
I still thing PWM is an optimal choice - one can filter it if necessary to obtain a “nicer” waveform.
Fun project!
It’s a banger.
Saturation on the PN100s is 1ma.
I calculate 1kohms will probably get me 4ma but that assumes a clean rich 5v.
I doubt the tiny GPIO will be able to muster more than 5ma max so 1k actually feels good.
I might have to check if the NPN has a max voltage on the base.
I’ve been thinking about this too.
What I have to hand is lots of 110Ω, 330Ω, 1kΩ, and 10kΩ rated to half watt.
To get down to the low values shown in the diagram I’ll need to throw them in parallel anyway.
e.g. R5 could be 4 x 330Ω resistors in parallel with 2watts capacity. (82.5Ω)
Yeah that’s insightful.
I can include a small trim pot in as one of the parallel resistors making up R5, R6, and R7.
That way I can dial in any variation if required.
1 Like
Hi Pix
I don’t think a small trim pot will cut it. They are only low power rated.
I don’t know if you are aware or not but a pot of any description is rated at X watts and this is over the WHOLE resistive element, not a small part of it. For instance a 500mW pot if used in a rheostat connection as you would be doing, at 50% position would only be able to handle 250mW and so it gets worse the less of the whole element you are using. This has been a trap for many I am afraid. It is not a good idea anyway to have DC current flowing in a carbon pot in this configuration anyway as the pot will become very noisy and fail. For this type of application a wire wound pot is essential. The power handling is the same situation.
If you are just turning a knob to adjust brightness why not replace everything with a wire wound rheostat of enough power in series with the lamp. That is effectively all you are doing but doing it in steps. Maybe that is not complicated enough though.
Cheers Bob
1 Like
Right. I didn’t know that. 
Nah I’m going for a flicker effect by rapid switching of the NPN resistors.
I could chuck in to rheostats for R5, R6, R7 just until I find those magic values that work well when the lamp is mature and when it’s fresh.
The idea is, once I have found values for R5,R6,and R7 through testing over a few days, I wrap it in a box, seal it up, and never think about it again.
Hi Pix
See it all (or most of it) now. Yes that rheostat idea will work. You have not said what the lamp wattage is. It would be a good idea if said rheostat rating was the same or at least close to that.
There could be an easier way. Do you have a bench supply? if so it possibly has a current limit function. If we are lucky and this is the case establishing resistor value is easy.
Set the supply to 12V max current.
Connect the lamp (full brightness). record voltage and current.
Using the current limit control reduce it until required brightness is achieved. The voltage will reduce, that is normal. Record the voltage across the lamp and current.
Repeat for other brightness levels.
From these figures you should be able to calculate the required resistance values for all required brightness levels.
If you have a variable bench supply without variable current limit just connect it across the lamp and set for 12V. Measure the current.
Reduce the voltage to required brightness levels and record voltage and current.
Calculate the required resistance values as above.
Your required resistance (Ω) = (12V - Voltage across lamp) / current (A) which is basic ohms law.
If using a DMM for current USE THE 10A RANGE.
You will likely come up with some odd resistance values. I think the human eye is pretty tolerant to small brightness changes so the nearest PREFERRED VALUE would probably be OK.
I think you meant “transistors”
Don’t make it too rapid. An incandescent lamp requires a bit of time to change temperature and thus brightness. You will have to experiment here with timing.
Cheers Bob
1 Like
In this case I think a “vibe” is better than measurement because I’m trying to emulate a flame or some kind of flicker. I don’t really want the correct brightness, just one that looks about right.
The value of variable resistance is that I can adjust it until I’m happy and then leave it alone.
I think I’ll stick with good old fashioned through hole resistors on a breadboard. Mix and match until I’m happy and then solder it down forever. 
Thanks everyone for all that amazing advice.