Home  Resistors

Jun 19 2020

Photoresistor: Basics and Arduino Tutorial

I Introduction

Photoresistor or light-dependent resistor (abbreviated as LDR) or photoconductor is a special resistor made of semiconductor materials such as cadmium sulfide or cadmium selenide. Its working principle is based on the internal photoelectric effect. The stronger the light, the lower the resistance value. With the increase of the light intensity, the resistance value decreases rapidly, and the bright resistance value can be as small as 1KΩ or less. The photoresistor is very sensitive to light, and it shows a high resistance state when there is no light, and the dark resistance can generally reach 1.5MΩ.

This article includes an overview of the basic information of the photoresistor and two Arduino tutorials for the photoresistor. The content is very comprehensive and detailed. You can choose the part you want to read or read the full text. We hope this article is helpful to you!

Catalog

I Introduction

II What is a Photoresistor?

 2.1 Definition

 2.2 Symbol

 2.3 Composition

III How Does the Photoresistor Work?

 3.1 The Working Principle of Photoresistors

 3.2 Internal Photoelectric Effect

IV Photoresistor Application Circuit Diagram

V Types of Photoresistor

 5.1 Classification by Materials

 5.2 Classification by Spectral Characteristics

VI The Main Parameters and Basic Characteristics of the Photoresistor

 6.1 The Main Parameters of the Photoresistor

 6.2 Basic Characteristics

VII Arduino Photoresistor Tutorial

 7.1 LED Control with Photoresistor and Arduino

 7.2 Measuring Light Intensity Using a Photoresistor (Arduino)

 7.3 Use Experiment of Arduino Photoresistor

VIII How to Use Multimeter to Detect the Quality of Photoresistor?

IX A Quiz about the Photoresistor

II What is a Photoresistor?

2.1 Definition

According to the Wikipedia, a photoresistor (also named LDR for Light Decreasing Resistance, or light-dependent resistor, or photo-conductive cell) is a passive component that decreases resistance with respect to receiving luminosity (light) on the component's sensitive surface.

2.2 Symbol

Photoresistors are generally represented by "RL", "RG" or "R". The following figure shows the schematic symbols of the photoresistor.

Photoresistor Symbol

Figure1. Photoresistor Symbol

Recommended Reading: To learn more about Resistor Symbol.

2.3 Composition

(1) The structure of the photoresistor

It is usually composed of a photosensitive layer, a glass substrate (or a branch moisture-proof film) and an electrode.

The Structure of Photoresistor

Figure2. The Structure of Photoresistor

  • Materials for manufacturing photoresistors

The materials used for manufacturing photoresistors are mainly semiconductors such as metal sulfides, selenides and tellurides. Usually, coating, spraying, sintering and other methods are used to make a very thin photoresistor and comb-shaped ohmic electrode on the insulating substrate, and then the lead is taken out and encapsulated in a sealed housing with a light-transmitting mirror to prevent moisture from affecting its sensitivity.

III How Does the Photoresistor Work?

3.1 The Working Principle of Photoresistors

How does a photoresistor work

The working principle of the photoresistor is based on the internal photoelectric effect.

A voltage is applied to the metal electrodes at both ends of the photoresistor, and a current flows through it. When irradiated with light of a certain wavelength, the current will increase with the increase of light intensity, thereby achieving photoelectric conversion. After the incident light disappears, the electron-hole pairs generated by the photon excitation will recombine, and the resistance of the photoresistor will return to its original value.

The photoresistor has no polarity and is purely a resistive device. It can be used with either DC voltage or AC voltage. The conductivity of a semiconductor depends on the number of carriers in the semiconductor conduction band.

  • Why is the value of the photoresistor related to the wavelength of the incident light?

Simply put, it is the effect of transitions between energy levels. Photons at different wavelengths have different energies, and an electron can only absorb one photon. After an electron absorbs a photon, whether it can be converted from non-conductive to conductive electrons depends on the photon’s Energy, and the number of electrons that can conduct electricity determines the resistance of the photoresistor. Therefore, the light wavelength also affects the resistance of the photoresistor.

