LDR(Light Dependent Resistor) also known as photoresistor is a resistor whose resistance varies with the amount of light falling on it. This is a small size LDR with a size of 5mm.
To use, connect one pin of the photo cell (either one, it has no polarity) to power (for example 5V) and the other side to your microcontroller's analog input pin. Then connect a 10K pull-down resistor from that analog pin to ground. The voltage on the pin will be 2.5V or higher when its light out and near ground when its dark.
This sensor can be used for making a light sensor, color sensor, object sensor, line sensor, etc .