The Light sensor module uses the GL5516 photoresistor to detect the light intensity of the environment. The resistance of the sensor decreases when the light intensity of the environment increases. The chip LMV358 is used as a voltage follower to enable you get a accurate data.
Application
- Connection Mode: A(Analog)
- Electronic toys
- Light-control switch
- Monitor
Part List
- 1 X Crowtail-Light Sensor
- 1 X Crowtail 3 Pin Cable
Wiki & External links
Features
- Easy to use light sensor module
- Resistance decreases as luminance increases
Specifications
- Voltage:5V
- Supply Current: 0.5-3mA
- Light resistance: 20KΩ
- Dark resistance: 1MΩ
- Response time: 20-30 secs
- Peak Wavelength: 540 nm
- Ambient temperature: -30~70℃
Usage
Follow these simple steps to build a Crowtail circuit using the light sensor:
1.Hardware Connection
2.Upload the following sample sketch to make the LED turn ON and OFF based on input from the light sensor:
const int light=A0; const int ledPin=5; int sensorValue = 0; const int thresholdvalue=100; //The threshold for which the LED should turn on. void setup() { pinMode(ledPin,OUTPUT); //Set the LED on Digital 5 as an OUTPUT Serial.begin(9600); //Start the Serial connection } void loop() { sensorValue = analogRead(light); if(sensorValue<thresholdvalue) { digitalWrite(ledPin,HIGH); } else { digitalWrite(ledPin,LOW); } Serial.print("light sensor = " ); Serial.println(sensorValue); delay(500); }
3.When the light value lower than 100,the LED will lights up:
نقد و بررسیها
هیچ دیدگاهی برای این محصول نوشته نشده است.