Variable resistance sensor – photocell
Capturing the data generated from light sensors is one of those satisfying and highly useful examples of physical computing. Some of you may have used light sensors—also known as CdS cells, photoresistors, and photocells—in your Arduino or Raspberry Pi projects. If so, this recipe will be a snap for you.
A photocell is a variable resistor, which in this case means that it varies its resistance according to the intensity of light exposed to it. The value of that variable resistance is turned into data, which in turn means the sensor functions as an effective measurement tool for ambient light. In this recipe, we show you how to read analog values captured from a light sensor using BoneScript along with an alternative Python script.
Note
CdS stands for Cadmium Sulfide, a compound that is non-ROHs compliant due to the cadmium, a chemical severely restricted in Europe as hazardous waste.
Getting ready
Rustle up the items in the list below...