NPN and LDR Circuit Basics

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
My knowledge is very limited and I learn in baby steps. I have built a LM317 power supply. I assembled on a breadboard the attached circuit. The LED did not light, battery got warm and I think also the NPN. I tried again using alligator clip jumpers with no luck. I tried the LED with resistor and that works. On my DMM I checked the NPN and it reads 22 HFE. I tried backwards and it reads 1 HFE so I think I have my c, b and e correct. I assume the NPN is just a 'gate' which permits c to go to e and that the amount of current 'supplied' to b will determine how much the gate opens. I assume the current from c goes to e and b also goes to e. My salvaged LDR reads from 40k to 200 ohms dependent on light intensity. I believe that a resistor just limits current but doesn't do anything with the voltage.
1) Are my assumptions correct?
2) What does R2 do? Can I eliminate it?
3) Are there any additonal tests that I can do to confirm NPN is still good?
4) What does "VEBO 9V in the specs mean?
5) If resistance of LDR drops below R1 (390 ohms) does 'gate' still open?

If suggestions/changes are made on the circuit I would appreciate also the why/how, in basic laymans terms, so I can try to understand how things work.
 

Attachments

Dodgydave

Joined Jun 22, 2012
11,395
Q1 is a Npn transistor, so it will have 0.7V across it's B/E terminals when fully on, (Also there should be a resistor in series with the Base like 1K,)so when the light increases the voltage across R2 will rise until it reaches 0.7v, then Q1 will turn on. R2 alters the level of light at which the transistor turns on.
 

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
Q1 is a Npn transistor, so it will have 0.7V across it's B/E terminals when fully on, (Also there should be a resistor in series with the Base like 1K,)so when the light increases the voltage across R2 will rise until it reaches 0.7v, then Q1 will turn on. R2 alters the level of light at which the transistor turns on.
Thanks for your answer. I am still having difficulty understanding how things work. As light increases the LDR resistance decreases and the current can increase. Since the current increases, is it that once the maximum current that can go thru R2 then the remainder of the current has to go thru b ?
 

Tonyr1084

Joined Sep 24, 2015
9,744
R2 and the LDR form a voltage divider network. Depending on the level of light striking the LDR the voltage at the base of the transistor (which is a current dependent device). Still, current will find its way through the transistor to ground. R2 adjusts the trigger point where the LED should come on. Your circuit appears to be set up to light the LED with more and more light falling on the LDR. In other words, you've built a DAY light and not a NIGHT light.

Swapping the LDR and R2 should make it work so that if you cover the LDR the LED should light up.

The base of the transistor requires a minimum of current - I don't know off hand what that may be, I'm sure a data sheet will answer that question and I'll leave that up to you to find. When sufficient current (and voltage) is present and flowing through the BE junction (Base Emitter junction) the transistor will turn on, conducting from C to E. Current will flow through R1, through the LED, through the transistor and to ground (or negative).

I notice that your LED has a forward voltage of 2 volts. Using a 9 volt battery you need to account for that drop in voltage. There's also a voltage drop across the transistor (your spec sheet will tell you that number as well. I'l assume for the sake of argument it's 0.7 volts. You need to subtract those voltage drops from the battery voltage before you can determine the correct resistance for the LED.

If I take 2.7 volts from 9 I'm left with 6.3 working volts to light the LED. ASSUMING I want to power the LED with 10 mA (10 milli-amps or 0.01 amps) then I need to calculate the correct resistor. I got 630Ω. Your circuit as drawn - again, ASSUMING these voltage drops, 6.3 volts divided by 390Ω gives us 0.016 amps. I'm not sure your LED can handle that much current. You say it's 2 volts forward, so I'm again, assuming, you have a red LED. They are fussy about handling current, it's possible you burned it out. But I don't KNOW that. 16 mA is a lot for a red LED, but maybe not fatal. I don't know what you have and I don't have the specs on your stock.

