I have made, what I thought would be a simple circuit, an LED night light. The power source is 5V@1A. The schematic is below:
The intended goal is to increase the brightness of the LED, as light decreases. The LED should be completely off when the light level is high. When I built the circuit, I was very surprised to find out that it functioned in the COMPLETE OPPOSITE way. When I pointed the LDR towards a light source, it increased the brightness of the LED as it turned closer to the light source. If I put my finger on the LDR so that almost no light can enter, the LED looks as if it is completely off. Why is this happening? I suspect it has something to do with the voltage divider, whose output is connected to the base of the 2n3904.
I have calculated the value of R1 using the voltage divider equation. I will post my calculations soon(within the next couple of hours), my final result of the inequality that I solved(will post my steps soon)is 1kΩ
I tested the LDR and here is how the resistance changes in different cases: 1.Almost complete darkness-0.83MΩ 2.Dark-0.44MΩ 3.In between-8.66KΩ 4.Kind of Bright- 2.45kΩ 5.Bright-1.23kΩ 6.Very bright-1.21kΩ
The LED has a forward voltage drop of 2V. The peak brightness of the LED is achieved with a current of 9.09mA.
In case 1, full brightness of LED should be achieved. In case 2. Half brightness of LED should be achieved In case 3.Very little emission from the LED. In cases 4-6, the LED should be off.
It seems as if my calculation(which I will post soon) for the fixed resistor of the light dependent voltage divider is wrong. How do I calculate R1 correctly.Sorry if my question is a bit vague, if you need any details please ask. Thanks.
Edit: The positions of the LDR and R1(the 1.1k resistor) are now switched in the actual circuit. After doing this, the LED is always on. I will calculate the value of R1 again.