TSL2561 Ambient Light Sensor

How much illumination does my workbench require? — NaveTECH & UNIR Series — Episode # 14

J3
Jungletronics

--

What is the difference between LUX and Lumen?

To address this inquiry, we’ll utilize a Light-to-Digital converter equipped with an I2C interface: the TSL2561 (GY-2561):

TSL2561 Datasheet; LH is employed to add or remove solder from these pads, thus modifying the chip’s address.
It uses a chip TSL2561 which is a 16-bit digital I2C light sensor from Texas Advanced Optoelectronic Solutions, Incorporated (TAOS Inc) based in Plano, Texas.

The TSL2561 luminosity sensor represents a cutting-edge digital light sensing solution, suitable for diverse lighting conditions. Unlike traditional low-cost CdS cells, this sensor offers superior precision, enabling precise Lux calculations. Its versatility extends to configurable gain and timing ranges, facilitating the detection of light levels spanning from 0.1 to over 40,000 Lux in real-time. Notably, this sensor integrates both infrared and full spectrum diodes, empowering separate measurements of infrared, full-spectrum, or human-visible light with exceptional accuracy.

So, how much illumination does my workbench require?

The appropriate lux level for illuminating your workbench depends on the nature of the tasks you perform and the precision required. However, there are some general guidelines to consider:

  1. Lighting Standards: The Illuminating Engineering Society (IES) provides recommendations for various tasks and environments. For detailed workbenches, such as those used in electronics assembly or fine craftsmanship, IES recommends lux levels typically ranging from 500 to 1500 lux.
  2. Task Complexity: Tasks that involve intricate details or small components may require higher lux levels to ensure accurate visibility and reduce eye strain. Conversely, tasks that involve rough work or less precision may require lower lux levels.
  3. Personal Preferences: Some individuals may prefer brighter lighting for improved visibility and comfort, while others may find excessively bright lighting uncomfortable. It’s essential to consider personal preferences and adjust the lighting accordingly.
  4. Adjustability: Having adjustable lighting options, such as dimmers or task-specific lighting fixtures, can allow you to tailor the lighting to your specific needs for different tasks or times of day.
  5. Uniformity: Ensure that the lighting is uniform across the entire workbench surface to minimize shadows and ensure consistent visibility of your workspace.

Ultimately, the ideal lux level for your workbench will depend on factors such as the type of work you do, your personal preferences, and any applicable industry standards or regulations. Experimenting with different lighting setups and consulting lighting professionals or ergonomic experts may help you determine the optimal lighting conditions for your workbench.

Recommended Lux by Application and Age

In my workbench area, we typically achieve around 800 lux, which falls within the optimal range. How about yours?

This chip is capable of measuring infrared (IR) radiation as well. It’s important to understand the safe limits of IR exposure. How much IR exposure is considered safe, and what are the potential risks to our skin? Take your time to watch this informative video on IR from NASA:

Let’s put theory into practice:

0#Step — Prepare your Arduino like this:

This is a piece of cake!

1#Step — Upload this code:

We’ve disabled the output for full spectrum + IR. Instead, the current output displays the raw lux of the ambient light. Please note that the difference between the Full and IR readings represents the intensity of visible light.

This Arduino code is used to interface with the TSL2561 light sensor module via I2C communication. Here’s a breakdown of the code:

