How To Use a Light Sensor with a Raspberry Pi Pico or Pico 2 @dev-neil-a
How To Use a Light Sensor with a Raspberry Pi Pico or Pico 2  @dev-neil-a
Uploaded January 2026 | Updated November 2026, 4 minutes ago
Playlist of other Pico videos and projects:
youtube.com/playlist?list=PLg0AM98jT164MVVE-rteHEckIC0YDIwmS

In this Raspberry Pi Pico 2 project video tutoria, I'll teach you how you can use an ambient light sensor with a Raspberry Pi Pico 2 microcontroller and MicroPython. This simple project will get the current light level and then turn on the Pico 2's onboard LED when the light is low.

This project will also work on the original Pico.

You can expand on this to do some home automation actions, such as activate an automation on Home Assistant to turn on or off a smart light or smart power socket for example.

I'll be using VS Code as my code editor but you can follow along if you use Thonny instead.

Timestamps:

00:00 Introduction
00:18 What You'll Need
01:12 Connecting Everything Together
01:56 Building the Code
07:23 Wrap Up

Link to the source code on GitHub:
github.com/York13Pud/pico-code-samples/tree/main/006-light-sensor

Link to the blog post:
dev.to/dev_neil_a/how-to-use-a-raspberry-pi-pico-2-with-a-light-sensor-3p6d

Links to the hardware used:

Pico 2 W:
thepihut.com/products/raspberry-pi-pico-2-w?variant=54063378760065

USB-C to Micro-B Cable:
thepihut.com/products/usb-c-to-micro-usb-cable-black

USB-A to Micro-B Cable:
thepihut.com/products/usb-to-micro-usb-cable-0-5m

Breadboard:
thepihut.com/products/breadboard-for-pico

Adafruit VEML7700 Sensor:
thepihut.com/products/adafruit-right-angle-veml7700-lux-sensor-i2c-light-sensor-stemma-qt-qwiic?variant=41513525444803

Dupont Male-to-Male Cables:
thepihut.com/products/thepihuts-jumper-bumper-pack-120pcs-dupont-wire

STEMMA QT / Qwiic JST-SH 4-pin to 4 Male Dupont Wires:
thepihut.com/products/stemma-qt-qwiic-jst-sh-4-pin-to-premium-male-headers-cable?variant=19932905209918

#python #coding #tutorial #programming #howto #pico2 #pico #raspberrypi #project #guide #microcontroller
How To Use a Light Sensor with a Raspberry Pi Pico or Pico 2Useful Linux CLI Tools - Test your Internet Speed Using speedtest-cliHow to to keep a process active after logging off on Linux using nohupUse the mtr Command on Linux to Show Ping & Traceroute ResponsesGMKtec Intel N97 NucBox G5 Mini PC Review ad UnboxingCheck if a String has All Printable Characters Using PythonPython: Get The Path Of The Current Directory #shortsHow to create groups with the groupadd command | Linux for Beginners #shortsHow to Use sftp on Linux to Securely Copy Files Between ServersHow to Modify Linux Group Names | Linux CLI for BeginnersPython Example: Subtract Values Between Two Counter Objects [How To]My Experience Upgrading To EE Full Fibre Broadband
Dev Neil A |

How To Use a Light Sensor with a Raspberry Pi Pico or Pico 2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER