apogeeweb title
Home arrow Sensors

arrow left

arrow right

Feb 22 2020

What is a Light Sensor?

I Introduction

The light sensor is developed based on the photoelectric effect principle of semiconductors. It can be used to detect the intensity of ambient light, and it can also be used to detect the difference in light between different colored surfaces. Users can make projects that interact with light with it, such as smart dimming lights, a laser communication system or something more awesome.

Light Sensor Using Arduino and LDR | Arduino Light Sensor


I Introduction

II Definition

 2.1 What is a Sensor?

 2.2 Definition of the Light Sensor

III Spectrum and Photometric Physical Quantity

3.1 Spectrum

3.2 Photometric Physical Quantities

3.3 MID Display's Perception of Backlight Brightness Under Different Illumination

IV How the Light Sensor Works

V Types and Characteristics of Light Sensors

5.1 Photodiode Type

5.2 Photoresistor Type

VI Applications of Light Sensors

6.1 Types of Light Sensors in Application

6.2 Typical Applications

6.3 Practical Application Cases

VII The Circuit Diagram of a Light Sensor

7.1 Model Introduction

7.2 Appearance and Size

7.3 Application

7.4 Functional Framework Diagram

7.5 Application Circuit

VIII Programming Guide

 8.1 mBlock Programming

 8.2 Arduino Programming

 8.3 Schematic

IX A Related Question about Light Sensor

9.1 Question

9.2 Answer

II Definition

2.1 What is a Sensor?

In a broad sense, a sensor is a sensor that converts a measurement into a signal that can be perceived or quantified. In a narrow sense, a device that senses the measurement and converts it into an output signal of the same or another nature according to a certain law. The sensor is generally composed of a sensor element, a conversion element, a measurement circuit, and an auxiliary power source. The sensor element and the conversion element may be combined into one, and some sensors do not require an auxiliary power source.

2.2 Definition of the Light Sensor

The light sensor usually refers to a device that can sensitively sense the light energy of ultraviolet light to infrared light and convert the light energy into an electrical signal.

The light sensor is a kind of sensing device, which is mainly composed of light-sensitive elements. It is mainly divided into four categories: ambient light sensor, infrared light sensor, sunlight sensor, and ultraviolet light sensor. It is mainly used in the field of changing body electronics applications and intelligent lighting systems. Modern electrical measurement technology is becoming more and more mature. Due to its advantages such as high accuracy and easy microcomputer connection for automatic real-time processing, it has been widely used in the measurement of electrical and non-electrical quantities. However, the electrical measurement method is susceptible to interference. In the AC measurement, the frequency response is not wide enough and there are certain requirements on the withstand voltage and insulation. Today, the rapid development of laser technology has been able to solve the above problems.

Light Sensor

Figure1. Light Sensor

III Spectrum and Photometric Physical Quantity

3.1 Spectrum

The spectrum is a pattern in which monochromatic light, which is dispersed by the dispersive system (such as a prism and a grating), is sequentially arranged according to the size of the wavelength (or frequency). The largest part of the visible spectrum is the visible part of the electromagnetic spectrum of the human eye. Electromagnetic radiation in this wavelength range is called visible light. The spectrum does not include all the colors that the human brain can distinguish, such as brown and pink.


Figure2. Spectrum

3.2 Photometric Physical Quantities

3.2.1 Light Intensity(I/Intensity)

(1) Definition: the intensity of light emitted by a monochromatic light source (frequency 540 × 1012 Hz, wavelength 555nm) in a unit solid angle in a given direction (radiation intensity in this direction is 1/683 watts per spherical degree) .

(2) Unit: cd (Candela)

(3) Luminous intensity of common light sources:

●  Sun, 2.8E27 cd

●  Highlight flashlight, 10000 cd

●  5mm super bright LED, 15 cd

3.2.2 Luminous Flux(F/Flux)

(1) Definition: The energy emitted by a point light source or a non-point light source in a unit time. Among them, the visual person (radiation flux that humans can feel) is called luminous flux.

(2) Unit: Lm (lumens)

(3) Efficiency of common light sources (lumens / watt, Lm / W)

● Incandescent, 15

● White LED, 20

● fluorescent lamp, 50

● The sun, 94

● Sodium lamp, 120

3.2.3 E/Illuminance

(1) Definition: Luminous flux irradiated onto a unit area.

(2) Unit: Lx / Lux (1), 1 (Lx) = 1 Lm / m2.

(3) Common Illumination (Lx):

● Direct sunlight (noon), 110,000

