LDR sensor working principle diagram showing photoconductivity effect

LDR Sensor: Working Principle & Key Applications

IEM Robotics

Table of Content

You walk into a room, and the lights just turn on! You drive past a street lamp that automatically comes on, knowing it is nighttime! You take a photo, and the camera automatically figures out that the light has to be right, and there is no input needed. All of these simple events are driven by this single, cheap, and small device: the LDR sensor! The ldr sensor , which is an abbreviation for the light-dependent resistor, is a passive electronic component whose purpose is to change its resistance value when light of different intensity levels hits its surface. It doesn't involve moving parts, complicated programs, or anything too complex; just a relationship between light and resistance.

Where the LDR gets particularly neat is its incredible cheapness and ease of use! Whether you are a student learning the ins and outs of electronics and building your first Arduino project, a home automation enthusiast designing a home automation system, or even an engineer trying to design and construct a control system within a massive manufacturing plant, the LDR just seems to fit! These sensors come in various sizes from 5mm to 25mm and can be driven by typical circuits without the need for complex power management.

In the sections below, we will explore exactly what makes the sensor tick, how it is made, its variations, and where they can be used now!

The Basics of an LDR Sensor

An LDR or Light Dependent Resistor relies on a principle called photoconductivity; some materials conduct electricity more effectively under certain conditions. In this case, that condition is the presence of light.

Here's how it works:

At night: There are very few free charged carriers in the semiconductor inside the sensor, so resistance is extremely high (anything from 1 M to well over 10 M).

     When light strikes it: The energy contained within photons of light can free electrons from their stable position in the valence band into the higher conduction band. These electrons are free to flow, creating a current.

     More light = more free electrons = lower resistance. Under full sunlight, an ldr sensor can have a resistance as low as 100 ohms.

     When it goes dark: These free electrons will recombine with their 'hole' partners, the charge carrier density will fall, and the resistance will rise.

     This inverse and non-linear relationship between light and resistance makes an LDR the natural choice for automatic switching applications - there doesn't need to be an exact value of resistance or light, it just needs to exceed or fall below a certain threshold for an action to take place.

Note: ldr sensor do not respond immediately; there's a lag between dark and light of around 10ms, while dark and light can be as long as 1 second; for an automatic switching application, this isn't too much of a problem, but if it were needed to detect flashing light, a photodiode should be used instead.

Construction of the LDR sensor

Explaining how the sensor is made can also help you understand the way the sensor responds.

     Substrate-this is simply the ceramic or glass material on which all the parts are located.

     Semiconductor layer-this is usually a thin coating of a photoconductive material such as Cadmium Sulfide (CdS) for detecting visible light, or Lead Sulfide (PbS) if you want the sensor to detect infrared radiation.

     Electrodes-there are two metal contacts in the shape of a zigzag applied on the semiconductor layer. The zigzag shape of these contacts is not simply for aesthetics-they are to make sure that maximum area of contact is made with the semiconductor to provide increased sensitivity.

     Encapsulation-the whole sensor is enclosed in a protective transparent coating so as not to let moisture get to the sensitive parts.

What you end up with is a flat disk that resembles a tiny eye; the circular striated part is the zigzag electrode underneath the transparent layer.

LDR sensor types

 Not all ldr sensor are internally identical, and fall into two main categories:

Intrinsic Photoresistors

These photoresistors are created from pure, undoped semiconductors such as silicon or germanium, and when a high-energy photon strikes it can directly transfer the electrons across the entire band gap from the valence band to the conduction band.

     Sensitive to a very wide band of wavelengths of light.

     Good all-purpose light sensor

     A little slow to respond compared to extrinsic sensors.

     Best for visible light sensors such as cameras, light meters, ordinary automatic light switches, etc.

Extrinsic Photoresistors

These are created from doped semiconductors, often containing materials such as phosphorus within them. These doping materials create a step in energy levels between the valence and conduction band, requiring only a very low energy electron to jump between the bands.

     Sensitive to only a small region in the light spectrum (including near infra red)

     CdS cells are optimized for 500-700 nm (visible light)

     PbS cells are optimized for > 1000nm (infrared region of the spectrum)

     These are used in flame detectors, remote control receivers, and some security systems

In summary, the choice depends upon your application; if you wish to detect all visible light, then a CdS cell will be best; if, however, you are attempting to detect heat or an infrared signal from a remote control, then an extrinsic sensor is the best choice.

LDR Sensor Circuit: How It Connects

The ldr sensor will invariably be connected in a voltage divider with a fixed value resistor:

A relatively simple circuit: The LDR is connected in series with a fixed resistor (10k is generally preferred) across the power supply and earth, and then the voltage at the junction of the LDR and fixed resistor is output. When light is applied to the LDR, its resistance drops, hence the output voltage will also drop. In the dark, its resistance will rise, so the output voltage will increase by a significant factor.

