Photocell Hookup Guide

Pages
Contributors: jimblom
Favorited Favorite 13

Example Circuit

To measure the photocell's resistance with a microcontroller's ADC, we actually have to use it to generate a variable voltage. By combining the photocell with a static resistor, we can create a voltage divider that produces a voltage dependent on the photocell's resistance.

A static resistor value between 1kΩ and 10kΩ should pair well with the photocell. If you have a resistor kit, you may want to introduce some trial-and-error to hone in on that perfect static resistance.

In this example, we'll use a 4.7kΩ resistor to divide voltage with the photocell. Here's the example circuit:

Example circuit fritzing diagram

And a schematic:

Example circuit schematic

The 4.7kΩ resistor on the ground side, and the photocell on the 5V side, means as the cell's resistance increases (meaning the sensor's surroundings are getting darker) the voltage on A0 will decrease.