Interfacing and Programming Light Sensors – Tutorials and Resources

| 1 Comment

Advertisement

Today we are releasing another article from a long series about sensors, how to interface the sensors with electronic boards, and how to programming the sensors in order to display values generated by these. In this article, we present some of the most used light sensors in robotics as well as interfacing methods and how to program the sensors.

Light sensors come in different shapes and dimensions, they can be rounded, with corners, or even half a sphere. These sensors are simple, cheap, and can be used in a wide range of applications like a wheeled robot that follow a line or change the statements depending on light intensity. Any user can decide how to use the potential of light sensors in new and innovative ways for building wonderful robots, from simple to advanced applications.

In another article we make an overview of most popular light sensors used in robotics applications, and the tutorials from this article are based on this list.

How a light sensor works
Light sensors are also known as “Photoelectric Devices” or “Photo Sensors” since these are designed to convert photons into electrons (electricity). In few words a light sensor has as input light energy (infrared, visible light, or ultraviolet), while the output is an electric signal whose value depends on the amount of light detected by the sensor.

Tutorials and Resources

Below are displayed 9 most used light sensors in robotics and up to 16 tutorials that teach you how to programming and interface the light sensors with Arduino board.
Below you’ll find 16 tutorials that teach you how to interface and programming Arduino board to display the values generated by sensors. Each sensor has attached one or more quality tutorials with explanations and programming lines that can be copied into Arduino memory and start building simple applications based on these programs.

Photocell

Photocell

Photocell


Photocells are simple, cheap, small sensors for light detection. All these tutorials teaching you how to interface a photocell sensor, how to test, and how to program an electronics board to detect the light intensity with a Photocell sensor.

  • Arduino Lesson 9. Sensing Light – lesson for learning how to use analog input for measuring the light intensity with the simple photocell sensor. In this project uses a 5mm red LED to generate light, while other components like resistors, shift register, or half-size breadboard are interfaced with the Arduino UNO board;
  • Motion and Light Sensors with Arduino (and Without) – example how a simple light sensor can be used together with a motion sensor and the Arduino board to turn on an LED when is darkness or when motion is detected;
  • Photocells – from basic information to programming lines, Photocells are a comprehensive tutorial from where users can learn how the light is measured, how to test a photocell sensor, connecting and using a photocell to Arduino Diecimila board;
  • Light Sensor using Arduino – simple tutorial how to program the Arduino UNO board in order to change the condition statements depending on light intensity;
  • Simple Light Reading With LDR + Arduino – simple example how to interface an LDR (light dependent resistor) / Photo-resistor sensor with Arduino UNO board and measure the voltage on the LDR using the analog read from the Arduino board;
  • Arduino-Controlled Night Light – step by step tutorial how to interface and programming the Arduino board that automatically turn on LED’s when the light is turned off;

Grove – Light Sensor

Grove - Light Sensor

Grove – Light Sensor


The Grove Light Sensor uses GL5528 photoresistor to detect the light intensity. When the sensor detects an increased light intensity, the resistance of the sensor decreases.
The sensor has a voltage range between 3 and 30 Volts, while its interface is Grove compatible.

  • Grove – Digital Light Sensor – tutorial how to interface and programming the Grove Digital Sensor. Programming code allows the user to display the light intensity detected by the sensor;

LilyPad Light Sensor

LilyPad Light Sensor

LilyPad Light Sensor


With a 20mm outer diameter, the rounded light sensor from LilyPad has a maximum output of 5V when is exposed to the light and a minim of 0V when is dark.

VCNL4000

VCNL4000

VCNL4000


VCNL4000 is a combination between a proximity sensor based on infrared light and ambient light sensor. Using IR light, the sensor can detect objects in a range of about 20 cm. Light intensity and proximity data can be collected over an I2C interface.

Light Sensor-BH1750

Light Sensor-BH1750

Light Sensor-BH1750


BH1750 light intensity sensor was designed in the labs of DFRobot and can be appreciated for a higher resolution and the ability to be used in a wide range of applications.

  • Light Sensor – guide how to interface the BH1750 light sensor and display the light detection in Lux measurement units of illumination;

TEMT6000 Breakout Board

TEMT6000 Breakout Board

TEMT6000 Breakout Board


Designed to act like a transistor, the TEMT6000 ambient light sensor has an increased analog voltage on the output pin when the light intensity is high.

Light Intensity to Frequency IC

Light Intensity to Frequency IC

Light Intensity to Frequency IC


Simple programmable light sensor based on IC frequency from TAOS and has as outputs a pulse train or a square wave with a frequency directly proportional to light intensity.

Color Light Sensor Board

Color Light Sensor Board

Color Light Sensor Board


A small light sensor designed for applications where is required to detect the differences between different visible colors.

ColorPAL

ColorPAL

ColorPAL


ColorPAL is a dual sensor including light and color features. The sensor is more accurate compared with other sensors and has a simple interface that makes friendly.

  • ColorPal Arduino Demo – tutorial for programming and interfacing the sensor with an Arduino board. The code available in the article display serial RGB data based on sensor detection;
Advertisement
Related Articles
Dragos George Calin
Dragos George Calin is an IT analyst who graduated Faculty of Electrical and Mechanical Engineering, specialization Industrial Automation and Informatics with a Bachelor of Science Degree in Engineering, Automation and Computer Science. He has a great passion for robots and web development.
1 comments
mohd rais
mohd rais

Have you tried Grove Digital Light Sensor from Seeedstudio? From my experience it did not give good result, which is unreliable, when compared to hand held luxmeter.