How LDR Sensor Works

How LDR Sensor Works


Unlock the mystical realm of Light Sensors! Prepare to delve into the inner workings of LDRs. But what exactly is an LDR? Allow us to guide you through its elusive nature and the mysteries of its purpose. Uncover the various LDR breeds and unravel the secrets to crafting your very own LDR sensor module. Explore its seemingly endless applications, witness how it harnesses the power of light to control and automate tasks. This treatise encompasses all that you need to know about these captivating LDR sensors.


The Light Dependent Resistor (LDR) Sensor is a basic tool that senses how much light is around. LDR working by responding to different wavelengths of visible and infrared radiation, with its resistance decreasing as the amount of ambient light intensity increases. The most common form consists of an exposed semiconductor, usually made from silicon or germanium, encased in plastic epoxy resin casing which helps protect it against damage due to environmental changes such as temperature fluctuations or moisture ingress into other areas where sensitive electrical components may reside.

When installed correctly, these sensors are capable of providing excellent accuracy when detecting changing lighting conditions within their operational range; they can also provide precise control over illumination for various applications ranging from industrial automation tasks through to entertainment systems. With proper calibration and maintenance this technology offers great reliability for a wide variety of applications - both indoors and outdoors!

What is an LDR?

LDR full form Light Dependent Resistor. LDR is a simple device that can be used to detect light levels and respond to light. When there's more light, its resistance goes down, and when there's less light, its resistance goes up. LDR light sensor is also known as a photoresistor, photocell, or photoconductor.

In the dark, it has a very high resistance, sometimes up to 1 MΩ, but when the LDR sensor is exposed to light, the resistance drops drastically, to as low as a few ohms, depending on the light intensity. The sensitivity of LDRs varies with the wavelength of the light applied and are nonlinear device. 

How does an LDR work?

Light Dependent Resistor (LDR) is a transducer that senses light intensity and converts it into electric current. It has two electrodes, one of which acts as the cathode while other acts as anode. The resistance of LDR decreases when exposed to certain level or amount of radiant energy such sunlight, artificial lights etc., thus producing small voltage proportional to the incident light intensity. This property makes them suitable for use in applications like solar panel controllers, security systems and variable lighting controls by changing their resistance value according to variations in ambient illumination conditions. Moreover they are cost effective compared with traditional passive infrared motion sensors due to their low power consumption features making them very popular among professionals from various industries especially automotive where these kinds of sensors play vital roles immensely contributing towards safety assurance measures onboard any vehicle type including cars & motorcycles alike!

The working of LDR sensor is based on the principle of photoconductivity. It states that when the light falls on the surface of an LDR, the conductivity of the material reduces. This is because the photons in the incident light have energy greater than the band gap of the semiconductor material used in the LDR. Making the electrons jump from the valence band to conduction.





These devices depend on the light, when light falls on the LDR then the resistance decreases, and the resistance increases in the dark. From the previous explanations, it can be deduced that when an LDR light sensor is kept in a dark place, its resistance is high and, when the LDR is kept in the light its resistance will decrease


The impact of light on an LDR


The impact of light on an LDR


Variation of LDR Resistance with Variation in Light Intensity:

If a constant “V’ is applied to the LDR, the intensity of the light increases, and the current increases. The figure below shows the curve between resistance Vs illumination curve for a particular light-dependent resistor. As per the property of LDRs, the amount of light entering the LDR is inversely proportional to the resistance of the sensor, and the graph is hyperbolic.


Resistance vs Light Intensity graph


Resistance vs Light Intensity graph


What is LDR used for?

Light Dependent Resistors are often used as light sensors. LDR sensor working when it is required to detect the presence and absence of light or to measure the light intensity. Examples are night lights and photography light meters. An interesting hobbyist application for light-dependent resistors is the line following robot, which uses a light source and two or more LDRs to determine the needed change of course. Sometimes, LDR sensor working in other sensing applications, for example in audio compressors, because their reaction to light is not instantaneous, and so the function of the LDR is to introduce a delayed response.

read our blog explaining the how does an ldr work, provides comprehensive information about Light Dependent Resistors (LDRs), explaining their working principle, types, advantages, disadvantages, and applications.

How LDR Works in Street Lights?

These systems help in the efficient monitoring and control of solar-powered lights installed in remote locations. It's really hard to keep these lights working well, especially in places where there's no electricity.

How LDR Works in Street Lights?

How LDR Works in Street Lights

This is where LDR sensor working. By utilizing radio communication operators can check on solar lights from far away. They can change settings and fix problems without going there, from adjusting brightness levels based on ambient light conditions or diagnosing technical faults. LDR light sensor make it easier and cheaper to manage solar lights over long distances.

LDRs don't just make things easier, they also make places safer and more secure. They save energy in important areas where good lighting is really needed.

What are the types of LDR?

