Getting the resistors right

Status
Not open for further replies.

UTMonkey

Member
As a self confessed noob, I have been reading loads on Electronics theory and now am at the stage to put it all in practice.

So lets say I try out a simple transistor switch example. The first thing I want to make sure is that I select the appropiate resistors for the job.

Please see attached image file.

This was copied from a book I have been studying, what is useful about this books it gives an insight as to what steps you should go through to select the right transistors.

Please review the following steps and feel free to comment or correct.

1. Understand what the job of the transistor is. (in this case to switch on an led).
2. The LED takes around 20mA and we know the npn transistor (Q1) can take up to 100mA (so its a good choice)
3. The value for R4 is calculated based on the supply voltage minus the drop across the LED (2V) = (6 - 2) / 0.020 = 200 ohms.
4. Lets say that the voltage at point A is 1.5 volts (produced by the LDR + R1).
5. If Q1 is on when the voltage at A is 1.5V then the limiting resistor value R3 is derived by subtracting the base voltage drop (0.7) from 1.5V (at point A) and then dividing by an appropriate amperage based on the collector current and the gain of the transistor.

6. So if the gain of the npn transistor is 100 and the current at the collector is 20mA, then a suitable base current is 0.020 / 100 = 200 microamps.

7. Knowing that (steps 6 and 7) we can do the following
R3 = (Voltage drop at base - Voltage at A ) divided by (Collector current divided by gain of transistor)
R3 = (1.5 - 0.7) divided by ( 20mA / 100)
R3 = (0.8) / (200 microamps)
R3 = 4K (or 3K9 as a nearest value)


I like this, It makes sense and I can work with it. I do have one little question though that will complete this.

At point A there is 1.5Volts, ok - but there is also a current.
My guess is that at A the current will be about 1.5mA (based on 6Volts divided by R1 (3k9))

So when calculating the R3 value connected to the base why not take this current into consideration?

I think I remember reading somewhere:-
"The total current arriving at a junction equals the total current leaving it"

So bearing this in mind lets say the resistance of the photoresistor is the same as R3 (3k9). So at "junction" A would'nt 1.5mA be shared evenly between the base of the transistor and and the photoresistor?

And if that is the case, that would mean more current is going through the base than estimated (or calculated in step 6+7)?

Please feel free to put me right on this one!!!
 

Attachments

  • NPN Circuit.jpg
    14.4 KB · Views: 223
I got rid of your horrible black background.

A transistor has its current gain listed when it has a collector-emitter voltage of about 4V, when it is not saturated like a switch.

A transistor has its max saturation voltage listed with its base current at 1/10th of its collector current so it is turned on very hard.
A high gain transistor saturates pretty well when its base current is 1/20th of its collector current.

Your transistor has a base current of only 0.39ma when the LDR resistance is 3.9k so the transistor is not turned on hard enough to saturate with a low collector-emitter voltage. The transistor might be only half turned on and the LED might be dim.
 

Attachments

  • NPN_Circuit.PNG
    29.7 KB · Views: 201
Many thanks for this.

I will study your changes over the coming day.

Your response does beg the question, how "wrong" was the circuit? if you had the same requirement (turn an led on etc.) and had to use the same components (albeit with different resistances), what would your process of determining the best resistor values to use?

Mark

p.s. thanks for tidying up my diagram!
 
I would not use that circuit. I would use a Schmitt Trigger.

A Schmitt Trigger triggers at a particular voltage level, so the LED will be rapidly switched on (or off).

But with your circuit, the LED brightness will change slowly as the light level on the LDR changes.

I suggest you search this forum for "schmitt trigger" as there has been plenty of discussion in the past.
 
Thanks for the response ljcox I am sure your solution gives me a better solution, but that isnt the point of this little exercise. I want to get the resistor selections right for this circuit.
 
UTMonkey said:
Thanks for the response ljcox I am sure your solution gives me a better solution, but that isnt the point of this little exercise. I want to get the resistor selections right for this circuit.

The trouble is that it's a really poor circuit, so you would need different resistors (selected on test) for every single transistor you used. A correctly designed circuit, by using feedback, means you can pretty well ignore transistor spreads.
 
Thanks Nigel, so the advice is - use a rule of thumb and then test and modify as required?

I was sort of hoping an exact science to this (am i being naieve?)

