Detect presence, absence or approximate amount of light with these 2 Mega-Ohm Light Dependent Resistors (LDR). In bright light they have very low resistance. In total darkness they have very high resistance.
Connect one end of the LDR to 3V3 and the other end to your analog input. Also connect a 10 or 20 kOhm resistor between the non-3V3 leg and GND.
This will give you a voltage reading of 3.3V in bright light and ~0V in total darkness.