
CdS (Cadmium Sulfide) photo-resistors are commonly used for detecting light levels. Their resistance varies considerably depending on the intensity of light striking them. They are common, fairly cheap and easy to use. So what’s the problem? They are becoming hard to find. The reason is because of the RoHS directive. Since CdS cells contain cadmium, a toxic heavy metal, this important component is no longer stocked by major electronics distributors. The good news is that not only is there an excellent alternative, but it is more versatile and vastly cheaper.
If you guessed photo-diode you are close, but even better is the humble LED. If you are building an analog circuit, then you will be limited to photo-diodes and photo-transistors due to their greater sensitivity. If, however, you are building a micro-controller based circuit such as a PIC or Arduino, then you can use a simple LED to achieve the same end and even more.