To measure the intensity of light in a room, you can use a single photocell and a capacitor connected to a Raspberry Pi with some Python code. A photocell is a light sensor that varies its resistance according to the intensity of light. The resistance decreases when it is in brighter surroundings.
As we've said, a photocell's resistance changes as the face is exposed to more light. When its dark, the sensor looks like an large resistor up to 10MΩ, as the light level increases, the resistance goes down. This graph indicates approximately the resistance of the sensor at different light levels.
A low-cost photocell, also known as a photoresistor or light dependent resistor (LDR), can cost under $1 and is used to determine different lighting levels in a room. It is available from suppliers like Adafruit or Sparkfun. The resistance of this type of photocell varies with the light level on top of the sensor.
How to Use a Photoresistor (or Photocell) - Arduino Tutorial: A photoresistor or photocell is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity. A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-acti…
Sensing Light The photocell used is of a type called a light dependent resistor, sometimes called an LDR. As the name suggests, these components act just like a resistor, except that the resistance changes in response to how much light is falling on them. This one has a resistance of about 50 kΩ in near darkness and 500 Ω in bright light.
For most light-sensitive applications like "is it light or dark out", "is there something in front of the sensor (that would block light)", "is there something interrupting a laser beam" (break-beam sensors), or "which of multiple sensors has the most light hitting it", photocells can be a good choice!
There are countless uses for a light sensor in a circuit. I will just name a few that I thought of while I was writing up this tutorial. Light Activated Alarm – I mentioned this one earlier, but you can use the LDR to detect when it starts to get light so you can sound an alarm to wake you …