I'd recommending swapping LDR & R2, and I'd recommend using 630Ω. You may have to use two resistors in parallel, but starting off with 10 mA might protect the next LED you put into your circuit (assuming you've already killed one LED).

Notice I've used the word "Assumed" a lot. That's because none of us can know all the factors relating to the materials you have on hand. Spec sheets are your best friend when engineering something. OR you can copy something someone else has done the engineering on, but what do you learn then?

Here's a link to something I found on the internet. http://www.instructables.com/id/Blue-Bawls-automatic-LED-light/
The designer used a 470Ω resistor, and assuming the forward voltage drops from the LED and transistor, I calculate a 13 mA current draw through the LED and transistor. I'd expect that to work just fine, even with a red LED. And it appears he's using a white superbright LED, typically around 3 volts forward. So recalculating 9 - 3.7 = 5.3 volts. 5.3 ÷ 0.01 = 530 ohms, so his super bright is running slightly brighter using a 470 ohm resistor. His forward current is 5.3 (volts) ÷ 470 (ohms) = 11.3 mA. Again, these are ASSUMED values on my part.

The main difference between his circuit and yours is the positioning of the LDR & R2. Swap those and go with a higher value resistor and see what happens. Only, for R1, don't go more than 1KΩ. At 1KΩ your forward current would be 5.3 mA, kind of low, and might not be visible.
 

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
Thanks Tony. It will take me a while to absorb/ try to understand the above on how things work. And thanks for the link to the Instructable.
The circuit as drawn should work. If it doesn't please post a photo of your breadboard layout.
Albert: No way I'm posting a picture of the breadboard! I won't even post a picture of my LM317 power supply that I 'built'. One of you, if you would see the picture, would probably have a heart attack if you saw my 'work'!!!!!!

Jan
 

EM Fields

Joined Jun 8, 2016
583
My knowledge is very limited and I learn in baby steps. I have built a LM317 power supply. I assembled on a breadboard the attached circuit. The LED did not light, battery got warm and I think also the NPN. I tried again using alligator clip jumpers with no luck. I tried the LED with resistor and that works. On my DMM I checked the NPN and it reads 22 HFE. I tried backwards and it reads 1 HFE so I think I have my c, b and e correct. I assume the NPN is just a 'gate' which permits c to go to e and that the amount of current 'supplied' to b will determine how much the gate opens. I assume the current from c goes to e and b also goes to e. My salvaged LDR reads from 40k to 200 ohms dependent on light intensity. I believe that a resistor just limits current but doesn't do anything with the voltage.
1) Are my assumptions correct?
2) What does R2 do? Can I eliminate it?
3) Are there any additonal tests that I can do to confirm NPN is still good?
4) What does "VEBO 9V in the specs mean?
5) If resistance of LDR drops below R1 (390 ohms) does 'gate' still open?

If suggestions/changes are made on the circuit I would appreciate also the why/how, in basic laymans terms, so I can try to understand how things work.
First, do you want the LED to illuminate with the LDR in the dark or with the LDR in the light?

1) Yes, except for the assumption that a resistor just limits current but doesn't do anything with the voltage.
See 2).

2) R2 is part of the voltage divider comprising the LDR, R2, and Q1's base-to-emitter diode, and is used to cause the voltage on Q1's base to vary as the LDR's resistance changes. You cannot eliminate it in the circuit you've shown and expect the circuit to work.

3) Yes. Connect the supply, R1, the LED, and Q1 as you've shown, but let Q1's base float. The LED shouldn't be lit. Then connect a 1000 ohm resistor between Q1's base and the 9 volt supply. The LED will light if Q1 is good.

4) That means that the base-to-emitter junction can be reverse- biased by no more than 9 volts if the collector is floating.

5) In the circuit you've shown, yes.
 
Last edited:
It is just a simple light switch circuit.
Try replace LDR with R 10K and R2 100k with 3.3K (this is to give the current bias for Transistor and make it to be "on" state)and you should see the LED "on" if not it means
you connect things wrongly.
 

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
I am now trying to learn "voltage divider". I did some calcs and if supply is 9v, LDR is 10K, R2 is 100K then Vout to b is 8.18v, and total current to b and R2 is .08 milliamps.
1) Calculations seem OK so far?
2) Is voltage across R2 9-8.18= 0.82v?
3) If I am OK so far, would the volts to b have to be approx 0.7v higher than the volts across R2 in order to let current flow from c to e?

If possible, any clarification using the 'water pressure/volume anology' would be appreciated.

In the mean time, thanks everyone for helping me along.
I hope I am making progress.

Jan
 

Tonyr1084

Joined Sep 24, 2015
9,744
Um, lets see:

9V ÷ (LDR + R2) = 9V ÷ 110,000 = 0.000082 amps. Lets shorten that to 0.082 milliamps. Lets shorten that to 82 microamps. Honestly, that's VERY VERY low current flowing through the whole thing. If your circuit is not working - that's probably why. And one should not forget to consider the current that flows through the BE junction to ground. 10KΩ is a low current to be pushing the transistor to turn on. If you eliminate R2 and just push voltage through the LDR into the base of the transistor, you're getting (9÷10,000) 0.9 mA (or 900 µA). That's still way too low to turn the transistor on. So it's no wonder why your circuit hasn't worked before.

Like I suggested before, swap the position of the LDR and R2. Use a 1KΩ resistor instead of a 10KΩ and you'll get more current through.

OK, now lets look at your values some more:

