What is a light sensor? Types, Uses, Arduino Guide

A light sensor is a photoelectric device that converts light energy (photons) detected to electrical energy (electrons). Seems simple? There is more to a light sensor then just its definition. It comes in different types, used in various applications and more! Hence, in today’s light sensor guide, we’ll be exploring all you need to know about light sensors:

  • What are the types of light sensor
  • What is a light sensor used for
  • List of light sensors available at Seeed
  • How to use a light sensor with Arduino

Glossary of terms

Before we start with today’s’ light sensor guide, we’ll have to understand the following terms that are commonly associated with light. I’ve simplified it for easier understanding:


  • Originated from the term candles, candela refers to luminous intensity; how strong is the light to a naked eye
  • The higher the luminous intensity, the higher the sensitivity it is to our eyes


  • Measures the total amount of visible light from a light source through the relationship between luminous intensity and the angle that a light beam fills
  • Commonly used to rate the brightness of a lightbulb
  • To simply put it Lumen = Total amount of light emitted in all directions


  • Used to measure illuminance, the area where the luminous flux is spread
  • It’s similar to Lumen but it takes into account the surface area
  • To simply put it, Lux = total amount of light that falls on a parrticular surface

If you’re still confused between Lumen and Lux, here’s a graphical representation:

Lux vs Lumen

Understood the terms? Let’s now get started!

What are the types of light sensor

There are different types of light sensors available; mainly Photoresistor, Photodiodes, and Phototransistors. Sounds technical? I’ll break it down with the explanations below!

1. Photoresistors (LDR)

The most common light sensor type that’s used in a light sensor circuit are photoresistors, also known as a light-dependent resistor (LDR). Photoresistors are used to simply detect whether a light is on or off and compare relative light levels throughout a day.

What are photoresistors made of?

  • A high resistance Semiconductor material called cadmium sulfide cells, highly sensitive to visible and near-infrared light

How photoresistors work?

As its name suggests, photoresistors work similarly to your regular resistors, but instead resistance change is dependent on the amount of light it’s exposed to.

  • High intensity of light causes a lower resistance between the cadmium sulfide cell
  • The low intensity of light results in a higher resistance between the cadmium sulfide cells

This working principle can be seen in applications such as street lamps, wherein the day, the higher light intensity results in lower resistance and no light produced.

2. Photodiodes

Photodiodes are another type of light sensor. But instead of using the change in resistance like LDR, it’s more complex to light, easily changing light into a flow of electric currents.

Also known as a photodetector, photo sensor

What are photodiodes made of?

  • Photodiodes are mainly made from silicon and germanium materials and comprise of optical filters, built-in lenses and surface areas

How photodiodes work?

Photodiodes work on the working principle called the inner photoelectric effect. To simply put it, when a beam of light hits, electrons are loosened, causing electron-holes which results in electrical current to flow through.

  • The brighter the light present, the stronger the electrical current will be

Photodiode light sensor applications

Since current generated by photodiodes are directly proportional to the intensity of light, it makes it favorable for light sensing that requires fast light response changes.

Since photodiodes are responsive to infrared light, it’s applicable for more usages as well.

Here are some of the applications of photodiode:

  • Consumer electronics ranging from compact disc players to smoke detectors and even remote control devices
  • Medical applications such as equipment/instruments used for measuring and analysis purposes
  • Solar energy systems such as solar panels

3. Phototransistors

The last light sensor type we’ll be exploring today is the phototransistor. The phototransistor light sensor can be described as a photodiode + amplifier. With the added amplification, light sensitivity is far better on the phototransistors.

  • However, it doesn’t fair better in low light level detection as compared to photodiodes.

Since both light sensor types share a similar working principle, do refer to the previous explanation!

What is a light sensor used for? Applications

Despite the different types of light sensors, it can still be used in a variety of applications as seen below:

Consumer electronics

Related image

Ever wonder what’s behind your smartphone and tablets that allow for auto screen brightness adjustments? Yes, it’s an ambient light sensor! It measures the ambient light level of your surroundings and determines the suitable brightness of your screen!


Similarly to how light sensor works on your smartphones, it is used in automobiles to support the drivers’ field of vision. The present light sensor detects surrounding ambient light, and if it’s getting too dark, it’ll automatically turn on light systems!

Agricultural Usages

Image result for sprinkler wikimedia
Image Reference: Trusty Joe

We all know crops need mainly two things for growth; Sunlight and water. This is where a light sensor comes to play, helping farmers keep their crops hydrated yet not over-hydrating it. Here’s how:

  • A light sensor is connected to a sprinkler system, detecting levels of sunlight and only activating it when the sun isn’t at its brightest
  • It is used alongside other temperature sensors to help gather informative data as well

Security applications

Commonly used in circuits for shipment cargos, light sensors are connected to circuits and placed inside as it can detect whenever a container is open due to the change in light exposure. This helps in better processing of lost goods and tracking of personnel.

  • As such, photoresistors are commonly used due to its suitability

Light sensors available at Seeed

Since photoresistors, photodiodes, and phototransistors offer versatility at affordable pricing, you can collect illuminance data using Arduino or Raspberry Pi through our selection of light sensors available at Seeed!

