Stufin
Home Quick Cart Profile

LDR Sensor Module

Buy Now on Stufin

The LDR Sensor Module operates as follows

  • The LDR is exposed to light, which causes a change in its resistance.
  • The voltage divider circuit consisting of the LDR and a fixed resistor converts the change in resistance into a proportional analog voltage signal.
  • The output voltage signal from the voltage divider circuit is proportional to the light intensity.
  • The output signal can be connected to a microcontroller or other control systems for further processing and decision-making.

Key Features

  • High Sensitivity: The LDR Sensor Module is highly sensitive to light, allowing it to detect even small changes in light intensity.
  • Wide Dynamic Range: The module can measure light intensities ranging from 0 to 10,000 lux, covering a wide range of lighting conditions.
  • Simple and Compact Design: The module has a compact design, making it easy to integrate into IoT projects and other applications.
  • Low Power Consumption: The module operates at a low voltage (typically 3.3V to 5V) and consumes minimal power, making it suitable for battery-powered devices.
  • Analog Output: The module provides an analog output signal, allowing for easy integration with microcontrollers and other control systems.
  • Easy to Use: The module requires minimal setup and calibration, making it easy to use for both hobbyists and professionals.

Technical Specifications

Supply Voltage

3.3V to 5V

Output Signal

Analog (0-3.3V or 0-5V)

Sensitivity

0.1 lux to 10,000 lux

Operating Temperature

-20C to 80C

Dimensions

20mm x 15mm x 5mm (L x W x H)

Applications

  • Automation systems
  • Robotics
  • IoT projects
  • Home automation
  • Light meters
  • Security systems
  • Environmental monitoring
The LDR Sensor Module finds applications in various areas, including

Conclusion

The LDR Sensor Module is a versatile and easy-to-use component for measuring light intensity in IoT projects and other applications. Its high sensitivity, wide dynamic range, and compact design make it an ideal choice for a wide range of applications.

Pin Configuration

  • LDR Sensor Module Documentation
  • Overview
  • The LDR (Light Dependent Resistor) Sensor Module is a widely used component in IoT projects that measures the intensity of light in the surrounding environment. The module consists of an LDR sensor, a voltage regulator, and other supporting components. This documentation provides a detailed explanation of the pins on the LDR Sensor Module and how to connect them.
  • Pin Description
  • The LDR Sensor Module typically has 3-4 pins, depending on the specific variant. Here's a breakdown of each pin:
  • 1. VCC (Power Supply Pin)
  • Function: Supplies power to the module
  • Voltage: Typically 3.3V or 5V (check the specific module documentation for the recommended voltage)
  • Connection: Connect to the positive terminal of the power source (e.g., Arduino VCC pin)
  • 2. GND (Ground Pin)
  • Function: Provides a common ground reference for the module
  • Connection: Connect to the negative terminal of the power source (e.g., Arduino GND pin)
  • 3. OUT (Analog Output Pin)
  • Function: Outputs an analog voltage signal proportional to the light intensity
  • Signal: Analog voltage (typically 0-5V or 0-3.3V)
  • Connection: Connect to an Analog Input pin on a microcontroller (e.g., Arduino A0-A5 pins)
  • 4. EN (Enable Pin) (Optional)
  • Function: Enables or disables the module (some modules might not have this pin)
  • Signal: Digital signal (High or Low)
  • Connection: If available, connect to a digital output pin on a microcontroller (e.g., Arduino digital pins)
  • Connection Structure
  • Here's an example of how to connect the LDR Sensor Module to an Arduino Board:
  • 1. Connect the VCC pin of the LDR Sensor Module to the 5V pin on the Arduino Board.
  • 2. Connect the GND pin of the LDR Sensor Module to the GND pin on the Arduino Board.
  • 3. Connect the OUT pin of the LDR Sensor Module to any available Analog Input pin on the Arduino Board (e.g., A0).
  • 4. If the module has an EN pin, connect it to a digital output pin on the Arduino Board (e.g., D13).
  • Important Notes
  • Make sure to check the specific datasheet or documentation for the LDR Sensor Module you are using, as the pinouts and voltage requirements might vary.
  • Use a voltage regulator if the LDR Sensor Module requires a specific voltage that's different from the microcontroller's power supply.
  • The output voltage of the LDR Sensor Module can be affected by the surrounding environment, so ensure proper shielding and wiring to minimize noise and interference.
  • By following these guidelines, you can successfully integrate the LDR Sensor Module into your IoT project and start measuring light intensities.