● Overcast day, 1000

● Inside the mall, 500

● Cloudy room with window, 100

● Under normal room lighting, 100

● Full moon, 0.2

3.2.4 L / Luminance

(1) Definition: The intensity of light emitted by the unit light source area in the normal direction and within the unit solid angle.

(2) Unit: nt (nits), 1 (nt) = 1 cd / m2.

(3) Brightness of common luminous body (nt):

● Solar surface, 2,000,000,000

● Incandescent filament, 10,000,000

● White paper under the sun, 30,000

● Brightness that human eyes can get used to, 3,000

● The human eye can better distinguish the brightness of the color, 1

● No moon night sky, 0.0001

3.3 MID Display's Perception of Backlight Brightness Under Different Illumination

Ambient Illumination-LUX

Figure3. Ambient Illumination-LUX

IV How the Light Sensor Works

The light sensor actually works according to the principle of the photoelectric effect. The so-called photoelectric effect refers to the phenomenon that certain special substances can convert light energy into electrical energy after absorbing light. The photoelectric effect can be divided into two types: external photoelectric effect and an internal photoelectric effect. The external photoelectric effect refers to the fact that under the light irradiation, electrons can be emitted from the inside of the material to generate electricity. The photocell and photomultiplier are originals based on the external photoelectric effect. Correspondingly, the internal photoelectric effect occurs inside the substance. When light is irradiated onto the substance, the resistivity inside the substance is changed, thereby generating electromotive force. Photoelectric elements such as photoresistors and photovoltaic cells are made based on the internal photoelectric effect.

Take the light sensor on the mobile phone as an example:

The light sensor in a mobile phone should actually be an ambient light sensor, which is mainly composed of two parts, a light projector, and a light receiver. The white dot next to the front camera acts as a lens that focuses the light in the environment and transmits it to the receiver via the projector. According to the photoelectric effect, the light receiver can convert various light signals into corresponding electrical signals, and then further process them into various switching and control actions to realize the sensitivity adjustment of the mobile phone.

An infrared cut-off film is often attached to the chip of the ambient light sensor to eliminate the interference of infrared light so that our electronic devices such as mobile phones and laptops can accurately detect the visible light intensity in the environment. When the display consumes too much power, the light sensor can also automatically reduce the screen brightness to extend the operating time of the battery.

 Light Sensor in Phone

Figure4. Light Sensor in Phone

V Types and Characteristics of Light Sensors

5.1 Photodiode Type

Photodiodes and semiconductor diodes are similar in structure, and their die is a PN junction with photosensitive characteristics, which has unidirectional conductivity, so a reverse voltage needs to be added when working.

When there is no light, there is a small saturation reverse leakage current, that is, a dark current, at which time the photodiode is turned off. When exposed to light, the saturation reverse leakage current greatly increases, forming a photocurrent, which changes with the intensity of the incident light.

When light irradiates the PN junction, an electron-hole pair can be generated in the PN junction, which increases the density of minority carriers. These carriers drift under the reverse voltage, causing the reverse current to increase. So you can use the light intensity to change the current in the circuit. It is turned off when there is no light and turned on when there is light.


(1) High sensitivity can reduce the influence of stray light

(2) Photodiode (photodiode) is a photoelectric conversion device, which can convert the received light into a current change

(3) The working mode of the photodiode (photodiode) is to increase the reverse voltage or not increase the voltage. When a reverse bias is applied to it, the reverse current in the tube will change with the intensity of the light. The greater the light intensity, the greater the reverse current.


Figure5. Photodiode

5.2 Photoresistor Type

(1) Principle

It works based on the semiconductor photoelectric effect. The photoresistor is non-polar and is purely a resistive element. It can be applied with DC voltage or AC voltage.

(2) Working characteristics of the photoresistor: When the light is on, the resistance is small; when the light is off, the resistance is large. The stronger the light, the smaller the resistance; when the light stops, the resistance returns to its original value.

(3) Spectral range: from ultraviolet to infrared.

(4) Features:

● The internal photoelectric effect has nothing to do with the electrode (only related to the photodiode), that is, a DC power supply can be used.

● Sensitivity is related to the semiconductor material and the wavelength of the incident light

● Epoxy resin package, high reliability, small size, high sensitivity, fast response speed, and good spectral characteristics.


Figure6. Photoresistor

VI Applications of Light Sensors

6.1 Types of Light Sensors in Application

(1) Ambient light sensor

The ambient light sensor can sense the surrounding light conditions and tell the processing chip to automatically adjust the backlight brightness of the display to reduce the power consumption of the product.

