This project allows you to control a 16x16 LED NeoPixel matrix using a Raspberry Pi Pico W2.
- Control LED matrix displays through a web interface
- Pixel art editor to create static and animated images
- Interact with GPIO buttons on the Raspberry Pi to control the matrix
- Backend API to communicate with the NeoPixel matrix
- Fully containerized using Docker for seamless deployment
- Raspberry Pi Pico W2
- Micro SD Card
- 16x16 LED Matrix ( build with BTF-LIGHTING WS2812BECO )
- I2C Logic Level Converter 3.3V to 5V
- 2 Push Buttons
- DC Power Jack 5,5mm x 2,1mm ( build with )
- Power Supply 5V 15A ( build with ALITOVE Netzteil 5V 15A Universal Adapter 5 Volt Netzteil 75W )
The STEP files for the case are provided here
Wire up all the components according to the following diagram:
Some LED matrices have a dedicated power input — if available, use it.
Make sure the wires are routed through the case before connecting the DC power jack.
Tape the matrix to the case with double-sided tape and secure the buttons in place
The LED matrix used in this example functions like a light strip, so the LEDs need to be addressed as an array according to the following scheme:
2 1 0
3 4 5
8 7 6
If you want to use a different matrix, you might need to adapt the get_index
function in LEDMatrix
Download and install the official Raspberry Pi Imager from (https://www.raspberrypi.com/software). Choose the following parameters:
- Operating System:
Other general-purpose OS/Ubuntu/Ubuntu Server 22.04.3 LTS (32-bit)
.
in the Advanced Options Menu
- Set hostname: LED_Matrix
- Enable SSH with pasword authentication
- Username: led
- Password:
- Configure a wireles LAN
In your command line, type:
ssh led@<your-ip-adress>
Then enter your password.
Install dependencies:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add Docker repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update:
sudo apt update
Install Docker:
sudo apt install docker-ce
sudo apt install docker-compose-plugin
Varify instalation:
docker --version
docker-compose --version
Enable Docker to start on boot:
sudo systemctl enable docker
Add the User to the Docker Group
sudo usermod -aG docker led
logout
groups
sudo apt install ufw
sudo ufw enable
sudo ufw allow 80/tcp
sudo ufw allow 8000/tcp
sudo ufw status
First, configure the .env
file:
cd ~/LED_Matrix_/src/Docker/
nano .env
Add the following lines:
# .env file
LATITUDE=
LONGITUDE=
TZ=Europe/Berlin # Optional timezone setting
MATRIX_ROTATION=90 # set rotation to 0, 90, 180, 270
SWAP_BUTTONS="true" # Swaps buttons "true" or "false"
Start the container:
cd ~/LED_Matrix_/src/Docker/
docker compose up -d
Now you can access the application at:
http://LED_Matrix.local
Stop the container:
cd ~/LED_Matrix_/src/Docker/
docker compose down
Rebuild the container:
cd ~/LED_Matrix_/src/Docker/
docker compose build
docker compose up -d