Akhil George
Published © CERN-OHL

Raspberry Pi Pico Ambient Light Sensing with TEMT6000

Interfacing the TEMT6000 Ambient Light Sensor with a Raspberry Pi Pico to measure ambient light levels.

IntermediateProtip1 hour880
Raspberry Pi Pico Ambient Light Sensing with TEMT6000

Things used in this project

Hardware components

Raspberry Pi Pico
Raspberry Pi Pico
×1
Gravity: Analog Ambient Light Sensor TEMT6000
DFRobot Gravity: Analog Ambient Light Sensor TEMT6000
any TEMT6000 sensor is fine
×1

Story

Read more

Schematics

Circuit Diagram

Code

Code for measuring ambient light

MicroPython
import machine
import utime

# Analog input pin for the TEMT6000 sensor
temt6000_pin = machine.ADC(26)

def read_light_intensity():
    light_value = temt6000_pin.read_u16()
    light_percentage = (light_value / 65535.0) * 100
    return light_percentage

try:
    while True:
        light = read_light_intensity()
        print("Light Intensity: {:.2f}%".format(light))
        utime.sleep(0.5)  # Sleep for 0.5 seconds (500 milliseconds)

except KeyboardInterrupt:
    pass

Credits

Akhil George
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.