This is uPython code for a lamp controller to drive neo pixel RBG LED strips and additional white LEDs via PWM.
The hardware is build around a Raspberry Pi Pico. Schematics and the Bord is layout using KiCad. The software is written in MicroPython with the Model View Controller (MVC) design pattern.
| Folder | Content |
|---|---|
| mock | uPython mocking objects to test lamp fw on pc |
| pcb | Schematic and PCP design. Created with KiCad |
| pic | Pictures of the lamp |
| src | uPython source code |
| Software | Software to monitor and read/write written in Python. |
The schematic of the lamp controller. There are some UI elements and the connectors to drive the WS2812B LED strip and the white LEDs via PWM. To power the LED a separate
power supply is used. The Raspberry Pi Pico USB is protected via shotkey diodes that a connection to the PC can be done in parallel.
The software follows the Model View Controller (MVC) design pattern. The basic API to the different LED types are in separate modules.
The UI has 3 Buttons a menu button and a + and - butten depending on the menu context. Additionaly two rotary encoders where the first one usually switch between the context and the second one changes the brightness. The actual menu is shown via LESs on the UI.
The Modes.
- White light mode: Encoder 1 changes the color temperature Encoder 2 the brightness. With the +/- button the controll between the RBG LED and the white LED can be switched.
- Full color mode: +/- selects between RBG and encoder 1 changes the intensity. Encoder 2 the total brightness.
- Solid color mode: +/- button change the color. Encoder 2 the brightness.
- Animation mode: +/- button changes the animation. Encoder 1 the speed and Encoder 2 the brightness if applicable.
To be able to access the pyboard in Menu 4 is a small backdoor to exit to the REPL. Set both encoders to 0 and press - multiply times.
The mechanics was build around a magnifying glass and an WS2812B RBG LED ring, that the height of the lamp can be adjusted. This was done agile without any concrete plans.