On the other hand, the ambient light sensor helps the display provide a soft picture. When the ambient brightness is high, the LCD monitor using the ambient light sensor will automatically adjust to high brightness. When the external environment is dark, the display will be adjusted to low brightness to achieve automatic brightness adjustment.

(2) Infrared light sensor

The infrared light sensor uses a charged thermopile and a scandium bromide iodide (KRS-5) window to sense wavelengths from 580 to 40,000 nm. The sensor can be used to measure a range of phenomena, including infrared radiation from the palm of your hand.

(3) Sunlight sensor

Solar sensor. It can recognize horizontal and vertical 360 degrees. The location of the sun, identification, cloudy, cloudy, semi-cloudy, sunny and evening during the day. Tracking bearing identification. Identification circuit processing and server drive. A digital chip is used to complete the processing of the above information. It can serve a variety of ordinary motors, stepper motors. The power consumption of the whole machine is 3mA, and the chip working voltage is 5V. International advanced solar tracking equipment uses computer data theory, which requires data and settings for the latitude and longitude of the earth. The circuit principle and equipment technology are complicated. Intelligent sun tracker uses recognition theory technology, simple circuit and few components, no theory of latitude, longitude and data information. There is no need to consider the route that the sun runs through the year. From which direction the sun rises and from which direction it falls, it can accurately identify the position where the sun rises and falls. If he is placed on a walking car or boat, the tracker can face the sun no matter where he goes.

(4) UV light sensor

The UV light sensor uses a filter to measure the UV light band (315nm-400nm). Remove the filter, the sensor can sense visible light at the same time. The sensor includes a UV filter, a sight, and a sensor handle.

 Types of Light Sensors

Figure7. Types of Light Sensors

6.2 Typical Applications

Backlight adjustment: TV, computer monitor, LCD backlight, mobile phone, digital camera, MP4, PDA, GPS;

Energy-saving control: outdoor advertising machines, induction lighting appliances, toys; instruments and meters: instruments and industrial controls for measuring light intensity;

Environmentally friendly replacement: Replace traditional photoresistors, photodiodes, phototransistors

6.3 Practical Application Cases

6.3.1 Changing Body Electronics Applications

(1) Ambient light detection

In body electronics applications, ambient light sensors are used to adjust the backlight intensity of the dashboard, as well as the LCD backlight intensity in navigation systems (GPS), temperature control, and DVD screens. This is especially important for displays like BMW's iDrive and Prius' Multi-Info. For example, when daylight becomes dim and dark, the dashboard backlight will be adjusted to varying degrees to achieve the best visibility and reduce the glare that may be caused to the driver. Using these sensors eliminates the problem of turning on the headlights during the day, and the display automatically adjusts brightness. The key function of the ambient light sensor is to use the sensitivity visible wavelength of 380nm ~ 780nm to replicate the sensitivity of the human eye.

(2) Tunnel detection

Tunnel detection requires the input of two sensors. The first sensor has a wider field of view "looking up" and a relatively long average moving period, which prevents the lights from turning on and off. The second sensor has a narrower field of view "looking forward" and a relatively short average moving time. This allows the tunnel sensor to respond quickly to sudden changes in daylight, turn on the car's headlights, and adjust the display's backlight brightness when entering the tunnel. Forward-facing sensors eliminate the need to turn lights on and off when entering under a bridge or a tree covering the sun. In these cases, the sensor will still "see" the light ahead.

 When entering the tunnel, the signal from the tunnel sensor will drop, while the signal from the wide-field sensor will remain high; the headlights of the car will be turned on. When exiting the tunnel, the signal from the tunnel sensor will increase and the signal from the wide field of view sensor will decrease; the headlights of the vehicle will be turned off. With different average moving periods, the controller makes a clear distinction.

6.3.2 Intelligent Lighting System

To improve the comfort of the working environment, the lighting control system adopts a light sensor to automatically control the lighting equipment according to the illuminance of the current environment, so that the illuminance is controlled within a comfortable range. In traditional lighting control systems, ordinary light sensors are often combined with A / D converters (ADCs). Because the light signal detected by the light sensor contains both visible light components and infrared light components, the infrared light is filtered to detect the light sensor detection results.

VII The Circuit Diagram of a Light Sensor

7.1 Model Introduction

The light sensor shown below is a low-cost I2C digital light sensor (ALS), which can convert light intensity into a digital output signal that can directly interface with I2C, providing a wide dynamic range from 0.01lux to 64K lux The linear response is very suitable for applications under high ambient brightness.