The output voltage can be fed into the base of a transistor, into a comparator op amp, or connected to a digital pin on a microcontroller. It can be easily set so that it triggers at a certain light level by the addition of a variable resistor or changing one of the component values to suit. To set it off, when a light is applied, the components should be changed round and the output voltage will rise.

Actual usages of the LDR sensor

This is where LDR sensors actually came in. Here are a few common applications where it's been put to good usage:

Automated Street Lights

Street lights that switch on and off at nightfall and dawn, respectively, usually use LDR sensors as their eyes. As there's less amount of ambient light, the resistance of the LDR rises up which sends an activation to a relay that switches the light on, no user operation is necessary, and it saves a whole lot of energy, unlike any sort of human error.

Light Meters and Auto-Exposure in Cameras

Internal ldr sensor are present in all modern-day cameras and take readings of ambient light, which helps adjust the aperture and shutter speed, thus making the image properly exposed.

Alarm Systems and Security Applications

A very simple principle using LDR for alarm systems consists of an invisible trip wire made by directing a thin beam of light toward an LDR sensor. The instant that light is interrupted (if someone trips it), the light's resistance falls as there is no more light detected, and this abrupt fall sends signals to an alarm circuit to give an alarm. This method is most commonly seen in commercial doors and alarm security setups.

Solar Power Systems

Solar power systems use LDR sensors for solar panel tracking systems, as they help determine the direction of maximum sun intensity. This is achieved by comparing the inputs of two or more LDR sensors placed at an angle to determine in which direction the light is strongest and turning the solar panels that way.

IoT & Smart Home Automation

It is common for projects to use LDR sensors in smart lighting systems, automatic curtain openers, or garden light controls with Arduino and Raspberry Pi. They connect readily to microcontrollers by outputting an analog signal, and are often among the first sensors that a beginner will learn to use.

Audio Compressors

This may seem unusual, but many professional audio compressors use a small LED and an ldr sensor together internally. The LED becomes brighter when an audio signal passes a certain threshold. This decrease in the resistance of the LDR then causes the gain of the amplifier stage to decrease. This slow response time is actually beneficial to the audio engineer as it creates a very naturally smooth attack and release characteristic.

Benefits & drawbacks of LDR Sensors

Benefits

     Extremely cheap - normally only a few rupees/cents per unit

     Extremely simple to use - requires no intricate wiring or coding

     Passive component - uses very little power from itself

     Robust - no moving parts means a long operating lifespan in ideal conditions

     Analog output - compatible with both analog and digital circuits.

Drawbacks

     Slow response time - unsuitable for rapid light pulsing

     Non-linear output - resistance does not vary linearly with light, complicating precise measurement

     Temperature sensitive - the resistance value is dependent on the ambient temperature

     Less accurate than photodiodes - a photodiode will give more precise measurements if it is needed.

     Environmental issues - many LDRs are based on cadmium compounds, which can not be disposed of easily.

Conclusion

 Of the several sensors we have looked at over time, the LDR sensor stands out as perhaps the only component to have been in use for many years and not been superseded or replaced, largely due to the simple, reliable, and inexpensive function it provides. Read light, vary resistance, actuate circuit - the purpose is, quite simply, achieved. The LDR can be seen in action in a multitude of products ranging from street lighting to audio equipment, security beams to domestic smart home technology. In any application that requires some level of light detection where an alternative, more precise or sophisticated device is overkill, you are likely to encounter an LDR.

For the beginner, a good starting point in building electronics is to work with an LDR as the basic principles that are embodied within its function – from voltage divider to threshold sensing to analog sensing – are transferable across all manner of electronic projects. For more advanced users, the ldr sensor will always have its place in the electronic designer’s toolkit when efficiency and cost-effectiveness over and above sheer speed and precision are paramount.

FAQs

 1.What does LDR stand for?

LDR stands for light-dependent resistor, orphoto resistor, or photoconductive cell, if you'd prefer.

2. What is the resistance of an LDR sensor in darkness?

Total darkness: can go up to mega Ohms.Bright light: down to 100 Ohms.

3. Can I use an LDR sensor in Arduino?

Yes, connect it as a voltage divider (using a 10 k resistor), and read at an analog pin. The LDR is one of the simplest sensors to use with a microcontroller.

4. What is the difference between an LDR sensor and a photodiode?

LDR's resistance can be changed depending on the intensity of light. The LDR is slow to respond, whereas photodiodes change from light to current and have a very quick response, which is good for fast detecting or measuring circuits.

5. Is the LDR sensor still useful compared with the new sensors existing now?

Sure, when cost is much more important than precision, it will be very difficult to replace the LDR sensor with new components, like in some light controls, some cheap alarms, or some solar track device.

Asmita Ghosh

By: Asmita Ghosh

I'm a Content Writer and Editor who loves turning complex ideas into clear, engaging content. With a background in English Literature and experience across EdTech, R&D, I work across SEO content, video scripts, and content strategy. 

Back to blog

Leave a comment