First draw the circuit with positive power at the top negative at bottom, power currents generally flowing down, and signals feeding left to right. If you do that, two useful things happen. First, many circuits will be drawn similarly most of the time, and you learn to recognize them after a while. Second, you will confuse yourself and anyone you ask to help you less in what is actually going on and what you hooked up where.
Redrawing the schematic so as to better illuminate the circuit, we have:
It is obvious why the LED doesn't come on, or blips on for a short time at best. That is because it is in series with capacitor C1. Capacitors block DC current. There can't be any sustained current thru the LED.
What you probably intended was something like this:
This allows the capacitor to be like a small reservoir for the LED. It will keep the LED lit for a short time after the transistor is shut off.
With this circuit you can see how a little base current can control a larger collector current, which is how a bipolar transistor is used to make circuits with gain.
However, the values don't seem right for what I think you want this circuit to do. Most LEDs are rated for 20 mA maximum, so R2 should be sized to that this can't be exceeded. Let's say it's a green LED and drops 2.1 V at full current, and that the transistor would drop another 200 mV. That leaves 9.0V - 2.1V - 200mV = 6.7V accross R2. From Ohm's law, 6.7V / 20mA = 335Ω, which is the minimum resistance to keep the LED current within spec. Therefore use the next higher common value of 360 Ω. That still results in nearly 19 mA LED current. You won't notice the brightness difference between 19 mA and 20 mA even in a side by side comparison.
Another problem is that there isn't enough base current to reliably light the LED to its full value. Let's say the B-E junction drops 600 mV, then there is 8.4 V accross R1, which results in 84 µA. Let's say you can count on a gain of 50, so the minimum LED current is only 4.2 mA. That's enough to see it light up on your desk, but not to reach full brightness. In reality, you will likely get a gain higher than 50, so you will get more LED current, but relying on that is bad design.
Let's work backwards to see what R1 should be to fully turn on the LED. Again we'll assume the transistor has a gain of 50, and we've already said the maximum LED current is about 20 mA. 20mA / 50 = 400µA. With 8.4 V accross R1 from above and using Ohm's law again, the maximum R1 value is 8.4V / 400µA = 21kΩ, so the common value of 20 kΩ would make this a nice and reliable circuit if the intent is to light the LED to full brightness.
The circuit shown does not have the transistors doing anything useful, or even turning on at all.
When the push-button is pressed, a circuit is completed via the connection between base and emitter, straight to the resistor. This turns on the LED. Relase the button, that circuit is broken, LED goes off.
The base-emitter junction does not see any voltage to become forward biased and turn on. You can take out the transistors and it'll work the same.
Best Answer
The circuit is a bad one as the circuit takes MORE current from the power supply when the LED is off than when the LED is on.
LED off = 15 mA
LED on ~= 10 mA
My new version of the circuit shown below remedies this.
The transistor is now on when light is low and off when light is high.
Current flows in R2 only when the LED is on.
Off Current is approximately Vcc/R1.
R1 is now about 10k so off current is now about 0.5 mA (was 15 mA!)
With this LDR it is hard to get off current much lower. A different LDR with higher off resistance would allow lower off current.
Use of 3 x AA cells and some changes in resistor value would allow "standby" operation for about a year. Depending on LED current (varied by changing R2) the standby current is probably acceptable as the LED would drain AA cells in about
500 hours if I_LED is set to say 5 mA.
500 hours @ 10 hours.day =~ 2 months operation with AA cells.
5 mA would be enough for an adequate night light.
In the old circuit LDR1 and R1 form a voltage divider.
Current from Vcc flows through LDR1 and R1 to ground.
Remember the following for later (or ignore it for now) :-) :
As the same current I flows in each and as Ohms law tells us
V = I x R,
the voltage in each must be proportional to their resistances.
So V_LDR = I x Rldr
V_R1 = I x R1
V_LDR + VR1 = Vcc.
So Vlrd + V_R1 = Vcc = I x (R1 + R_LDR)
It follows that the voltage across R1 is proportional to its "share" of the total resistance so
V_R1 = R1/(R1 + R_LDR) x Vcc
This expression will be used below.
The transistor is on when Vbe (voltage between its base (point A) and its emitter (ground)) is more than about 0.7V.
It is off when the base is less than about 0.5V above its emitter.
Between Vbe of about 0.5 to 0.7V the transistor is partially on.
When the photo resistor = Light Dependent Resistor = LDR (LDR1) is inj darkness its resistance is high. The voltage divider formed by LDR1 and R1 causes a small voltage at point A and the transistor is off.
When the photo resistor is in bright light its resistance is low.
The voltage divider formed by LDR1 and R1 causes a voltage >> 0.7V to appear at point A and the transistor is on .
When the transistor is current flows from Vcc via R2 and the LED to ground and the LED lights.
An LED needs from about 2V to 3.5V to operate depending on the material used to make it.
When the transistor is on it shunts the current from R2 and the LED is off. When the transistor is on it's on-voltage is a few tenths of a volt.
New version - reversed transistor operation:
In this version current flows in R1 only when the LED is on.
Dark current is about 0.5 mA and can be designed to be lower.
In the new version of the circuit operation is reversed.
Th transistor is now on when it is dark and off when it is light.
The positions of R1 and LDR1 are swapped.
The LED is now between transistor collector and Vcc.
As light brightness increases LDR resistance decreases and Vbe falls - in the light Vbe is very low and the transistor is off, no current flows via R2 and the LED and the LED is off.
As light level falls the LDR resistance increases and Vbe rises. In the dark Vbe is high and the transistor is on.
Current flows from Vcc via R2, LED, transistor to ground.
The LED is on.
R1 value will need to be adjusted in the new circuit to work with the LDR characteristics. Actual value will vary with LDR but about 10k is probably right for the LDR shown here.