sensor-experiments

Objective

This experiment uses the TSL2561 light sensor to measure ambient light intensity.

Required Components

No Ads Available.

Working Principle

The TSL2561 sensor uses both infrared and visible light to measure the total light intensity.

Circuit Diagram

Arduino Code


/*
 * Light Measurement using TSL2561
 * This code reads the light intensity from the TSL2561 sensor.
 */

#include 
#include 
#include 

Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(12345);

void setup() {
  Serial.begin(9600);  
  if (!tsl.begin()) {
    Serial.println("Sensor not found");
    while (1);
  }
}

void loop() {
  sensors_event_t event;
  tsl.getEvent(&event);
  
  if (event.light) {
    Serial.print("Light Level: ");
    Serial.println(event.light);
  }
  delay(1000);
}
            

Results

The serial monitor will display the measured light intensity in lux.

Applications

Conclusion

The TSL2561 light sensor provides an efficient method for measuring ambient light levels, useful in applications like smart lighting systems and light-sensitive devices.

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!