Anyway a simple LDR is by far more reliable and is as cheap as an LED, you can connect the LDR in series with a 1K resistor and use it as a voltage divider.

Regards.