DIY - Experiments with Light
Requirements
Destinations of the Station
In this station, you use a light sensor to measure the illuminance of visible light in lux.
Materials
- Light sensor
TSL 45315
Basics
Electromagnetic energy moves in waves through space. Their spectrum ranges from very long radio waves to very short-wave gamma radiation. The human eye can only perceive a very small part of this spectrum: the visible light. Our sun is the source of energy across the spectrum. The Earth's atmosphere protects us from being exposed to excessive levels of radiation that could be life-threatening for us. For us, the intensity of visible light is particularly interesting. In order to measure the so-called illuminance of the incident light in the visible part of the spectrum, the unit lux is used. It gives the ratio of brightness in lumens per square meter. On a bright sunny day, it is over 100,000 lux, but only about 1 lux in a full moon night.Light intensity
For this measurement, we will use the sensor TSL45315 from AMS-TAOS below. The sensor datasheet shows that its sensitivity is matched to the visible part of the light spectrum, which is approximately between 400 and 700 nm. According to the data sheet, this sensor has a range of 2 to 200,000 lux, with a resolution of 3 lux. Furthermore, the sensor must be operated at 3.3V. The sensor is addressed via the I²C protocol. We address it directly with the following commands taken from the data sheet:TSL45315 Sensor
Construction
Programming
#include "SenseBoxMCU.h"
TSL45315 lux_sensor;
In the setup() function
setup ()
-function the sensor should now be started:void setup(){
lux_sensor.begin();
}
In the loop() function
loop ()
-function, we can use the getIlluminance () command to get the current measured light intensity:void loop(){
lux_sensor.getIlluminance();
}
Exercises
Combine the code from this lesson and add a function to output the data in the serial monitor.Exercise 1
Try to turn an LED on and off depending on the lighting. For this the chapter if/else - Bedingung can be helpful.Exercise 2