To expand the high light-level readings or for a different photocell, the pull down resistor value may need to change a bit to get the maximum analog voltage swing. Note that the analog voltage response is not linear (closer to a logarithmic response), but it is monotonically increasing.
The photocell from Sparkfun is very similar, but the datasheet lists a maximum dark value of 1MΩ. The resistance values and voltages shown in the table below are for the photocell from Adafruit. An A/D is then used to read the analog voltage value into the microprocessor. The typical way to interface this device is to hook it up to the 3.3 supply and use a 10K pulldown resistor to build a voltage divider circuit as seen in the schematic above. Schematic of Photocell hookup to an analog input This low cost device can measure approximate lighting levels and that is all that is needed in many applications. The resistance of the device changes based on the lighting level ( light levels are measured in lux). The easiest way to hookup this device is to use a voltage divider circuit connected to an analog input pin.
The resistance response can vary quite a bit from photocell to photocell (perhaps as much as 50%), so extremely accurate light level measurements are not possible without individual calibration for each photocell.
A common application would be to dim an LED automatically in a dark room and brighten it when it is in full daylight so that it is visible, or perhaps just turn on the light when it is dark. Photocells are more sensitive to red and green light levels and not very sensitive at all to blue. The resistance of this type of a photocell (also known as a photoresistor or light dependent resistor (LDR) ) varies with the light level on top of the sensor. The photocell seen below can cost under $1 and is available from Adafruit or Sparkfun. A low-cost photocell can be used to determine different lighting levels in a room. Many embedded devices need to detect light levels.