82 µA (that's microamps, not milliamps (AKA mA)), 10,000Ω x 0.000082 = 0.82 volts. There's a volt drop of 0.82 volts across the LDR. So at the transistor base junction you're seeing (9 - 0.82 =) 8.9 volts, but practically NO current. The transistor needs at least some voltage to turn on, but what really drives it is current. And with 82 µA flowing through the circuit, it's not going to turn on. Not enough current. Look at your spread sheet to see what minimum current is required to turn on the BE junction.

As far as your calculations, CLOSE. Across R2 the Vd (Voltage Drop) is 8.918 volts. The drop across the LDR is 0.082 volts. At least I HOPE I'm right. I've been known to be wrong before. If so, someone will be quick to flash a light on my error.
 

AlbertHall

Joined Jun 4, 2014
12,626
Note that in the original circuit the LDR is at the top of the divider and according to TS it goes down to 200Ω in the light. Thus there is plenty of current available to turn on the transistor.
 

Tonyr1084

Joined Sep 24, 2015
9,744
True Al. But the OP also asked if his math is correct. It looks like it is to me. Swapping them makes a night light that turns on in the dark. Hence, R2 on top supplying current to the BE junction. And when the LDR goes low (200Ω) it will shut the light off.

After all, what use is turning on a light in the light? Wouldn't you want it when there IS no light?
 

dl324

Joined Mar 30, 2015
18,339
I scanned the thread and didn't see any comment regarding when you want the LED to turn on. As connected, it will turn on when the LDR is exposed to light. Is that what you want?
I assume the NPN is just a 'gate' which permits c to go to e and that the amount of current 'supplied' to b will determine how much the gate opens. I assume the current from c goes to e and b also goes to e.
It will be easier for you to learn and communicate if you use the correct terminology. Bipolar Junction Transistors (BJTs) don't have a gate; they have a base.

A BJT is typically thought of as a current controlled device. Yes, you have to apply a voltage to the base for it to turn on; but current from the base is multiplied by the transistor beta.

When the correct polarity and magnitude voltage is applied to the gate of an enhancement mode MOSFET, a channel will form that will allow current to flow; in other words, it's a voltage controlled device.

BTW, the transistors you selected are overkill for turning on an LED.
 

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
The spec sheet says the emitter and collector cutoff currents are 1ma. I have gotten my circuit to work(LDR 10K, R2 at bottom 3K) however my main objective now is to understand the voltage divider circuit and the NPN turn on criteria. Some of the questions are repeats with the LDR at top of divider.

1) I understand that sufficient current is required at b to turn NPN/LED on. What drives the current? Is it the difference in voltages of R2 and b where the volts at b has to be higher than that at R2? Approximately minimum 0.7 v higher?
 

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
I scanned the thread and didn't see any comment regarding when you want the LED to turn on. As connected, it will turn on when the LDR is exposed to light. Is that what you want?
It will be easier for you to learn and communicate if you use the correct terminology. Bipolar Junction Transistors (BJTs) don't have a gate; they have a base.

A BJT is typically thought of as a current controlled device. Yes, you have to apply a voltage to the base for it to turn on; but current from the base is multiplied by the transistor beta.

When the correct polarity and magnitude voltage is applied to the gate of an enhancement mode MOSFET, a channel will form that will allow current to flow; in other words, it's a voltage controlled device.

BTW, the transistors you selected are overkill for turning on an LED.
DL324:
The transistors are overkill however, me being a newbie, I'm less likely to fry something when I mess up. I am presently trying to understand this circuit because I intend to modify it later on for something else. I do not want just to build circuits I would also like to at least understand them a bit. Please be patient with me and try to explain to me in very basic laymans terms. Now, in your reply above, you use the term MOSFET. Now I have to look this up to see what a MOSFET is. I'm not lazy but may become a bit overwhelmed and takes longer for me to learn. I like baby steps.
 

Tonyr1084

Joined Sep 24, 2015
9,744
Here's a link to some tutorials. This may answer your question, but without understanding the basics this may actually confuse you some. So even though I start with chapter six, lesson two, I'd recommend you read the whole tutorial. You'll find it helpful to firm up your base knowledge and beneficial to add anything you may have missed along the way. No road trip gets to where it's going without knowing the whole route.

http://www.allaboutcircuits.com/textbook/direct-current/chpt-6/kirchhoffs-voltage-law-kvl/

I COULD answer your questions about voltage dividers but there may be somethings assumed you know that perhaps you don't. And that wouldn't help you at all. I got to where I am with study. And at that I'm not very far along. Maybe a little further than you are, but really, I'm NOT the expert. So my reason for answering questions is more for practice for me than for answering your questions. If we both learn something along the way then we are both better for it.

Good luck in your studies.
 

Thread Starter

Jan Luthe

Joined Jan 10, 2015
89
Tonyr1084:
You are quite right. I have not studied. I just jumped right in. I briefly looked at your link and the tutorial is very explanatory and with just the brief viewing I realized that for some of the basics I already was off base. I'll start at chapter one and go from there. Thanks very much for the link.

Jan
 
Top