https://github.com/seanonet/picopixels
LED matrix controller and animation system for the Raspberry Pi Pico
https://github.com/seanonet/picopixels
embedded led led-controller led-matrix-displays micropython python raspberry-pi-pico
Last synced: 10 months ago
JSON representation
LED matrix controller and animation system for the Raspberry Pi Pico
- Host: GitHub
- URL: https://github.com/seanonet/picopixels
- Owner: SeanoNET
- License: mit
- Created: 2025-07-06T15:07:08.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-13T06:24:29.000Z (11 months ago)
- Last Synced: 2025-07-13T08:24:26.397Z (11 months ago)
- Topics: embedded, led, led-controller, led-matrix-displays, micropython, python, raspberry-pi-pico
- Language: Python
- Homepage:
- Size: 4.31 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LED Matrix Control Suite
A complete LED matrix controller and animation system for the Raspberry Pi Pico using MicroPython and a web-based UI. This project allows you to send commands and animations to a 32x8 LED matrix display over serial using a modern, responsive web interface.
---
## ๐ง Features
- Web UI built with Flask and HTML/JS
- Select serial device from dropdown (backend-driven)
- Multiple animated effects:
- Matrix Rain
- Fire simulation
- Plasma, Waves, Scanner
- Bouncing Balls
- Pong game
- Clock display (12/24h, blinking colon, with/without seconds)
- Scrolling text
- Brightness and speed controls
- Custom text support
- Tested on Raspberry Pi Pico
---
## ๐ง Inspiration & Credit
- Inspired by the **WOPR LED Enclosure** project:
[https://www.printables.com/model/1167457-1u-rack-mount-wopr-leds-enclosure](https://www.printables.com/model/1167457-1u-rack-mount-wopr-leds-enclosure)
- Hardware driver via `max7219.py`:
[https://github.com/mcauser/micropython-max7219](https://github.com/mcauser/micropython-max7219)
- Guide for wiring and setup:
[MicrocontrollersLab - MAX7219 with Pi Pico](https://microcontrollerslab.com/max7219-led-dot-matrix-display-raspberry-pi-pico)
- [Claude](https://claude.ai/)
---
## ๐ฆ Hardware Requirements
- Raspberry Pi Pico (with MicroPython installed)
- MAX7219 8x8 LED Matrix (4 modules recommended, e.g. 32x8)
- Jumper wires, breadboard
### Wiring Example (SPI0)
```
Raspberry Pi Pico pinout diagram (with MAX7219 wiring)
โโ LED (GP25)
โ โโโโโโ
โโโโโโโ โโโโโโโ
UART0 TX | I2C0 SDA | SPI0 RX | GP0 | 01โโ โ โโโโโโ โโ40 | VBUS <โโโ MAX7219 VCC
UART0 RX | I2C0 SCL | SPI0 CSn | GP1 | 02โโ โ โโ39 | VSYS
GND | 03โโ โ โ38 | GND <โโโ MAX7219 GND
I2C1 SDA | SPI0 SCK | GP2 | 04โโ โญโโฎ โโ37 | 3V3_EN
I2C1 SCL | SPI0 TX | GP3 | 05โโ โ โ โโ36 | 3V3(OUT)
UART1 TX | I2C0 SDA | SPI0 RX | GP4 | 06โโ โฐโโฏ โโ35 | | ADC_VREF
UART1 RX | I2C0 SCL | SPI0 CSn | GP5 | 07โโ โโ34 | GP28 | ADC2
GND | 08โโ โ โ33 | GND | AGND
I2C1 SDA | SPI0 SCK | GP6 | 09โโ โโโโโโโ โโ32 | GP27 | ADC1 | I2C1 SCL
I2C1 SCL | SPI0 TX | GP7 | 10โโ โ โ โโ31 | GP26 | ADC0 | I2C1 SDA
UART1 TX | I2C0 SDA | SPI1 RX | GP8 | 11โโ โ โ โโ30 | RUN
UART1 RX | I2C0 SCL | SPI1 CSn | GP9 | 12โโ โโโโโโโ โโ29 | GP22
GND | 13โโ โ โ28 | GND
I2C1 SDA | SPI1 SCK | GP10 | 14โโ โโ27 | GP21 | | I2C0 SCL
I2C1 SCL | SPI1 TX | GP11 | 15โโ โโ26 | GP20 | | I2C0 SDA
UART0 TX | I2C0 SDA | SPI1 RX | GP12 | 16โโ โโ25 | GP19 | SPI0 TX | I2C1 SCL
UART0 RX | I2C0 SCL | SPI1 CSn | GP13 | 17โโ โโ24 | GP18 | SPI0 SCK | I2C1 SDA
GND | 18โโ โ โ23 | GND
I2C1 SDA | SPI1 SCK | GP14 | 19โโ โโ22 | GP17 | SPI0 CSn | I2C0 SCL | UART0 RX
I2C1 SCL | SPI1 TX | GP15 | 20โโ โ โ โ โโ21 | GP16 | SPI0 RX | I2C0 SDA | UART0 TX
โโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ โโ SWDIO
โ โโโโ GND
โโโโโโ SWCLK
MAX7219 โ Pico Wiring Summary:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
VCC โ VBUS (Pin 40)
GND โ GND (Pin 38 or 3 or 8 or 13 or 18 or 23 or 28 or 33)
DIN โ GP3 (Pin 5) โ SPI0 TX
CS โ GP5 (Pin 7) โ SPI0 CSn
CLK โ GP2 (Pin 4) โ SPI0 SCK
```
---
## ๐ป Uploading to the Pico
1. Flash MicroPython firmware to the Raspberry Pi Pico
2. Use [Thonny](https://thonny.org/) to:
- Upload `main.py` and `max7219.py` to the Pico
- Set `main.py` as the startup script
3. Open Thonnyโs serial terminal to view logs or test input commands
---
## ๐ Running the Web UI
### Option 1: Manual Setup
1. Clone this repo on your desktop machine
2. Install dependencies (Python 3.x)
```bash
pip install flask pyserial
```
3. Run the web controller:
```bash
python clients/web/server.py
```
4. Visit `http://localhost:5000` in your browser
5. Select a serial port, click connect, and send effects!
### Option 2: Install as System Service (Arch Linux)
For a production setup that starts automatically on boot:
1. Clone this repo and navigate to the project directory
2. Run the installation script as root:
```bash
sudo ./install.sh
```
3. The service will be installed and started automatically
4. Visit `http://localhost:5123` or `http://YOUR_IP:5123` in your browser
**Service Management:**
```bash
# Check service status
sudo systemctl status picopixels-server
# Start/stop/restart service
sudo systemctl start picopixels-server
sudo systemctl stop picopixels-server
sudo systemctl restart picopixels-server
# View live logs
sudo journalctl -u picopixels-server -f
# Update the service (run from project directory)
sudo picopixels-update
```
**Features of the service installation:**
- Runs as dedicated `picopixels` user with minimal privileges
- Automatically starts on system boot
- Includes security hardening
- Easy update mechanism
- Proper logging via systemd journal
---
## ๐ ๏ธ Commands (via Web UI or Serial)
- `start ` โ Start looping animation
- `stop` โ Stop current animation
- `` โ Run effect once (e.g. `test`, `border`, `on`, `off`)
- `brightness <0-15>` โ Set brightness
- `speed ` โ Set speed of animation
- `text ` โ Set scrolling text
- `clock [12/24] [seconds/noseconds] [blink/noblink]`
- `help` โ Show command list
-
---
## ๐ธ Screenshots


---
## 3D Printed Enclosure
The enclosure was designed using [FreeCAD](https://www.freecad.org/)
The Pi Pico holder was downloaded from [Raspberry Pi Pico Case](https://www.printables.com/model/143745-raspberry-pi-pico-case)