An LDR sensor is an analog input sensor that consists of a variable resistor whose resistance varies depending on the amount of light falling on its surface. When there is no light in the room, the resistance of the LDR sensor is HIGH (up to 1 M ohm) and in the presence of light, the resistance of the LDR sensor is LOW. The LDR sensor consists of two pins. These pins do not have positive and negative polarity. We can use any pin as a data or ground pin and because of this, the LDR sensor is sometimes referred to as a special type resistor. The image of the LDR sensor is shown in the following photo:
Since ...