Recommended Reading: See more about light sensor, wavelength, spectrum and photometric physical quantity.

3.2 Internal Photoelectric Effect

The internal photoelectric effect is a kind of photoelectric effect, mainly due to the effect of light quantum, which causes the change of the electrochemical properties of the substance (such as the change in resistivity, which is the difference from the external photoelectric effect, and the external photoelectric effect is the escape of electrons). The internal photoelectric effect can be divided into photoconductive effect and photovoltaic effect.

Photoconductivity

The photoconductive effect is one of two internal photoelectric effects. The internal photoelectric effect refers to the phenomenon that the electrical conductivity of a semiconductor exposed to light changes or a photo-induced electromotive force is generated. Among them, the phenomenon that the conductivity of the semiconductor changes due to light is called the photoconductivity effect.

Energy Level of Atom

Figure3. Energy Level of Atom

Photovoltaic Effect

From the principle of the transistor, it can be known that when the P-type semiconductor and the N-type semiconductor are combined together, the electrons in the N-type semiconductor and the holes in the P-type semiconductor diffuse with each other. As a result, a hole is formed near the interface of the P-N junction. The direction of the electric field is directed from the N-type semiconductor to the P-type semiconductor, as shown in the figure. When light irradiates the P-N junction and its vicinity, under the action of photons with sufficient energy, minority carriers (electron and hole pairs) are generated in and around the junction region. After being excited, the electrons leave holes. Under the action of the internal electric field, the electrons flow to the N-type region, and the holes flow to the P-type region. This results in electron accumulation in the N-type region and hole accumulation in the P-type region. In turn, an additional electromotive force is generated at both ends of the P-N junction, that is, a photogenerated electromotive force. This phenomenon is the photovoltaic effect. If the P-N junction is connected with an external circuit, current will flow through the external circuit, and the direction of current flow is from the P region to the N region. This is the simple principle that the photovoltaic effect produces current or voltage.

Photovoltaic Effect

Figure4. Photovoltaic Effect

IV Photoresistor Application Circuit Diagram

  • Schematic circuit for conventional applications

Schematic Circuit

Figure5. Schematic Circuit

Module parameters:

  • Working voltage: DC3.3-5V
  • Photoresistor Model: 5516
  • Module pins: 3-pin or 4-pin (an additional analog output AO for 4-pin)
  • Common circuit diagram

(3)Photoresistor application circuit diagram

The following figure is a schematic diagram of the application of the photoresistor in the light control switch. The photoresistor is connected in series with the resistor R1. When there is no light, that is, the voltage across R1 does not reach the turn-on voltage of the Q1 transistor. Once exposed to light, the resistance of the photoresistor drops rapidly. The voltage across R1 rises and the transistor turns on, which causes the transistor Q2 in the subsequent stage to turn on, and finally the switch K opens and the bulb works.

Common Photoresistor Application Circuit Diagram

Figure6. Common Photoresistor Application Circuit Diagram

(4) Photoresistor dimming circuit

The following figure is a typical light-controlled dimming circuit. Its working principle is: when the surrounding light becomes weak, the resistance of the photoresistor RG increases, which increases the partial voltage added to the capacitor C, which in turn makes the thyristor's The conduction angle is increased to achieve the purpose of increasing the voltage across the lamp. Conversely, if the surrounding light becomes brighter, the resistance of RG decreases, resulting in a smaller conduction angle of the thyristor, and the voltage across the lamp decreases at the same time, dimming the light, thereby controlling the illuminance of the lamp.

Photoresistor Dimming Circuit

Figure7. Photoresistor Dimming Circuit

Note: The rectifier bridge in the above circuit must be a DC pulsating voltage, and it cannot be converted into a smooth DC voltage by capacitor filtering, otherwise the circuit will not work properly. The reason is that the DC pulsating voltage can not only provide the basic conditions for zero-crossing shutdown of the thyristor, but also enable the charging of the capacitor C to start from zero every half cycle, and accurately complete the synchronous phase-shift triggering of the thyristor.