Lets say I build a prototype and from that i build a dozen others, providing i source the same materials i should be able copy the circuit exactly, if i cannot source the same materials - is it back to the bench to test alternatives and modify resistances as necessary?
 

The values of some of the resistors will vary according to the gain of the transistor - and the gain will vary greatly from device to device. Even sourcing the same materials means it's likely you would have to select the resistors on every single one you make. Good design means you are able to ignore this variation.

By far an easier method, and MUCH better performing as well, would be to use an opamp - these are essentially 'perfect' devices, and (within reason) you can treat them as such.

BTW, I'll be in Chesterfield tonight, my daughters playing at the Donut Centre.
 
Whem Nigel said "transistor spreads", he meant that transistors have a wide range of current gain. One transistor will have a current gain of 100 and will turn on with a high base current. Another transistor (with the same part number) will have a high gain of 500 and will turn on with a low base current.

If you don't want to adjust the resistor values in each circuit so that the operation is the same then you can re-design the circuit with negative feedback or add a second transistor to increase the gain so that each transistor performs nearly the same.
 
Thanks for all the comments. I am not saying I got answers to all my questions, but your responses have given me a lot to think of so I am grateful.

Truth is, I have been reading electronics theory books for some time and the example I gave you is copied exactly from the book, was the book wrong? or was the example designed to give a feel of transistor "action"?

Anyway I think it is high time I just put the books down and got stuck in!

Thanks to all.

p.s. Nigel - do you still work in Matlock?
 

Book examples are rarely 'real world' examples.

Anyway I think it is high time I just put the books down and got stuck in!

Thanks to all.

p.s. Nigel - do you still work in Matlock?

Yes I do.
 
UTMonkey said:
Truth is, I have been reading electronics theory books for some time and the example I gave you is copied exactly from the book, was the book wrong?
The book might be wrong. Maybe it was written in 1958 by a " one-eyed, one-horned, flyin' purple people eater".

Why did I remember that lousy song from 50 years ago???
I never found out if the animal was purple or if it ate only people who wore purple clothes.
 
UTMonkey said:
someone is showing their age
I am proud and respected for being an old geezer.

Why did my old brain remember a lousy stupid old song from 50 years ago???
 
I had been struggling with a similar circuit a while ago. It was for a simple LED in a frosted vodka bottle for a night light. I was trying to avoid using op-amps.

I found that using a few diodes between point A and the base (still using a resister too) gave more of a switching action instead of slowly turning on the LED. But it was not reliable. The theory was that the diodes would not conduct current until "A" got to at least their Vf. But I think they leaked a little. I will have to try it again.
 
whiz115 said:
if i understood correctly there is a proposal of using op-amps instead of transistors?
Not necessarily.

The circuit could be made to work with transistors. What we have been saying is that the configuration posted by the Op is a poor design for the following reasons:-

1. It does not have a sharp transition, the LED will turn on and off slowly as the light level changes.

2. It is dependant on the transistor parameters, ie. the gain, and as I think Nigel pointed out, the gain varies from one transistor to another (ie. transistors of the same type and from the same manufacturer) and it also varies with temperature.

The whole point of electronic design is to design circuits that are immune to both component parameters and temperature.
 

You need to calculate the base current at step 4. Ib = 20/100 = 200 uA as you said at step 6.

So if you assume that there is 1.5 V at point A, R3 = (1.5 - 0.7)/0.2 = 4k as you found later. BUT, you then have to calculate what value R1 must be to give you 1.5 V at A with a given LDR resistance.

The LDR resistance depends upon the ligh level, so you would need to measure the LDR resistance at the required light level. So assume it is 5 k.

1.5 Volt across 5 k means a current of 1.5/5 = 300 uA.

Therefore, the current through R1 is 300 + 200 = 500 uA.

Thus R1 = (6 - 1.5)/0.5 = 9 k.

This hpow I would have done the calculation, but as we have said, it is not a good circuit if you want rapid switching.
 
Last edited:
It would be better to eliminate R3. I expect that the person who designed the circuit that was in the book was one of the "transistors are current controlled" school.

But in fact, they are voltage controlled.

If R3 is eliminated, the transistor will start to turn on when the base voltage reaches about 0.55 Volt and be fully on at about 0.7 Volt.

Thus a change of of only about 0.15 Volt is necessary to bring the LED from off to full glow.

Whereas with the circuit from the book, the voltage at point A has to change from about 0.55 Volt to about 1.5 Volt.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…