Author Options:

Help with simple transistor circuit.? Answered

I want the LED to turn on when it's dark. But  it remains on and taking out the LDR doesn't affect it. I couldn't post a picture but i made a replica in Fritzing

EDIT: The transistor is 3904 NPN.



Best Answer 5 years ago

The LDR does not have a low enough resistance to rob the transistor base
and shut off the transistor.

Your circuit is correct, but try adding one or two diodes as shown.
this raises the voltage to turn off the transistor base.

There are LDRs that can go really low ohms but that can overcurrent
destroy them  so you generally only find them in power LDRs for low

You could also try an emitter follower ckt.
Ask if you want me to show you.



shayan do u make this project

For quick experimentation try removing 10k resistor from where it is. Then the voltage divider part (the left "column" on that circuit diagram) will have completely adjustable upper leg (potentiometer) in area from 0 to 10k as opposed to from 10k to 20k now.

If in that case the led stays off no matter how high the resistance of the pot, then you need smaller than 10k for the upper leg (same spot where the 10k is now).
If insted you have to turn the pot very low resistance then the voltage divider might be eating up too much current and it would be reasonable to add resistor into the lower leg (next to LDR). Try 10k or if that does not work, then less.

The theory behind it is that voltage divider (on this schematic 10k + 10k pot in upper leg and LDR in lower leg) divide supply voltage e.g there is some voltage inbetween 0 and supply voltage inbetween upper and lower leg - in this case the wire that is attached to base of transistor. The specific value of that voltage is proportional to the lower leg to whole voltage divider resistance. For example if the supply voltage is 5V, upper leg 10k, lower leg 10k, then the resulting voltage will be 5V*10k/(10k+10k) = 2.5V. If the supply voltage was 3V, upper leg 10k, lower leg 5k, we get 3V*5k/(10k+5k) = 1V.

Now in this circuit LDR's resistance varies depending on the light conditions. At some point the voltag divider resulting voltage reaches the threshold on transistor base for turning on the transistor. If the lower leg all the time has too low resistance compared to upper leg (or actually the sum resistance of whole voltage divider) then the transistor is always on and LED is always on as you described your problem. To solve this you must adjust upper leg or both resistances so that the LDR's light dependent resistance change would have it's effect just in right section of the voltage divider's resistances ratio.

Hope this makes some sense.

Your heart even alien heart is in the right place,

But you are wrong about taking out that resistor.
If anything you should double the resistance.

Look at the Situation
  • The author Hafiz has an LED that won't shut down !
  •  Increasing the voltage before base current flows is one way.
  • Increasing the resistance to reduce current is another way.
  • The NPN transistor works on current as shown in my 3D Pic.
  • This ckt needs to starve base current when background light is on.
  • The LDR is there to rob current away from the base when background light is on.

You are right, for some reason I was thinking along the lines of transistor not switching on when instead the problem was it not switching off. Base voltage has to be reduced not increased in this case of course. So adding resistance in the upper leg is the thing to do.

Sorry for misinformation in that part.

Thanks :)

You are very well written in your second language.

The LDR is high resistance when dark.

The base current is set by the resistors

To conduct well your transistor needs around 1 volt at the base and whatever base current it can take.

You can use this information and ohms law to calculate the resistor value you need to make it work.

In essence you resistor & variable resistor are too large BUT you should not exceed your max base current or your transistor will expire.


5 years ago

The LDR is ineffective..... removing the LDR guarantees the LED stays on.



5 years ago

Your emitter follower is counter intuitive but because the
load = LED & Resistor is in series with both Base and Collector.

The base needs a higher voltage to turn on.



Removing the LDR doesn't affect anythnig, because all the base current comes through your resistors and the transistor is turned on.