V Types of Photoresistor

5.1 Classification by Materials

Polycrystalline and single crystal photoresistors can also be divided into cadmium sulfide (CdS), cadmium selenide (CdSe), lead sulfide (PbS), lead selenide (PbSe), indium antimonide (InSb) photoresistors, etc.

5.2 Classification by Spectral Characteristics

(1) Ultraviolet photoresistor: sensitive to ultraviolet rays, including cadmium sulfide, cadmium selenide photoresistors, etc., used to detect ultraviolet rays.

(2) Infrared photoresistors: mainly lead sulfide, lead telluride, and lead selenide. Photoresistors such as indium antimonide are widely used in missile guidance, astronomical detection, non-contact measurement, human disease detection, infrared spectroscopy, infrared communication and other national defense, scientific research, and industrial and agricultural production.

(3) Visible light photoresistors: including selenium, cadmium sulfide, cadmium selenide, cadmium telluride, gallium arsenide, silicon, germanium, zinc sulfide photoresistors, etc. Mainly used in various photoelectric control systems, such as photoelectric automatic switch portals, automatic turning on and off of navigation lights, street lights and other lighting systems, automatic water supply and automatic water stop devices, automatic protection devices on machinery and "position detectors" Thickness detectors for thin parts, automatic exposure devices for cameras, photoelectric counters, smoke alarms, photoelectric tracking systems, etc.

Light Dependent Resistor

Figure8. Light Dependent Resistor

VI The Main Parameters and Basic Characteristics of the Photoresistor

6.1 The Main Parameters of the Photoresistor

1) Bright resistance (kΩ): refers to the resistance value of the photoresistor when exposed to light.

2) Dark resistance (MΩ): refers to the resistance value of the photoresistor when there is no light exposure (dark environment).

3) Maximum working voltage (V): refers to the highest voltage the photoresistor is allowed to withstand under the rated power

4) Bright current: refers to the current that the photoresistor passes when it is irradiated by light under the specified applied voltage.

5) Dark current (mA): refers to the current that the photoresistor passes under the specified applied voltage when there is no light.

6) Time constant (s): refers to the time required for the photoresistor to start from the light jump to stabilize 63% of the bright current.

7) Resistance temperature coefficient: refers to the relative change of the resistance value of the photoresistor when the ambient temperature changes by 1°C.

8) Sensitivity: refers to the relative change of the resistance value of the photoresistor with and without light irradiation.

LDR

Figure9. LDR

6.2 Basic Characteristics

(1) Dark resistance and bright resistance

  • The stable resistance value measured by the photoresistor under room temperature and total darkness is called dark resistance. The current flowing at this time is called dark current. For example, MG41-21 type photoresistor dark resistance is greater than or equal to 0.1M.
  • The stable resistance value measured by the photoresistor at room temperature and under certain lighting conditions is called bright resistance. The current flowing at this time is called the bright current. The bright resistance of MG41-21 type photoresistor is less than or equal to 1k.

    The difference between bright current and dark current is called photocurrent.

    Obviously, the larger the dark resistance of the photoresistor, the better, and the smaller the bright resistance, the better, that is, the dark current should be small and the bright current should be large, so the sensitivity of the photoresistor is high.

Bright Current and Dark Current

Figure10. Bright Current and Dark Current

(2) Volt-ampere characteristics

    Under a certain illuminance, the relationship between the voltage applied across the photoresistor and the current flowing through the photoresistor is called the volt-ampere characteristic.

    The volt-ampere characteristic of the photoresistor is approximately a straight line, and there is no saturation phenomenon. Due to the limitation of power dissipation, the voltage across the photoresistor cannot exceed the maximum operating voltage during use. The dotted line in the figure is the allowable power consumption curve, from which the normal operating voltage of the photoresistor can be determined.

