The Charan Light Dependent Resistor (LDR) Module is an electronic sensor that detects the intensity of light. As the ambient light level changes, the resistance across the LDR varies. This module is commonly used in applications such as light detection, automatic brightness control, and security systems. It is designed with three pins for easy integration into various circuits and projects.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Connect to 3.3V or 5V power supply |
2 | OUT | Analog output voltage |
3 | GND | Ground connection |
// Define the LDR module's output pin
const int ldrPin = A0;
void setup() {
// Initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
// Read the input on analog pin 0:
int sensorValue = analogRead(ldrPin);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// Print out the value you read:
Serial.println(voltage);
delay(1000); // Delay a second between readings
}
Q: Can I connect the LDR module directly to a digital input?
A: The LDR module provides an analog output, so it should be connected to an analog input for accurate readings. However, with proper thresholding, you can use it with a digital input for simple light detection.
Q: What is the lifespan of the LDR module?
A: The lifespan depends on the usage conditions but LDRs typically have a long operational life if used within their specified ratings.
Q: How do I adjust the sensitivity of the module?
A: Sensitivity can be adjusted by using a variable resistor (potentiometer) in series or parallel with the LDR, or by calibrating the software to respond to different voltage levels.
Q: Is the LDR module waterproof?
A: No, the standard LDR module is not waterproof. It should be protected from moisture and direct contact with water.