1 . Include Libraries: The code includes the Wire library (#include <Wire.h>) for I2C communication;

2 . Define Constants: The I2C address of the TSL2561 sensor is defined as Addr (0x39 — LH: Floating |||); other options are: 0x49 (LH: VCC ||_|) and 0x29 (LH: GND |_||); see this page (section: Changing the solder jumpers)

3 . Setup Function: Initializes I2C communication and serial communication at a baud rate of 9600; Configures the TSL2561 sensor → Writes to the control register to set the sensor to Power ON mode; → Writes to the timing register to set the integration time to 402ms; Waits for 300 milliseconds to allow the sensor to initialize;

4 . Loop Function: Declares an array data to store the sensor readings; Iterates over each of the four channels of the sensor; Sends a command to the sensor to select the appropriate data register for each channel; Requests 1 byte of data from the sensor; Reads the received data into the data array; Waits for 200 milliseconds between each channel reading; Converts the raw sensor data into meaningful values for the Full Spectrum, Infrared, and Visible light; Outputs the processed data to the serial monitor; Full Spectrum (IR + Visible) value; Infrared (IR) value; Visible light value (difference between Full Spectrum and Infrared);

5 . Data Conversion: The raw data read from the sensor is combined from two bytes into a single 16-bit value for each channel (ch0 and ch1). These values are then used to calculate the Full Spectrum, Infrared, and Visible light values;

6 . Serial Output: The processed data is printed to the serial monitor for observation and analysis.

Overall, this code demonstrates how to initialize and read data from the TSL2561 light sensor module over the I2C bus, providing insight into the ambient light conditions in terms of Full Spectrum, Infrared, and Visible light.

The GY-2561 is a light sensor module based on the TSL2561 sensor chip. Here are some common applications of the GY-2561 light sensor module:

  1. Automatic Lighting Control: The GY-2561 can be used in automatic lighting systems to adjust the brightness of indoor or outdoor lights based on ambient light levels. For example, it can control streetlights, garden lights, or indoor lighting in response to changes in natural light;
  2. Smart Home Systems: In smart home setups, the GY-2561 can help optimize energy usage by automatically adjusting lighting levels according to daylight conditions. It can be integrated with home automation platforms to create energy-efficient and comfortable living environments;
  3. Security Systems: The GY-2561 can be utilized in security systems to detect changes in ambient light levels. For instance, it can trigger outdoor lights to turn on when it gets dark or activate surveillance cameras based on ambient light conditions;
  4. Environmental Monitoring: This sensor can be employed in environmental monitoring systems to measure light intensity in various settings, such as greenhouses, agricultural fields, or weather stations. It can provide valuable data for optimizing plant growth conditions or monitoring weather patterns;
  5. Display Brightness Control: The GY-2561 can adjust the brightness of displays (e.g., LCD or LED screens) based on ambient light levels to ensure optimal visibility and reduce eye strain. This feature is commonly found in smartphones, tablets, and laptops;
  6. Photography: In photography applications, the GY-2561 can be used to measure ambient light levels and assist in setting the exposure parameters for capturing well-exposed photographs, especially in situations where manual adjustment is required;
  7. Education and Experimentation: The GY-2561 module is also widely used in educational settings and hobbyist projects to teach students about light sensing principles and to experiment with various applications related to light measurement and control.

Overall, the GY-2561 light sensor module finds applications in a diverse range of fields, including home automation, security, environmental monitoring, display technology, photography, education, and experimentation. Its versatility and ease of use make it a popular choice for a wide variety of projects and applications`.

ApplicationRecommended Lux Ages 25–65:

Recommended lux levels for general work conditions. Source: IES Handbook.

Image from this link

What is the visible light spectrum?

The visible light spectrum is the segment of the electromagnetic spectrum that the human eye can view. More simply, this range of wavelengths is called visible light. Typically, the human eye can detect wavelengths from 380 to 700 nanometers.

More About TLS2561

AMPLIFICATION:

You can have either a gain of 0 (no extra gain, good in low-light situations) or a gain of 16 which will boost the light considerably in dim situations.

This statement refers to the gain settings available in certain sensors, particularly in low-light conditions. Here’s a breakdown of what it means:

1 . Gain Settings:

  • Gain settings control the amplification of the signal from the sensor.
  • A gain of 0 means there is no extra amplification applied to the signal. This is suitable for situations where there is already sufficient light available, and additional amplification could lead to overexposure or inaccurate readings.
  • A gain of 16 indicates that the sensor’s signal is boosted considerably, particularly in dim or low-light situations. This amplification helps the sensor detect and capture more light, improving its sensitivity and allowing it to operate effectively in low-light conditions.

2. Usage:

  • Choosing the appropriate gain setting depends on the specific lighting conditions of the environment where the sensor is deployed.
  • In well-lit environments, a gain of 0 may be sufficient to capture accurate readings without introducing noise or overexposure.
  • In low-light environments, such as nighttime or indoor settings with dim lighting, a gain of 16 can significantly enhance the sensor’s ability to detect and measure light levels effectively.

3. Trade-offs:

  • While higher gain settings can improve sensitivity in low-light conditions, they may also introduce more noise or artifacts into the signal.
  • Care should be taken when selecting the gain setting to ensure a balance between sensitivity and signal quality.
  • Additionally, higher gain settings may increase power consumption and potentially affect the dynamic range of the sensor.

In summary, the availability of gain settings allows users to adjust the sensitivity of the sensor to suit the specific lighting conditions encountered in their application, providing flexibility and improved performance in varying environments.

This is my setup, a standard I2C device. It’s straightforward to configure and operate. Check out the Adafruit library at this link; it’s excellent!

INTEGRATION:

The timing setting of the TSL2561 sensor determines the integration time, which is the duration for which the sensor collects light data before converting it into a digital signal. This setting is crucial for adjusting the sensor’s sensitivity to different light levels.

Here’s an explanation of the timing setting:

1. Integration Time:

  • Integration time refers to the period during which the sensor accumulates photons from the surrounding environment. A longer integration time allows the sensor to collect more light, making it more sensitive in low-light conditions but slower in response.

2. TSL2561 Timing Register:

  • The TSL2561 sensor has a timing register where you can set the integration time. The integration time is specified in milliseconds (ms).
  • Common integration times for the TSL2561 sensor range from 13.7 ms to 402 ms, with longer integration times providing greater sensitivity in low-light situations.

3. Adjusting Timing Setting:

  • To adjust the timing setting of the TSL2561 sensor, you typically write a value to the timing register using the appropriate commands over the I2C communication interface.
  • Different integration times may be suitable for different applications. For example, shorter integration times are preferable for fast-moving objects or environments with rapidly changing light levels, while longer integration times are better for capturing subtle variations in low-light conditions.

4 . Considerations:

  • When selecting the timing setting, consider factors such as the ambient light level, the speed of the objects being detected, and the desired balance between sensitivity and response time.
  • It’s essential to experiment with different timing settings to determine the optimal configuration for your specific application.

In summary, the timing setting of the TSL2561 sensor controls the integration time, affecting the sensor’s sensitivity and response time to light changes. Adjusting this setting allows you to optimize the sensor’s performance for various lighting conditions and application requirements.

That’s all folks!

👉GitHub (Projects #47)

The TSL2561 sensor offers high performance, flexibility, and ease of integration, making it a popular choice for light sensing applications in diverse fields such as consumer electronics, automotive, industrial automation, and environmental monitoring. Its combination of sensitivity, dynamic range, and programmability makes it well-suited for applications requiring accurate and reliable light intensity measurements under varying environmental conditions.
Exploring Light Intensity Variations in an Office Setting.

Credits & References:

Measuring illuminance using GY-2561 and ESP-WROOM-02 by okiraku-camera.tokyo

TSL2561 Luminosity Sensor by learn.adafruit.com

TSL2561 Luminosity Sensor Hookup Guide by SparkFun

TSL2561 Datasheet by Adafruit

NASA — Tour of the EMS 05 — Visible Light Waves by science.nasa.gov

Visible Light by science.nasa.gov

What are Infrared Waves? by science.nasa.gov

adafruit/ Adafruit_TSL2561 by Adafruit GitHub

Luminosity Sensor, GY2561 TSL2561 by www.amazon.com

TAOS INC linkdin

Any-lamp | Switch to LED | Lumen to Watt by Any-lamp.co.uk

Compare lumens to watts by www.any-lamp.com

Lux to Lumens Calculator: How Much Light Do You Need? by www.bannerengineering.com

Arduino Light Sensor — TSL2561 and Experiments with Infrared and Visible Light by Maker Portal

In this experiment, I initially stayed indoors at my desktop and then ventured outside around 10 am when the sun was shining. I observed an impressive range of light intensity, spanning from 600 to nearly 50,000 lux. It was truly an awesome spectrum to witness!

https://docs.google.com/spreadsheets/d/e/2PACX-1vSiixv6j1qp9vQef5TRiAxabxxMGBYqI7G6I6s6P4djexD1bYo_qpezKzxC4dScQBo-GQtw--yimwPf/pubchart?oid=962913347&format=interactive

--

--

J3
Jungletronics

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Ruby, Rails, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!