Let's look at the following new sensor that we are dealing with. We will be using a LDR, which stands for a Light Dependent Resistor. A LDR works on the principle of photo-conductivity An LDR is shown in the following figure to familiarize you with it:
Image source : http://ninjagecko.co.uk/wp-content/uploads/2014/04/ldr.jpg
Photo conductivity is an optical phenomenon in which the material's conductivity (ability of the device to allow free flow of electrical charge) is increased when light is absorbed by the material.
The surface of the LDR is made of this photo-conductive material. Typically, the resistance (apposition to the free flow of electrical charge) of the LDR is very high when there is no light falling on it. When light strikes the surface of the LDR, the resistance drops because of photo-conductivity and allows more current to flow across it as shown in the following representation:
Image source: http://www.tnt-audio.com...