Introduction
Light sensors are probably one of the most common sensors in life. They can be found in your laptop, phone or home lighting system.
A light sensor measures the level of light in a room or ambient light in a space.
This EASY plug TEMT6000 light sensor uses a special ambient light detector (TEMT6000) with spectral response that closely emulates the human eye.
It does react well to very small changes in a wide range of brightness, however, it does not react well to IR or UV light. The sensor can help you to to detect the light density.
Specification
Supply Voltage: +5VDC 50mA
Interface:Analog input interface
Weight: 3.6g
Connection Diagram:
Sample Code
You can not get more simple than this – This just reports the reading from the sensor to the serial terminal: 0-1023 with 1023 being very bright, and 0 being very dark.
int temt6000Pin = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
int value = analogRead(temt6000Pin);
Serial.println(value);
delay(100); //only here to slow down the output so it is easier to read
}
Result
After connecting the power and burning the code, please open the serial monitor, and set the baud rate of 9600, you can see the simulated value of the current light intensity, as the diagram shown below.