Introducing the photoresistor (photocell)
Did you know that the RasPi does not have an analog-to-digital (A2D) convertor integrated inside? This is the biggest drawback while using microprocessor-based development boards such as the RasPi. But do not worry; we have a technique to hack it. A photocell or light-dependent resistor (LDR) is a light-controlled variable resistor. The resistance of an LDR decreases with increasing incident light intensity. More the light, lesser the resistance, and vice versa. The variations in the values vary by about 45 percent, and they shouldn't be used to try to determine precise luminance levels in candela or lux.
Appearance wise, the sensor has a clear shiny, thin surface of glassy material on the top and has two terminals. On the top, there is a photosensitive semiconductor material that is sensitive to light, and we can see the tracks routed in a zigzag pattern.
It's time to introduce you to some mathematics of resistors and capacitors. Understanding...