The classification of LDR can be done based on linearity or based on the photosensitive materials used in the LDR light sensor. The most frequently used materials while designing LDR mainly include cadmium sulfide, thallium sulfide, cadmium selenide & lead sulfide.

The classification based on the material are:

1. Intrinsic photoresistor:

These types of photoresistors are made with pure semiconductors without any doping. Pure semiconductor materials like germanium and silicon are used. When the incident light having an adequate amount of energy falls on this then electrons gain that energy and get excited, which leads to a few of them going to the conduction band.

2. Extrinsic Photoresistor:

These types of photoresistors use doped semiconductors. This means some impurities are mixed with the semiconductor such as phosphorus to make this photoresistor.

Extrinsic light-dependent resistors are generally designed for longer wavelengths of light, with a tendency towards infrared (IR).


The classification based on the linearity are:

1. Liner type LDRs:

They are called photodiodes however in some application areas, this LDR working as photoresistors because of the linear performance they present & their operation.

2. Non-linear LDRs:

They are commonly used but their behavior does not depend on the polarity through which it unites.


LDR Sensor Module or Photoresistor sensor Pin Diagram


LDR Sensor Module or Photoresistor sensor Pin Diagram


LDR light sensor module is a low-cost digital sensor as well as an analog sensor module, which is capable of measuring and detecting light intensity. This sensor also is known as the Photoresistor sensor. This sensor has an onboard LDR (Light Dependent Resistor), which helps it to detect light. This sensor module comes with 4 terminals. 

Where the “DO” pin indicates the digital output pin and the “AO” pin indicates the analog output pin. The output of the module goes high during the absence of light and it becomes low in the presence of light. The sensitivity of the sensor can be adjusted using the onboard potentiometer.

The VCC pin indicates the +5 v power supply Input Pin and the GND indicates the ground (-) power supply Input Pin.


LDR Sensor Module or Photoresistor Sensor Hardware Overview

The LDR module mainly consists of the LDR, LM393 Comparators, Variable Resistor (Trim pot), Power LED, and output LED.

1. LDR or Light Dependent Resistor

LDR or Light Dependent Resistor is one type of variable resistor. The features and functions have been previously discussed in detail. 

2. Variable Resistor (Trim pot)

The LDR sensor module has an onboard variable resistor or potentiometer, this variable resistor has a 10k preset. It is used to set the sensitivity of the LDR module. When the preset knob is rotated the sensitivity of the light intensity detection is varied.

If the preset knob is rotated in the clockwise direction, the sensitivity of the light intensity detection will increase.  If the preset knob is rotated in the counterclockwise direction, the sensitivity of the light intensity detection will decrease.

 3. Power LED

This onboard LED indicates if the power supply is ON or OFF. When we turn on the sensor power supply this Green LED is also turned on. 

4. Output LED

When the LDR detects the light, the green LED is activated. When the sensor detects darkness, the green LED is turned off.


How to make an LDR Sensor Module

The Components Required to build an Light Dependent Resistor sensor module are IC: LM358 or LM393 (You can choose any one of these ICs), LDR or Light Dependent Resistor (R2), two 1K Resistor (R1, R4), 10K Resistor (R3), 10K Potentiometer (VR1), two 0.1 uF Ceramic Capacitor (C1, C2) and two Green LED (D1, D2).

Connect the components as shown in the circuit diagram to build an LDR light sensor module:

  1. +5 V power supply is taken 
  2. 1K resistor is connected in series with the LED
  3. Capasitor C1 is connected parallel to the above.
  4. PIN 2 is connected to a 10K Potentiometer VR1.
  5. The LDR which is parallel to capacitor C2 is connected to PIN 3.
  6. The output DO is taken from PIN 1 of the IC.
  7. The output AO is taken from PIN 3 of the IC.
  8. Detection LED in series with a resistor R4  is also connected to PIN 1.


Circuit Diagram of an LDR sensor module


Circuit Diagram of an LDR sensor module


How LDR Sensor Module Works

The Light Dependent Resistor sensor module has to be connected to a 5 V power supply. Then the threshold voltage needs to be set at the Non-Inverting input (3) of the IC according to the present light intensity by rotating the preset knob for setting the sensor sensitivity.

When light intensity increases on the surface of the LDR, the resistance of the LDR decreases. Which pimples that the maximum amount of voltage will be allocated across the resistor(R3). Therefore a Low amount of voltage from the LDR is given to the Inverting input (2) of the IC. Then the Comparator IC compares this voltage with the threshold voltage. In this case, the input voltage is less than the threshold voltage, so the sensor output goes LOW (0).

In contrast, when light intensity decreases (low/dark) on the surface of the LDR then the resistance of the LDR increases. Then the maximum amount of voltage will be allocated across the LDR (R2). Therefore, a High amount of voltage from the LDR is given to the Inverting input (2) of the IC. Then the Comparator IC compares this voltage with the threshold voltage. In this condition, this input voltage is greater than the threshold voltage, so the sensor output goes High (1).