Figure8. Model

7.2 Appearance and Size

Appearance and Size of the model

Figure9. Appearance and Size of the model

7.3 Application

(1) Back-lighting Control in mobile / portable devices

(2) Touch Panel Control in mobile / portable devices

7.4 Functional Framework Diagram

Functional Framework Diagram

Figure10. Functional Framework Diagram

7.5 Application Circuit

Application Circuit

Figure11. Application Circuit

VIII Programming Guide

The programming described below is based on the Me light sensor developed based on the photoelectric effect principle in semiconductors.

8.1 mBlock Programming

The light sensor module supports the mBlock programming environment. The following is a brief description of the module instructions:

Programming Guide

Figure12. Programming Guide

Here is an example of how to use mBlock to control a light sensor module

When the LED receives the light, M-Panda will move left and right and say I love sunshine; Cover the LED light, M-Panda will stop moving and say I love night. The results are as follows:


Figure13. Result

8.2 Arduino Programming

If you write a program using Arduino, you should call the library Makeblock-Library-master to control the Me Light Sensor. This program instructs Me Light Sensor to read the current light intensity through Arduino programming.

Arduino Programming

Figure14. Arduino Programming

Function list of light sensor:

Function List of Me Light Sensor

Figure15. Function List of Me Light Sensor

8.3 Schematic


Figure16. Schematic

9.1 Question

How to combine these 2 circuits together so that during complete darkness on the LDR, the LED would turn on instantly and when light falls on the LDR there would be around a 1 or 2 second delay before completely shutting off?

The circuit would be running of a 5V DC power supply and powering an LED array.

How to combine them together?




Figure18. Circuit2

9.2 Answer

In the 555 circuit the capacitor controls the wait time, if the capacitor is short-circuited the circuit will wat forever.

In the LDR circuit the transistor acts like a switch but unfortunately it's switching to ground but the capacitor in the 555 circuit is connected to +9V

To resolve this I swapped the parts in the 555 circuit upside down to have the capacitor to ground. Then it was simple to I merge the two circuits.


Figure19. Answer

In the dark R1 turns Q1 on the keesp C1 duscharged so 555 output will be high.

when there is light the LDR turns Q1 off and C1 charges , once it gets enough charge the 555 output goes low.

We could have instead built the upside-down version of the LDR circuit using a BC557 transitor (or other similar PNP type) instead of the BC547 NPN transistor and merged that with the original 555 circuit.


Related Articles

  • What is a Wheel Speed Sensor? What is a Wheel Speed Sensor?
    I IntroductionThe wheel speed sensor, also known as the vehicle speed sensor (VSS), is a SENSOR used to measure the steering of the car wheels. Commonly used wheel speed sensors are: magnetoelect...
  • Principles and Types of Biosensors Principles and Types of Biosensors
    Ⅰ. What is Biosensor?Biosensor is an instrument which is sensitive to biological substances and converts its concentration into electrical signal for detection. Biosensor has the function of rece...
  • Deep Analysis of Infrared Sensor Deep Analysis of Infrared Sensor
    Ⅰ. IntroductionAny object in the universe can produce infrared radiation as long as its temperature exceeds zero. In fact, like visible light, its radiation can be refracted and reflected, which leads...
  • Silicon-Carbide Coating Protects Flow and Liquid Level Sensor Modules Silicon-Carbide Coating Protects Flow and Liquid Level Sensor Modules
    NewsIt’s reported on Nov. 15th 2017 that the FS1012 and FS2012 MEMS-based flow sensor modules from Integrated Device Technology (IDT) are now being shipped by distributor Mouser Electronics. The solid...
  • Classification of Temperature Sensor and Application Classification of Temperature Sensor and Application
    IntroductionTemperature, as one of the seven basic quantities of the international unit system, is a variety of sensors for measuring temperature. The temperature sensor is the core part of the temper...
  • The Techniques to Improve Capacitive Touch Sensing The Techniques to Improve Capacitive Touch Sensing
    We have published the article to talk some basic knowledge about knowledge of Capacitive Touch Sensing of Sensor. In this article,there are some basic cap-sense circuit configurations and discusses ho...

pinglun 1 comment

    • pingluntus
    • JohnDoe on 2020/4/17 7:27:16

    Your style is very unique in comparison to other folks I have read stuff from. Thanks for posting when you've got the opportunity, Guess I will just bookmark this page.

Leave a Reply

Your email address will not be published.

code image
Rating: poor fair good very good excellent