What is an LDR?
A light-dependent resistor (LDR) is a type of resistor that has high resistance in darkness and low resistance when exposed to light. The term "light-dependent resistor" is also called photocell, CdS cell, cadmium sulfide (CdS), or photoresistor.
Light Dependent Resistors are used in light level detection circuits. The resistor's resistance value changes depending on the light that is being detected. This property makes it perfect for applications where the circuit needs to detect when it is dark or light outside or any other type of ambient light.
As such, an LDR is commonly used to control lights or other devices based on the intensity of the light field at any given point in time - for example, it controls a rheostat (a motorized switch) based on its brightness.