This post is all about TEMT6000 Ambient Light Sensor & Arduino hookup guide. We will interface the TEMT6000 sensor with Arduino & 16×2 LCD Display. The light intensity will be measured in terms of percentage and will be displayed on LCD Display.
Overview: TEMT6000 Light Sensor & Arduino
As we know, most of the modern devices which use Light sensors are notably used for auto-brightness according to light intensity. The device includes mobile phone screens and digital cameras for adjusting exposure. So here we will use one of the best light sensors, i.e TEMT6000 Ambient Light Sensor and interface it with Arduino to measure the light intensity.
We will discuss here the TEMT6000 Ambient Light Sensor and understand the concept of working of the light sensor. Generally, most light sensors work on the same principle. They will detect the brightness of its surroundings. The sensor can also be used in Spectrometer for Triad Spectroscopy.
Components Required
| S.N. | Components | Quantity | Purchase Links |
|---|---|---|---|
| 1 | Arduino UNO Board | 1 | Amazon | AliExpress |
| 2 | TEMT600 Light Sensor | 1 | Amazon | AliExpress |
| 3 | 16x2 LCD Display | 1 | Amazon | AliExpress |
| 4 | Potentiometer 10K | 1 | Amazon | AliExpress |
| 5 | Connecting Wires | 10 | Amazon | AliExpress |
| 6 | Breadboard | 1 | Amazon | AliExpress |
TEMT6000 Sensor Overview
As you can see from the image below, the TEMT6000 is a simple breakout board sensor. There are three pins labeled on the both top & bottom of the board.
The function of each pin is given in the table below.
The TEMT6000 is made up of a single phototransistor, which acts just like a simple NPN transistor. The greater is the incoming light on the Base, the more the current flowing from the Collector to the Emitter. The sensor only works in the visible spectrum (390–700 nm). The Infrared, ultraviolet ray or any other light will have no effect on the sensor.
The sensor operates in the range of 3.3V to 5V. The breakout board has a voltage divider circuit connected to the 10K Resistor. The TEMT600 acts as one of the resistors in the divider network. As the light falls on the phototransistor surface, the resistance value changes which changes the voltage on the SIG pin. An Arduino or any other microcontroller is used to read the value and then to measure illuminance and light intensity.
How Light Detection Works
TEMT6000 Ambient Light Sensor measures illuminance. The Illuminance is a measure of the total quantity of visible light emitted by a source. It is referred to as luminous flux and measured in lumens (lm) per meter square.
But the question is why does the TEMT6000 measure illuminance only? The answer is measuring the intensity of light without factoring in distance is very difficult. For example, if you have a bright source far away and a dim source very close, they can appear to have the same brightness. This is because the brighter source’s light will have to dissipate over a larger volume compared to the lesser bright light. This is why the sensor will read a smaller value if you move the same source of light farther away from it, essentially increasing the amount of space that the same amount of light has to fill between the source and the sensor.
Here is a graphical relationship between the current (in µA) and illuminance of the immediate vicinity perceived by the sensor:
Interfacing TEMT6000 Ambient Light Sensor with Arduino
In the circuit diagram below the TEMT6000 light sensor & 16×2 LCD is interfaced with Arduino. This circuit is used to display the Light intensity in terms of percentage.
Connect VCC pin of TEMT6000 to Arduino 5V pins & GND to GND. Connect its SIG pin to Arduino Analog pin A0.
Similarly connect pin 1, 5, 16 of LCD to GND & 2, 15 to VCC. Use 10K Potentiometer at pin 3 of LCD to adjust the contrast of LCD. Similalry connect pin 4, 6, 11, 12, 13, 14 of LCD to Arduino 12, 11, 5, 4, 3, 2 pin.
Source Code: Measuring Light Intensity
The source code for interfacing TEMT6000 Ambient Light Sensor with Arduino is given below. The analog value is read from the SIG pin of light sensor using Arduino. Using some mathematical calculation the analog value is converted into light intensity as percentage.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int temt6000Pin = A0; float light; int light_value; void setup() { Serial.begin(115200); lcd.begin(16, 2); pinMode(temt6000Pin, INPUT); //data pin for ambientlight sensor lcd.setCursor(0, 0); lcd.print("Light Intensity"); } void loop() { int light_value = analogRead(temt6000Pin); light = light_value * 0.0976;// percentage calculation Serial.println(light); lcd.setCursor(0, 1); lcd.print(light); lcd.print(" %"); delay(500); } |
Source Code: Measuring Illuminance
The source code for interfacing TEMT6000 Ambient Light Sensor with Arduino and Illuminance Measurementis given below. The analog value is read from the SIG pin of light sensor using Arduino. Using some mathematical calculation the analog value is converted into Illuminance.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { Serial.begin(9600); lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Illuminance"); } void loop() { //lcd.clear(); float volts = analogRead(A0) * 5.0 / 1024.0; float amps = volts / 10000.0; // across 10,000 Ohms float microamps = amps * 1000000; float lux = microamps * 2.0; lcd.setCursor(0, 1); lcd.print(lux); lcd.print(" lux"); delay(750); } |
Video Tutorial
You can check this post if you want to measure the UV Ray Intensity as well: UV Sensor ML8511.













