Arduino Tutorial 25: Understanding Photoresistors and Photo Detectors


In this lesson we learn how to use photoresistors. A photoresistor is a semiconductor material. In the darkness, it has almost no free electrons, so its resistance is very high. When light shines on the device, electron hole pairs are created, and these electron hole pairs are free to conduct electricity. This lowers the resistance of the material. The brighter the light, the more electron hole pairs that are generated, and hence the lower the resistance. Hence, the resistance of these devices is inversely proportional to the brightness of the light. By hooking a photoresistor in series with a fixed resistor, the current will change as the resistance of the sensor changes. This leads to a measurable change in the voltage across the series resistor. Hence, by measuring this voltage, you get a signal that is proportional to the light. This can be read via an analog pin on the Arduino, and then the arduino can be programmed to do different things based on the brightness of the light. In this simple project we have a red LED and a green LED. If the light is on, the green LED is turned on. If the light is off, the red LED is on.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

The nice digital voltmeter used in the lesson is available HERE.

Below is the code we developed in this video lesson above.