Skip to Content

LDR Light Sensor Module 4 Pins With Analog & Digital Output

This module is used to measure the brightness of a light source by detecting ambient brightness and light intensity using a photosensitive resistor (LDR). It's highly sensitive to environmental light and compatible with various microcontrollers such as Arduino and ESP32.

Package Includes:

  • 1 x LDR Photosensitive Sensor Blue Module

15.00 AED 15.00 AED Tax Included
15.00 AED Tax Included

Not Available For Sale

This combination does not exist.

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

Features:

  • Detects ambient brightness and light intensity
  • Adjustable sensitivity via blue potentiometer
  • Operating voltage: 3.3V to 5V
  • Digital output (D0) and analog output (A0)
  • Power indicator (Red) and digital output indicator (Green)
  • Integrated LM393 wide range voltage comparator
  • Fixed bolt hole for easy mounting
  • Compact PCB size

 

Principle of Work:

The LDR is a high-resistance semiconductor made from cadmium sulfide in a zigzag pattern. When exposed to light, photons excite electrons from the valence band to the conduction band, reducing resistance and allowing current to flow. The stronger the light, the more electrons are excited, decreasing the resistance further.

Pinout:

LDR Module Pinout

Pin Description
A0 Analog Output
D0 Digital Output
VCC Power (3.3V–5V)
GND Ground

Applications:

  • Darkness and light detection
  • Automatic lighting systems
  • Light intensity measurement

Circuit Diagram:

Connect GND to GND, VCC to 5V, and A0 to analog input pin (e.g., A0).

LDR Module Circuit

Library:

No external library is required.

Sample Code:


int sensorPin = A5; // Declare analog pin

void setup() {
  Serial.begin(9600);
}

void loop() {
  int rawValue = analogRead(sensorPin);
  float voltage = rawValue * (5.0 / 1023) * 1000;
  float resistance = 10000 * (voltage / (5000.0 - voltage));
  
  Serial.print("Voltage value: ");
  Serial.print(voltage);
  Serial.print(" mV, Resistance: ");
  Serial.print(resistance);
  Serial.println(" Ohm");
  Serial.println("---------------------------------------");
  
  delay(500);
}

Upload the code and open the Serial Monitor. Point the sensor at a light source and observe the voltage and resistance changes.

Technical Details:

  • Operating Voltage: 3.3V–5V
  • Output Voltage: 0–5V
  • Adjustable sensitivity via onboard potentiometer
  • Dimensions: 3cm x 1.6cm
  • Built-in LM393 comparator

Resources:

  • Basic usage tutorial

Comparisons:

This module is more user-friendly than a raw LDR sensor as it includes an onboard comparator, digital and analog outputs, a fixed mounting hole, and does not require an external resistor voltage divider. Unlike simpler modules such as the KY-018, it can drive relays and other logic-level devices directly.