Applications of an LDR Sensor:

LDR light sensor modules are used where there is a need to sense the presence and absence of light is necessary. These resistors are used as light sensors and the applications of LDR mainly include alarm clocks, street lights, light intensity meters, and burglar alarm circuits.

Nowadays, the lightening-up of highways is done through HID or LED lamps but, the energy consumption of these lights is high as well as there is no particular mechanism to turn on/off the lights from sunrise to sunset other than it being done manually. To overcome this problem, an alternative method can be the power conserving of intensity-controlled street lights using LDR.

Uses of LDR sensor

Light Dependent Resistors (LDRs) are widely used in various applications due to their ability to detect light intensity. Some key uses of LDRs include:

  1. Automatic Lighting Systems: LDRs are commonly employed in automatic lights that switch on and off based on ambient light levels, showcasing the practical uses of LDR in creating energy-efficient lighting solutions.
  2. Security Systems: LDRs play a crucial role in laser-based security systems and photo proximity switches. Their sensitivity to light variations makes them effective in detecting changes in the environment, enhancing security measures - a prime example of the uses of LDR in ensuring safety.
  3. Optical Circuit Design: LDRs find applications in the design of optical circuits, contributing to the development of various electronic devices and systems that rely on light-based functionalities, underscoring the versatile uses of LDR in electronics.
  4. Solar Street Lamps: LDRs are integral components in solar street lamps, assisting in the automatic control of lighting based on the available natural daylight, exemplifying the uses of LDR in sustainable and energy-conserving technologies.
  5. Smoke Detectors: LDRs are used in smoke detectors, where they respond to changes in light intensity caused by smoke, triggering alarms or alert systems - a critical application demonstrating the life-saving uses of LDR technology.


In this blog post, we have learnt that Light Dependent Resistors (LDRs) are essential components in various electronic applications and have wide-ranging use in industries such as lighting, photography, and security systems. The LDR sensor working principle is simple yet effective, making it possible to sense light levels and trigger events based on ambient light conditions. With the knowledge of different types of LDRs, one can choose the right one for their specific project needs.

If you appreciate our work and understand working of LDR sensor don't forget to share this post and leave your opinion in the comment box.


Please do check out other blog posts about Popular electronics


Make sure you check out our wide range of products and collections (we offer some exciting deals!)

Frequently Asked Questions


A Light Dependent Resistor, aka an LDR, is an enigmatic device that is deployed to gauge the magnitude of luminosity. It employs a mystical substance, frequently cadmium sulfide, that exhibits peculiar changes in its resistance in response to fluctuations in the illumination it's subjected to. As the illumination intensifies, the resistance of the LDR decreases in a paradoxical manner, and when the light recedes, the resistance rises accordingly. This bizarre phenomenon of resistance alteration can be monitored and analyzed to decipher the luminosity levels. The LDR is widely utilized in a plethora of applications that require the measurement of light, such as automatic lighting control systems, cameras, streetlights and more.


A Light Dependent Resistor, or an LDR, is a bewildering component that flummoxes conventional understanding of resistance. It's a resistor that's like a chameleon, adapting its resistance level according to the light it's exposed to. This resistor comprises of a semiconductor material that transforms into a conductor when illuminated, thus reducing its resistance. This drastic shift in resistance causes an upheaval in the current flow, which can be monitored and utilized to detect the existence or lack thereof of light. LDRs are widely utilized in lighting control systems, camera flash units, and light-sensitive alarms, providing a straightforward and economical solution for light sensing across various applications.

3. How to connect ldr sensor to Raspberry Pi zero 2 w?

Connecting an LDR sensor to a raspberry pi zero 2 w is relatively simple. First, you will need the appropriate cables and connectors for connecting your components. Depending on what type of output signal you're expecting from your LDR Sensor, either one or two GPIO pins of raspberry pi zero 2 w must be attached to it in order for communication between both devices to occur properly. To connect the other end of these cables into the IO port of your raspberry pi zero 2 w, use compatible male-female jumper wires (or jumpers). Once connected correctly, this can then enable values measured by the light level sensors as input signals which are interpreted via programmed logic instructions written into our code running on Raspbian OS system ready within––the single-board microcomputer unit: The Raspberry Pi Zero 2W! This integration allows us access real time digital information regarding ambient levels lighting conditions that could affect automated processes we create like robots or automatic online transactions based upon daylight recognition efforts instead again with manual human user interaction prompts required  – potentially saving valuable resource costs through automation while increasing workflow prosperity rates beyond traditionally not possible prior now being accomplished using more advanced engineering techniques combined here today available through utilizing industry standard miniaturization systems found inside emerging boundary pushing technologies such as experimental device ─ Raspberry PI zero 2w board systems!!

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.

You may also like to read