Code Examples

LDR Sensor Module Documentation
Overview
The LDR (Light Dependent Resistor) Sensor Module is a photosensitive device that measures the intensity of light in its surroundings. The module converts the light intensity into an analog voltage signal, allowing microcontrollers to read and process the data. This module is widely used in various IoT applications, including ambient light sensing, object detection, and automatized lighting systems.
Pinout and Connections
The LDR Sensor Module typically consists of three pins:
VCC: Power supply pin (typically 3.3V or 5V)
 GND: Ground pin
 OUT: Analog output pin
Example 1: Basic Light Intensity Measurement with Arduino
In this example, we will connect the LDR Sensor Module to an Arduino board to measure the ambient light intensity.
Hardware Connection:
Connect the VCC pin of the LDR Sensor Module to the 5V pin on the Arduino board
 Connect the GND pin of the LDR Sensor Module to the GND pin on the Arduino board
 Connect the OUT pin of the LDR Sensor Module to any analog input pin (e.g., A0) on the Arduino board
Code:
```c
const int ldrPin = A0;  // Analog input pin for LDR sensor
int lightIntensity = 0;
void setup() {
  Serial.begin(9600);
}
void loop() {
  lightIntensity = analogRead(ldrPin);
  Serial.print("Light Intensity: ");
  Serial.println(lightIntensity);
  delay(1000);
}
```
Explanation:
In this example, we read the analog voltage signal from the LDR Sensor Module using the `analogRead()` function and store it in the `lightIntensity` variable. The value ranges from 0 (complete darkness) to 1023 (maximum brightness). We then print the light intensity value to the serial monitor using `Serial.println()`.
Example 2: Automatic LED Control with Raspberry Pi
In this example, we will connect the LDR Sensor Module to a Raspberry Pi to control an LED based on the ambient light intensity.
Hardware Connection:
Connect the VCC pin of the LDR Sensor Module to the 3.3V pin on the Raspberry Pi
 Connect the GND pin of the LDR Sensor Module to the GND pin on the Raspberry Pi
 Connect the OUT pin of the LDR Sensor Module to any analog input pin (e.g., GPIO 17) on the Raspberry Pi
 Connect an LED to a digital output pin (e.g., GPIO 18) on the Raspberry Pi
Code:
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define LDR sensor pin and LED pin
ldrPin = 17
ledPin = 18
# Set up LDR sensor pin as input
GPIO.setup(ldrPin, GPIO.IN)
# Set up LED pin as output
GPIO.setup(ledPin, GPIO.OUT)
while True:
    # Read LDR sensor value
    ldrValue = GPIO.input(ldrPin)
    
    # If light intensity is low, turn on the LED
    if ldrValue < 500:
        GPIO.output(ledPin, GPIO.HIGH)
    else:
        GPIO.output(ledPin, GPIO.LOW)
    
    # Wait for 1 second before taking the next reading
    time.sleep(1)
```
Explanation:
In this example, we use the `RPi.GPIO` library to interact with the Raspberry Pi's GPIO pins. We read the LDR sensor value using `GPIO.input()` and store it in the `ldrValue` variable. If the light intensity is low (i.e., `ldrValue` is less than 500), we turn on the LED by setting the `ledPin` high using `GPIO.output()`. Otherwise, we turn off the LED. The `time.sleep(1)` function is used to introduce a delay between readings.