Low-cost option: Grove – Light Sensor v1.2

Starting off the list of light sensors available right here at Seeed is the Grove – Light Sensor v1.2! Alongside its low price tag of $2.90, comes a highly sensitive and reliable photodiode for your light-sensing needs!

Easily parable with your Arduino board through our Grove plug and play system, you’ll save yourself some trouble of connecting jumper wires and soldering it on!

Its features include:

  • Dual OpAmp chip LM358 on board
  • Analog module
  • Onboard grove port for easy interfacing
  • Convertable electrical signal output
    • Depends on the ADC on your controller board, E.g. it can output 0-255 for an 8-bit ADC)
  • Small form factor
  • Recognize wider spectrum

Phototransistor option: Grove – Light Sensor (P) v1.1

Need a light sensor that uses a phototransistor instead of the traditional light-dependent resistor (LDR)? This option is for you!

Packed with an LS06-S phototransistor, this light sensor module has much more linear analog output conforming to illuminance, ranging from 0 to the supplying voltage of normally 5V.

Its features include:

  • Linear analog output conforming to illuminance
  • Low dark current and low working lux
  • Integrated Grove port for ease of usage
  • Small form factor

Digital signal output option: Grove – Digital Light Sensor

If you’re looking for a digital signal output option alongside a selectable light spectrum range, the Grove – Digital Light Sensor is the one for you!

Based on the I2C light-to-digital converter TSL2561 that does the digital signal outputting, this light sensor module features dual light-sensitive diodes, where you can switch between 3 modes to take your reading!

  • These three modes are infrared mode, full-spectrum, and human visible mode
    • The human visible mode gives you reading close to your eye feelings

Its features include:

  • Wide dynamic range: 0.1 – 40,000 LUX
  • Wide operating temperature range: -40deg to 85deg
  • High-resolution 16-Bit digital output at 400 kHz I2C Fast-Mode
  • Programmable interrupt function with User-Defined Upper and lower threshold settings
  • Selectable detection modes

Sunlight detection option: Grove – Sunlight Sensor

Though it’s Made for direct sunlight detection with UV, this digital light sensor is suitable for a variety of other light sources as well, including visible and infrared light.

Based on the SI1145 sensor from SiLabs, it’s a low-powered, reflectance-based, infrared proximity, UV index and ambient light sensor with an I2C digital interface and programmable-event interrupt output.

Since performance is key, this light sensor offers a wide dynamic and spectrum detection range to top it all off!

Its Features Include:

  • Digital light sensor
  • Wide spectrum detection range
  • Programmable configuration
  • 3.3/5V Supply
  • Detect sunlight directly
  • Grove compatible
  • I2C Interface(7-bit)

Smart light sensor option: Grove – Heelight Sensor

Perhaps the most interesting light sensor option on this list is the Grove – Heelight Sensor! Unlike any other light sensor on this list, this only does contactless light control through voice recognition.

Based on heelight, a smart colorful bulb controlled by digital sound waves, this sensor doesn’t require Bluetooth, WiFi, or ZigBee!

However, do note that this sensor only recognizes digital voice.

Its features include:

  • Digital voice recognition
  • Support for over 500 digital voice commands
  • Compatible with Grove system

How to use a light sensor with Arduino?

We’ve gone through the theoretical side of light sensors and now its time for our light sensor Arduino tutorial.

For today’s tutorial, we’ll be using the Grove – Light Sensor v1.2 module and an LED bar to build a simple circuit that changes based on light!

Here’s what you need:

  • Seeeduino is Seeed’s very own Arduino board, built with relative advantages over the regular

Hardware connections:

  • Step 1: Connect Grove – Light Sensor to port A0 of the Grove – Base Shield
  • Step 2: Connect Grove – LED Bar to port D2 of Grove – Base Shield
    • You can opt to directly connect Grove – Light Sensor to Seeeduino as well
  • Step 3: Plug Grove – Base Shield into Seeeduino
  • Step 4: Connect Seeeduino to PC through a USB cable

It should look something like this after the above steps:

Software configurations with Arduino Code

  • Step 1: Download the Grove-LED Bar Library from Github
  • Step 2: Refer to How to install library for installation of library for Seeeduino
  • Step 3: Copy the code below into Arduino IDE and upload it
#include <Grove_LED_Bar.h>

Grove_LED_Bar bar(3, 2, 0);  // Clock pin, Data pin, Orientation

void setup()
  // nothing to initialize

void loop()

  int value = analogRead(A0);
  value = map(value, 0, 800, 0, 10);

  • The LED Bar should now change based on light

If you would like a video tutorial on the above light sensor, you may refer to this instead:

Resources and Going Further

Light Sensor projects:

Want to go further than just building a light sensor circuit with LED? Try this list of light sensor projects available on our hackster.io page!

Product Resources:

For Grove – Light Sensor v1.2 and Grove – Light Sensor (P) v1.1

For documents on the three other light sensor recommendations, you can visit its respective product pages 


That’s all for today on light sensors. I hope with today’s blog, you get a deeper understanding of what it is, how it works, its usages, and what it takes to build one with an Arduino!

To help you easily get started, do consider the list of touch sensor I’ve recommended!


January 2020