(3) Photoelectric characteristics

    The relationship between the photocurrent of the photoresistor and the illuminance is called the photoelectric characteristic. The photoelectric characteristics of the photoresistor are nonlinear. Therefore, it is not suitable as a detection element, which is one of the shortcomings of the photoresistor. In automatic control, it is often used as a switching photoelectric sensor.

Characteristics of the Photoelectric Effect

Figure11. Characteristics of the Photoelectric Effect

(4) Spectral characteristics

    For incident light of different wavelengths, the relative sensitivity of the photoresistor is different. The spectral characteristics of various materials are shown in Figure 2.6.4. It can be seen from the figure that the peak value of cadmium sulfide is in the visible light region, and the peak value of lead sulfide is in the infrared region. Therefore, when selecting the photoresistor, the types of components and light sources should be considered in order to obtain satisfactory results.

(5) Frequency characteristics

    When the photoresistor is exposed to pulsed light, the photocurrent will reach a steady state value after a period of time. When the light suddenly disappears, the photocurrent will not be zero immediately. This shows that the photoresistor has time-delay characteristics. Because different materials have different time delay characteristics of photoresistors, their frequency characteristics are also different. Figure 2.6.5 shows the relationship between the relative sensitivity Kr and the light intensity change frequency f. It can be seen that the use frequency of lead sulfide is much higher than that of thallium sulfide. However, most photoresistors have large time delays, so they cannot be used in situations where fast response is required. This is a defect of photoresistors.

(6) Temperature characteristics

Like other semiconductor devices, the photoresistor is greatly affected by temperature. When the temperature increases, its dark resistance will decrease. Changes in temperature also have a great influence on the spectral characteristics. Figure 2.6.6 is the spectral temperature characteristic curve of lead sulfide photoresistor. It can be seen from the figure that its peak value moves to the short wavelength direction as the temperature rises. Therefore, in order to improve the sensitivity, or in order to receive far-infrared light, cooling measures are taken.

Temperature Characteristics

Figure12. Temperature Characteristics

Spectral Temperature Characteristics of Lead Sulfide Photoresistor

A commonly used photoresistor is a cadmium sulfide photoresistor, which is made of semiconductor material. The resistance of the photoresistor changes with the intensity of the incident light (visible light). Under dark conditions, its resistance (dark resistance) can reach 1~10MΩ; under strong light conditions (100LX), its resistance (Bright resistance) Only a few hundred to thousands of ohms. The sensitivity of the photoresistor to light (the spectral characteristics) is very close to the human eye's response to visible light (0.4~0.76) μm. As long as the human eye can sense the light, it will cause its resistance to change. Therefore, when designing the light control circuit, the incandescent bulb (small electric bead) light or natural light is used as the control light source, which greatly simplifies the design.

Photoresistor Characteristic Curve

Figure13. Photoresistor Characteristic Curve

The corresponding resistance change of the photoresistor with the intensity of the incident light is not linear, so it cannot be used for the linear conversion of the photoelectricity. This is where the user should pay attention. Beginners can purchase a photoresistor (MG45 type), at night a 60~100W incandescent lamp, use a multimeter to directly measure the resistance of the photoresistor. When measuring, the photoresistor should be aimed at the light of the incandescent lamp, and then gradually distance from the lamp (from near to far), observe the change of the resistance value indicated by the multimeter, and the special characteristics of the photoresistor can be visually verified.

Commonly used photoresistor models are sealed MG41, MG42, MG43 and unsealed MG45 (cheap price). Their rated power is below 200mW.

VII Arduino Photoresistor Tutorial

7.1 LED Control with Photoresistor and Arduino

LED Control with LDR (Photoresistor) and Arduino

7.2 Measuring Light Intensity Using a Photoresistor (Arduino)

In the data collection of smart home, the measurement of light intensity is also very necessary. For example, the indoor lighting can be automatically adjusted according to the intensity of the light to provide users with the most comfortable learning and living environment. The tutorial here will use a photoresistor to cooperate with Arduino to complete the light data collection.

