Typically ranges from 1 k to 10 k, depending on the light intensity
Typically ranges from 1 k to 10 k, depending on the light intensity
Up to 100 mW
-20C to +70C
Peak sensitivity at 550 nm (yellow-green light)
Typically <10 ms
5 mm (diameter) x 3 mm (height)
Applications and Use Cases
Automatic lighting systems
Smart home automation
Environmental monitoring (e.g., measuring light intensity in greenhouses)
Robotics and autonomous systems
Security systems (e.g., motion detection)
IoT projects requiring ambient light sensing
Precautions and Handling
Handle the component with care to avoid mechanical stress and damage.
Avoid exposing the LDR to direct sunlight or high-intensity light sources, as this may lead to damage or degradation.
Store the component in a cool, dry place, away from direct sunlight.
Use a voltage regulator and a current-limiting resistor to prevent overvoltage and overcurrent.
By following proper handling and integration guidelines, the LDR 5mm Metal Housing (Pack of 5) can provide accurate and reliable light sensing capabilities in various IoT and electronic applications.
LDR 5mm Metal Housing (Pack of 5) Component DocumentationOverviewThe LDR 5mm Metal Housing (Pack of 5) is a light-dependent resistor (LDR) component housed in a 5mm metal casing. LDRs are photocells that change their resistance in response to changes in light intensity. This component is commonly used in various IoT projects, such as ambient light sensors, automatic lighting systems, and robotics.PinoutThe LDR 5mm Metal Housing has two pins:Pin 1: One end of the LDR element
Pin 2: The other end of the LDR elementSpecificationsOperating voltage: 5V
Dark resistance: 10M
Light resistance: 1k
Response time: 10-20ms
Metal housing diameter: 5mmCode Examples### Example 1: Basic Ambient Light Sensor with ArduinoThis example demonstrates how to use the LDR 5mm Metal Housing to create a basic ambient light sensor with an Arduino board.```c
const int ldrPin = A0; // LDR connected to analog input A0
const int LEDPin = 13; // LED connected to digital output 13void setup() {
pinMode(ldrPin, INPUT);
pinMode(LEDPin, OUTPUT);
}void loop() {
int ldrValue = analogRead(ldrPin);
int brightness = map(ldrValue, 0, 1023, 0, 255);
analogWrite(LEDPin, brightness);
delay(20);
}
```In this example, the LDR is connected to analog input A0, and an LED is connected to digital output 13. The Arduino reads the LDR value, maps it to a brightness value, and adjusts the LED's brightness accordingly.### Example 2: Automatic Lighting System with Raspberry Pi (Python)This example demonstrates how to use the LDR 5mm Metal Housing to create an automatic lighting system with a Raspberry Pi and Python.```python
import RPi.GPIO as GPIO
import time# Set up GPIO mode
GPIO.setmode(GPIO.BCM)# Define LDR and relay pin numbers
ldr_pin = 17
relay_pin = 23# Set up LDR pin as input and relay pin as output
GPIO.setup(ldr_pin, GPIO.IN)
GPIO.setup(relay_pin, GPIO.OUT)while True:
ldr_value = GPIO.input(ldr_pin)
if ldr_value == 0: # LDR is in the dark
GPIO.output(relay_pin, GPIO.HIGH) # Turn on the light
else:
GPIO.output(relay_pin, GPIO.LOW) # Turn off the light
time.sleep(0.5)
```In this example, the LDR is connected to GPIO pin 17, and a relay module is connected to GPIO pin 23. The Python script reads the LDR value and controls the relay to turn on or off the light based on the ambient light conditions.Note: These examples are for illustrative purposes only and may require additional components and setup for a complete working project.