
Light Dependent Resistor (LDR) 5mm Photoresistor
The 5mm Light Dependent Resistor (LDR) is a type of photoresistor that changes its resistance based on the amount of light it receives. It is an essential component in various electronics projects, especially when detecting light intensity. The LDR is typically used in light sensing circuits, automatic lighting systems, and various other applications in which light levels need to be monitored.
Specifications
- Size: 5mm diameter
- Resistance: Typically between 1kΩ and 10MΩ, depending on light exposure
- Operating Voltage: Typically 3V to 5V DC
- Response Time: Relatively fast response time, typically in the range of milliseconds
- Light Sensitivity: Sensitive to visible light, with resistance decreasing as the light intensity increases
Applications
The 5mm LDR is used in a wide variety of applications, including:
- Light Sensing Circuits: Used in projects where light levels need to be detected and measured.
- Automatic Lighting: In light-based systems, it automatically turns lights on or off based on the surrounding light conditions.
- Clocks and Timers: Can be used to detect the time of day or ambient light levels in clocks and timers.
- Photography: In light meters used by photographers to measure ambient light.
- Solar Power Systems: Used in solar panel tracking systems to follow the light source.
Pinout
The LDR typically has two leads (pins) that are used for the following connections:
- Pin 1: One side of the LDR connects to the power supply (VCC).
- Pin 2: The other side connects to the input of a circuit, such as an analog-to-digital converter (ADC) or microcontroller input.
How It Works
The LDR operates on the principle that its resistance decreases when exposed to light. In the dark, the resistance is high, and as light intensity increases, the resistance decreases. This change in resistance can be used to control devices like LEDs, fans, or relays based on light conditions.
Sample Code (Arduino)
This sample Arduino code reads the LDR's resistance (which is inversely related to light intensity) and uses it to control the brightness of an LED:
// Sample code to control LED brightness based on LDR const int LDRPin = A0; // Pin connected to LDR const int LEDPin = 9; // Pin connected to LED void setup() { pinMode(LEDPin, OUTPUT); Serial.begin(9600); } void loop() { int LDRValue = analogRead(LDRPin); // Read LDR value Serial.println(LDRValue); // Output LDR value to serial monitor // Map LDR value to LED brightness int brightness = map(LDRValue, 0, 1023, 0, 255); // Adjust LED brightness analogWrite(LEDPin, brightness); delay(100); // Delay for stability }
Installation Tips
- Ensure proper wiring for correct operation. Typically, one side of the LDR should be connected to the ground, while the other should connect to the analog pin or circuit input.
- Use a pull-down resistor (typically 10kΩ) for better stability in the circuit.
- Keep the LDR in an open area where it can receive enough light for proper functionality in your project.
- If used for automated lighting systems, make sure to place the LDR in a spot where it can effectively sense ambient light without obstruction.