Photo Resistor
Photo Resistors or CdS (Cadmium Sulfide) cells are light sensitive devices. These devices behave like a resistor and typically decrease in resistance as it is exposed to light. They are also refered to as light dependant resistors.
This type of sensor is typically much slower than a photodiode at detecting changes in light, but it's benefit is in it's low cost and it requires only one resistor rather than a complicated photodiode amplifier.
Photo resistors usually have a response in milliseconds so for normal day/night detection it works very well.
To wire a photo resistor you simply need to attach it in series with a resistor and hook the chain up to a voltage rail and a ground rail. Then you measure at the center node as if it were a voltage divider using the formula
<math>v=vcc*R2/(R1+r2)</math>