This Light Sensor Module module uses a photoresistor to detect the light intensity of the environment. The resistance of the sensor decreases when the light intensity of the environment increases. The amount of light detected can be read as an analog value or set to trigger a digital signal when a threshold is reached.
Connect the (+) and (-) to a 5V power supply and the output (S) pin to a analog or digital input on your robot's controller. Use the switch to select between analog and digital modes. When in digital mode, use the potentiometer to adjust the brightness threshold. The output on pin (S) will be high when the light is above the threshold and low when it is not. When in analog mode, the voltage output on pin (S) will vary between 0-5V depending on the amount of light detected.