← Electronics Lab
Adafruit KB2040
3D Printed LED Panel Light
Soft, diffused white light from a single GRBW NeoPixel and an Adafruit KB2040.
KB2040NeoPixel GRBWCircuitPythonLighting
Overview
A compact panel light: one GRBW NeoPixel, driven by an Adafruit KB2040 running CircuitPython, sits in a 3D printed housing behind a diffuser. Using the NeoPixel's dedicated white channel gives a clean, pure white glow - great for desk accent lighting or lighting a piece of art.
- Single GRBW NeoPixel - bright, pure white from the W channel
- Designed to fit a 3D printed panel housing
- Colour and brightness are one line each to change
Parts
- Adafruit KB2040 — RP2040 microcontroller
- NeoPixel GRBW LED (1 pixel)
- 3D printed panel housing
- Diffuser panel or frosted acrylic cover — optional
Wiring
NeoPixel to KB2040
| From | To | Notes |
|---|---|---|
| KB2040 D5 | NeoPixel Data In | control signal |
| KB2040 3V | NeoPixel VCC | power |
| KB2040 GND | NeoPixel GND | ground |
- Power the NeoPixel from 3V or 5V depending on your LED's specifications.
Directions
- Install CircuitPython on the KB2040.
- Copy
neopixel.mpyfrom the Adafruit CircuitPython Library Bundle intoCIRCUITPY/lib/. - Copy
code.pyto the root of theCIRCUITPYdrive. - Wire the NeoPixel as shown in the table.
- Print the panel housing, fit the electronics and the diffuser, and plug in USB power.
Libraries
Copy these from the Adafruit CircuitPython Library Bundle into CIRCUITPY/lib/.
- neopixel.mpy
Make it yours
BRIGHTNESS = 1.0- overall brightness (0.0 to 1.0)pixels[0] = (0, 0, 0, 255)- the colour as (R, G, B, W); this is pure white
Code
code.py Download
The copy here has a stray Markdown line (```python) removed from the top of the GitHub version so it runs as-is.
import board
import neopixel
import time
# Configuration
NUM_PIXELS = 1
PIXEL_PIN = board.D5
BRIGHTNESS = 1.0
pixels = neopixel.NeoPixel(
PIXEL_PIN,
NUM_PIXELS,
brightness=BRIGHTNESS,
auto_write=False,
pixel_order=neopixel.GRBW
)
# Turn off any previous color
pixels.fill((0, 0, 0, 0))
# Set light to pure white using the W channel
pixels[0] = (0, 0, 0, 255)
pixels.show()
Credits & licence
Released under the MIT License — Copyright (c) 2025 Lark216. Free to use, modify and share.