(1) Materials

  • Arduino UNO development board
  • Breadboard
  • Photoresistor
  • 1K-10K resistance

(2)Wiring method

 Wiring Method

Figure14. Wiring Method

The resistance of photosensitive resistors is very high in the condition of no light. The stronger the light, the smaller the resistance. By measuring the voltage variation on both sides of the photosensitive resistance, the variation of the photosensitive resistance can be known and the light intensity can be obtained. In the connection diagram, we find that a partial voltage resistor is connected in series for the photosensitive resistor.

Circuit

Figure15. Circuit

In the above figure, RL is a photoresistor, R1 is a series resistor, Vout=RLR1+RLVin, in the dark, the resistance of RL will be very large, so Vout is also very large, close to 5V. Once the light is irradiated, the value of RL will decrease rapidly, so Vout will decrease accordingly. It can be seen from the above formula that R1 should not be too small, preferably around 1k~10k, otherwise the ratio will not change significantly.

(3) Code

The code part is very simple, just read the analog value of the interface connected to the photoresistor.

1 light = analogRead(0);

Open the serial monitor of Arduino, illuminate the photoresistor with the flashlight of the mobile phone, and observe the result:

2 Serial.println("lignt :");

3 Serial.println(light);

7.3 Use Experiment of Arduino Photoresistor

(1) Materials

  • Arduino UNO x1
  • Photoresistor x1
  • resistance 10K, 4.7K, 1K x several (or need one, but you can test the difference between different resistance values and data)

(2)Wiring method

 Wiring Method

Figure16. Wiring Method

(3)Program

#define AD5 A5 //Define analog port A5

#define LED 13 //Define digital port 13

 

int Intensity = 0;//Illuminance value

 

void setup() //Program initialization

{

   pinMode(LED, OUTPUT);//Set LED to output mode

   Serial.begin(9600);//Set baud rate 9600

}

 

void loop() // Program body loop

{

   Intensity = analogRead(AD5); //Read the value of analog port AD5 and save it in the Intensity variable

   Serial.print("Intensity = "); //Serial output "Intensity = "

   Serial.println(Intensity); //The serial port outputs the value of the Intensity variable and wraps

   delay(500); //Delay 500ms

}

(4) Power on, view serial data

Test Results:

Test Results

Figure17. Test Results

The above data is the change of the value with the flashlight and no light.

(5) Summary

The positive and negative poles are reversed and the values are reversed. The larger the resistance value, the larger the change range. Using 5V, the range is larger than 3.3V.

Recommended Reading: Arduino&mBlock light sensor

VIII How to Use Multimeter to Detect the Quality of Photoresistor?

  • Measure the dark resistance

Use a black piece of paper to cover the light-transmitting window of the photoresistor. At this time, the pointer of the multimeter remains basically unchanged, and the resistance value is close to infinity. The larger the value, the better the performance of the photoresistor. If this value is very small or close to zero, it means that the photoresistor has been burnt through and damaged and can no longer be used.

  • Measure the bright resistance value

Point a light source to the light-transmitting window of the photoresistor. At this time, the pointer of the multimeter should have a large amplitude swing, and the resistance value is significantly reduced. The smaller the value, the better the photoresistor performance. If this value is large or even infinite, it indicates that the internal open circuit of the photoresistor is damaged and can no longer be used.

  • Align the light-transmitting window of the photoresistor with the incident light, and use a small piece of black paper to shake the upper part of the light-shielding window of the photoresistor to make it receive light intermittently. At this time, the pointer of the multimeter should swing left and right with the black paper. If the pointer of the multimeter always stops at a certain position and does not swing with the shaking of the paper, it means that the photosensitive material of the photoresistor has been damaged.

IX A Quiz about the Photoresistor

Photoresistors, potentiometers, and thermistors are all ________.

A. Outputs

B. Digital inputs

C. Analog inputs

D. Throughputs

Answer: C

Related Articles

0 comment

Leave a Reply

Your email address will not be published.

 
 
   
Rating: