The Photoresistor Light Sensor (LDR LM393) is a versatile electronic component designed to detect light intensity. This sensor module utilizes a light-dependent resistor (LDR) whose resistance varies with the amount of light falling on it. The LM393 comparator processes the signal, making it suitable for various light detection and brightness control applications. It operates within a voltage range of 3.3V to 5V, making it compatible with a wide range of microcontrollers, including the Arduino UNO.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Comparator | LM393 |
Light Sensor Type | Light-Dependent Resistor (LDR) |
Output Type | Digital and Analog |
Dimensions | 5mm LDR |
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V - 5V) |
2 | GND | Ground |
3 | DO | Digital Output (High/Low based on light intensity) |
4 | AO | Analog Output (Variable voltage based on light intensity) |
// Example code to read the digital and analog values from the LDR LM393 sensor
const int digitalPin = 2; // Digital pin connected to DO pin of the sensor
const int analogPin = A0; // Analog pin connected to AO pin of the sensor
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud rate
pinMode(digitalPin, INPUT); // Set digital pin as input
}
void loop() {
int digitalValue = digitalRead(digitalPin); // Read digital value
int analogValue = analogRead(analogPin); // Read analog value
// Print the values to the Serial Monitor
Serial.print("Digital Value: ");
Serial.print(digitalValue);
Serial.print(" | Analog Value: ");
Serial.println(analogValue);
delay(1000); // Wait for 1 second before next reading
}
No Output Signal:
Unstable Readings:
Incorrect Light Detection:
By following this documentation, users can effectively utilize the Photoresistor Light Sensor (LDR LM393) in their projects, ensuring accurate light detection and control.