“Be a bright spark, lights off till it’s dark!” sometimes we forget to turn off the lights and waste electricity and you must have also seen street light turned on in the day. We have already built few circuits on where lights turn off automatically if it is bright outside and turns ON if it is dark outside. But this time, in this circuit we are not only turning On and off lights based on light conditions but also varying the intensity of light according to outside light conditions. Here we have used LDR for decreasing or increasing the brightness of the 1 watt Power LED automatically.
- Arduino UNO
- Resistor (510, 100k ohm)
- Capacitor (0.1uF)
- Transistor 2N2222
- 1 watt Power LED
- Connecting wires
How it Controls the Light Intensity Automatically:
As per the circuit diagram, we have made a voltage divider circuit using LDR and 100k resistor. The voltage divider output is feed to the analog pin of the Arduino. The analog Pin senses the voltage and gives some analog value to Arduino. The analog value changes according to the resistance of LDR. So, if is dark over the LDR, its resistance get increased and hence the voltage value (analog value) decreases. Hence, the analog value vary the PWM output or the duty cycle, and duty cycle is further proportional to intensity of light of power LED. So the light over the LDR will automatically control the intensity of Power LED. Below is the flow diagram how this will work, upside arrow sign is indicating “increasing” and downside arrow sign is indicating “decreasing”.
Intensity of light (on LDR) ↓ – Resistance↑ – Voltage at analog pin↓ – Duty cycle (PWM)↑ –Brightness of Power LED ↑
If its full bright outside (when analog value increases more than 500) the power LED turns off.
This is how you can control the intensity of light automatically using LDR.