DESCRIPTION OF Servo and LDR :

In this project ( Servo and LDR ), we are trying to check the intensity of Light and according to that, we are making an analog dial which has low to high marking.

Servo attached to Arduino will indicate range according to the input of Light on LDR sensor.

Wouldn’t it be cool if we could eliminate darkness? In this Arduino project, I have posted a very simple project that focuses on eliminating darkness. Whenever a room gets dark due to a fused bulb or any other factors, a light bulb automatically turns on. You can even use this as an emergency lighting system. Use it to automatically turn a light on when there isn’t sufficient light in a room.

In order to detect the intensity of light or darkness, we use a sensor called an LDR (light dependent resistor). The LDR is a special type of resistor that allows higher voltages to pass through it (low resistance) whenever there is a high intensity of light, and passes a low voltage (high resistance) whenever it is dark. We can take advantage of this LDR property and use it in our DIY Arduino LDR sensor project.

How Does It Work? 

This system works by sensing the intensity of light in its environment. The sensor that can be used to detect light is an LDR. It’s inexpensive, and you can buy it from any local electronics store or online.
The LDR gives out an analog voltage when connected to VCC (5V), which varies in magnitude in direct proportion to the input light intensity on it. That is, the greater the intensity of light, the greater the corresponding voltage from the LDR will be. Since the LDR gives out an analog voltage, it is connected to the analog input pin on the Arduino. The Arduino, with its built-in ADC (analog-to-digital converter), then converts the analog voltage (from 0-5V) into a digital value in the range of (0-1023). When there is sufficient light in its environment or on its surface, the converted digital values read from the LDR through the Arduino will be in the range of 800-1023.
Arduino LDR Sensor working

Furthermore, we then program the Arduino to turn on a relay. Correspondingly, turn on an appliance (light bulb), when the light intensity is low (this can be done by covering the surface of the LDR with any object), that is, when the digital values read are in a higher range than usual.

Arduino LDR Sensor Connections 

First, you need to connect the LDR to the analog input pin 0 on the Arduino. You have to use a voltage divider configuration to do this. The connection diagram for the Arduino is as given below.