64x32 Matrix Panel Setup with PICO 2
Greetings everyone and welcome back.
So here's something fun and useful: a Raspberry Pi Pico 2-powered 64x32 RGB matrix panel setup.
Here, we have made a simple setup where the Pico 2 is linked to the display's input I/O port. We have also included a power module that utilizes a 12V adapter to power the display and the Pico.
The goal was to create a PICO 2-driven matrix setup that would make working with the matrix panel simpler because all we would need to do is plug in a USB cable to PICO and input our code; there would be no need to rewire anything or swap out any connections.
We included a DC-DC Buck converter board that we had previously designed to address the issue of the Matrix panels' high power consumption and the PICO's inability to power the entire panel via its USB Out pin.
The 12V from the adaptor is stepped down into a steady 5V/3A using the Buck converter board, which is sufficient to power the PICO and drive the matrix panel.
We created a frame-like part that is fastened to the rear of the matrix panel to keep everything orderly. It secures the PICO 2 circuit, the Buck controller board, and the DC Barrel jack.
This article covers the entire Matrix Setup build guide, including the test code and other details.
64x32 RGB Matrix
In this project, we are utilizing the 64x32 RGB matrix panel, which consists of 2048 RGB LEDs arranged in a 64 by 32 grid, which produces vibrant text, images, and animations.
This panel is controlled using a HUB75 interface, which relies on multiple control pins, including RGB pins, address pins, a clock pin, a data latch, and output enable pin.
The HUB75 connection enables the row-column scanning method by shifting a row of pixel data into a shift register, then using a demultiplexer to select which rows to display. The HUB75 connector includes RGB channels, addressing pins (A, B, C, D), a clock signal (CLK), a latch signal (LAT), and an output enable (OE) pin.
This interface allows precise control over the LED matrix, enabling smooth and bright displays ideal for text, images, and animations.
While it might appear complex to set up, this method ensures high-intensity displays and smooth, seamless graphics transitions.
Using a 5V power source, we can drive this display, but there's a catch. The current draw can vary significantly depending on the number of LEDs lit and their brightness levels. A fully lit panel can draw substantial current, so a power supply capable of providing at least 4-5 Amps is recommended.
Additionally, by utilizing the included IN and OUT connectors, we can connect multiple panels in pairs and form a chain. One of the challenges of connecting numerous panels is ensuring that the control solution (PICO 2) we are employing can handle the extra data load or two or more displays.
With the PICO 2, we are currently using a single panel that can power two or more displays without causing any issues.
Waveshare made this matrix, and the wiki link below has more detailed information on the Matrix board:
https://www.waveshare.com/wiki/RGB-Matrix-P3-64x32
PCBWAY GIFTSHOP
As for sourcing this matrix panel, we got it from the PCBWAY GIFTSHOP.
PCBWAY gift shop is an online marketplace where you can get a variety of electronics modules and boards for their genuine price, or you could use the PCBWAY currency, which is called beans.
You get beans after ordering something from PCBWAY as reward points, or you can also get them by posting any project in the PCBWAY community.
You guys can check out PCBWAY if you want great PCB service at an affordable rate.
PICO BREAKOUT BOARD
We utilized one of our previously constructed PICO expansion boards, a straightforward circuit that resembles a prototype board with a PICO footprint in the middle, to set up the PICO 2. Each Pico pin is connected to a CON4 header pin footprint, which is laid out on the left and right sides of the board. Each pin is labeled, making it easier to work with PICO.
https://www.hackster.io/Arnov_Sharma_makes/raspberry-pi-pico-as-hid-mouse-370827
In order to connect electric components and pair them with the PICO pins, we also added a few unconnected pins to the left and right sides of the board. In order to connect display I/O pins with the PICO GPIO pins, we will be adding a CON16 pin to these unconnected pins.
PICO BREAKOUT BOARD ASSEMBLY
First, we attach the two 20-pin female header pin connectors to the Pico footprint's two pads. Next, we attach the two 8-pin male header pins to the board's left side. The purpose of these male header pins is to connect the PICO to the LED matrix IO connector.
We soldered all of the male and female connector leads that were added to the expansion board from the circuit's bottom side using a soldering iron.
WIRING
- Following the provided wiring diagram, we begin the wiring process by first using a jumper wire to connect the GND pin of the matrix I/O pins to the GND of the PICO.
- In the identical way, we connected the I/O pins of the matrix, which include R1 to GPIO2, G1 to GPIO3, B1 to GPIO4, R2 to GPIO5, G2 to GPIO8, B2 to GPIO9, A to GPIO19, B to GPIO16, C to GPIO18, D to GPIO20, E to GPIO22, CLK to GPIO11, LAT/STB to GPIO12, and OE to GPIO13.
BUCK Converter Circuit
We are using one of our earlier projects, the SUPER POWER BUCK CONVERTER BOARD, which was a power module that could provide voltages ranging from 3V to 12V depending on the source supplied, as the power source for the Matrix and PICO. The input voltage in this instance is 12V, and the supply voltage is 5V.
This module is based around the IP6505, a step-down converter with an inbuilt synchronous switch that can handle an output of up to 10A for fast charging protocols.
Check out this project article for more information.
https://www.hackster.io/Arnov_Sharma_makes/super-power-buck-converter-0f424c
We connected the output of the Buck converter with the PICO 2's VBUS and GND pins, which will be used to power the microcontroller.
Frame Design
We created a frame that is fastened to the rear of the Matrix Panel with M2.5 threaded inserts on the Matrix. This frame was designed with a DC barrel jack holding section on one side and the PICO 2 circuit and Buck converter module on the other.
This entire frame design was created in FUSION 360, and the mesh file was exported. It was then printed in ORANGE PLA using a 0.5mm nozzle, a 0.2mm layer height, and 25% Gyroid Infill.
After placing the frame on the back side of the matrix panel, we install six M2.5 bolts in the mounting holes to start the frame assembly process.
After that, we use a screwdriver to tighten every screw, securing the frame with the matrix.
Matrix Assembly Process
- Using a soldering iron, we join the Buck converter's output pins to the matrix board's VCC and GND to start the matrix assembly process.
- The Buck converter module's output side DC barrel jack is then disconnected, and it is then fastened to the mounting hole on the frame section.
- Next, we connect the VCC and GND of the DC barrel jack to the Buck converter board's Vin and GND.
- We attach the Buck converter board to the frame by positioning it there and then using hot glue to secure it in place.
- The CON16 Ribbon Cable connector, which was included with the matrix board, is then connected to the input connector of the matrix. The matrix and PICO are connected by this CON16 connector
- Two M2 screws are then used to secure the PICO breakout board in place after it has been positioned over its location on the frame.
- The assembly process is now complete.
Test 01: Matrix Hello World
After the matrix setup is complete, we connect the PICO to our computer to upload code and plug the matrix in with a 12V adapter via the barrel DC socket to begin the test procedure.
We made this simple Hello World Sketch, which initializes the RGB matrix to display a variety of colorful animations, including gradients, diagonal lines, moving shapes, expanding circles, and scrolling text, to demonstrate the matrix's graphical capabilities.
#include <Adafruit_Protomatter.h>
// Pin definitions
#define R1 2
#define G1 3
#define B1 4
#define R2 5
#define G2 8
#define B2 9
#define A 10
#define B 16
#define C 18
#define D 20
#define CLK 11
#define LAT 12
#define OE 13
#define WIDTH 64
#define HEIGHT 32
uint8_t rgbPins[] = { R1, G1, B1, R2, G2, B2 };
uint8_t addrPins[] = { A, B, C, D };
Adafruit_Protomatter matrix(WIDTH, HEIGHT, 1, rgbPins, 4, addrPins, CLK, LAT, OE, false);
bool grid[WIDTH][HEIGHT];
bool newGrid[WIDTH][HEIGHT];
void setup() {
matrix.begin();
randomSeed(analogRead(0));
// Initialize grid with random values
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
grid[x][y] = random(2);
}
}
}
void loop() {
matrix.fillScreen(0);
// Update grid based on Game of Life rules
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
int aliveNeighbors = countAliveNeighbors(x, y);
if(grid[x][y]) {
// Any live cell with two or three live neighbors survives.
if(aliveNeighbors < 2 || aliveNeighbors > 3) {
newGrid[x][y] = false;
} else {
newGrid[x][y] = true;
}
} else {
// Any dead cell with three live neighbors becomes a live cell.
if(aliveNeighbors == 3) {
newGrid[x][y] = true;
} else {
newGrid[x][y] = false;
}
}
if(newGrid[x][y]) {
matrix.drawPixel(x, y, matrix.color565(255, 255, 255)); // White color
}
}
}
// Copy newGrid to grid
memcpy(grid, newGrid, sizeof(grid));
matrix.show();
delay(100); // Adjust the delay for speed control
// Check if the grid is stable or empty
if(isGridStableOrEmpty()) {
resetGrid();
}
}
int countAliveNeighbors(int x, int y) {
int aliveNeighbors = 0;
for(int dx = -1; dx <= 1; dx++) {
for(int dy = -1; dy <= 1; dy++) {
if(dx == 0 && dy == 0) continue;
int nx = (x + dx + WIDTH) % WIDTH;
int ny = (y + dy + HEIGHT) % HEIGHT;
if(grid[nx][ny]) {
aliveNeighbors++;
}
}
}
return aliveNeighbors;
}
bool isGridStableOrEmpty() {
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
if(grid[x][y]) {
return false;
}
}
}
return true;
}
void resetGrid() {
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
grid[x][y] = random(2);
}
}
}
Make sure to first install the Adafruit_Protomatter Library before using the sketch.
https://github.com/adafruit/Adafruit_Protomatter
Test 02: Game of Life
Next, in order to take this matrix setup to the next level, we created our own code that would run on our matrix panel by porting the Game of Life code that was obtained from an example sketch of the FastLED library.
The British mathematician John Horton Conway created the amazing cellular automaton known as the "Game of Life" in 1970. It is a zero-player game, which means that no additional input is needed; instead, the game's evolution is dictated by its beginning condition.
Checkout more about game of life from here-
The game will start with a random configuration and restart with a new random configuration after it halts and yes this setup is Turing complete.
#include <Adafruit_Protomatter.h>
// Pin definitions
#define R1 2
#define G1 3
#define B1 4
#define R2 5
#define G2 8
#define B2 9
#define A 10
#define B 16
#define C 18
#define D 20
#define CLK 11
#define LAT 12
#define OE 13
#define WIDTH 64
#define HEIGHT 32
uint8_t rgbPins[] = { R1, G1, B1, R2, G2, B2 };
uint8_t addrPins[] = { A, B, C, D };
Adafruit_Protomatter matrix(WIDTH, HEIGHT, 1, rgbPins, 4, addrPins, CLK, LAT, OE, false);
bool grid[WIDTH][HEIGHT];
bool newGrid[WIDTH][HEIGHT];
void setup() {
matrix.begin();
randomSeed(analogRead(0));
// Initialize grid with random values
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
grid[x][y] = random(2);
}
}
}
void loop() {
matrix.fillScreen(0);
// Update grid based on Game of Life rules
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
int aliveNeighbors = countAliveNeighbors(x, y);
if(grid[x][y]) {
// Any live cell with two or three live neighbors survives.
if(aliveNeighbors < 2 || aliveNeighbors > 3) {
newGrid[x][y] = false;
} else {
newGrid[x][y] = true;
}
} else {
// Any dead cell with three live neighbors becomes a live cell.
if(aliveNeighbors == 3) {
newGrid[x][y] = true;
} else {
newGrid[x][y] = false;
}
}
if(newGrid[x][y]) {
matrix.drawPixel(x, y, matrix.color565(255, 255, 255)); // White color
}
}
}
// Copy newGrid to grid
memcpy(grid, newGrid, sizeof(grid));
matrix.show();
delay(100); // Adjust the delay for speed control
// Check if the grid is stable or empty
if(isGridStableOrEmpty()) {
resetGrid();
}
}
int countAliveNeighbors(int x, int y) {
int aliveNeighbors = 0;
for(int dx = -1; dx <= 1; dx++) {
for(int dy = -1; dy <= 1; dy++) {
if(dx == 0 && dy == 0) continue;
int nx = (x + dx + WIDTH) % WIDTH;
int ny = (y + dy + HEIGHT) % HEIGHT;
if(grid[nx][ny]) {
aliveNeighbors++;
}
}
}
return aliveNeighbors;
}
bool isGridStableOrEmpty() {
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
if(grid[x][y]) {
return false;
}
}
}
return true;
}
void resetGrid() {
for(int x = 0; x < WIDTH; x++) {
for(int y = 0; y < HEIGHT; y++) {
grid[x][y] = random(2);
}
}
}
Conclusion, and what's next?
This project ended with a functional matrix setup that is simple to work with due to the PICO 2 implementation and the addition of a DC buck converter circuit on the rear that enables the user to power it from a 12V source, so resolving the power source issue entirely.
We created this configuration in order to utilize the matrix in a future project that will be a portable gaming device that runs Snake Game.
We have currently prepared a demo sketch that initializes a snake in the center of the RGB matrix and causes it to travel. The snake's direction of movement changes randomly at different points in time, looping around the corners of the screen.
This project turned out well overall, and I'll be returning with the Snake gaming Console, which will dive deeply into the construction of the Snake gaming device.
In addition, we appreciate PCBWAY's support of this project. Visit them for a variety of PCB-related services, such as stencil and PCB assembly services, as well as 3D printing services.
Thanks for reaching this far, and I will be back with a new project pretty soon.
Peace.
64x32 Matrix Panel Setup with PICO 2
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Arnov Arnov sharma
- 64x32 Matrix Panel Setup with PICO 2 Greetings everyone and welcome back.So here's something fun and useful: a Raspberry Pi Pico 2-powere...
- Portable Air Quality Meter Hello everyone, and welcome back! Today, I have something incredibly useful for you—a Portable Air Q...
- WALKPi PCB Version Greetings everyone and welcome back, This is the WalkPi, a homebrew audio player that plays music fr...
- Delete Button XL Greetings everyone and welcome back, and here's something fun and useful.In essence, the Delete Butt...
- Arduino Retro Game Controller Greetings everyone and welcome back. Here's something fun.The Arduino Retro Game Controller was buil...
- Super Power Buck Converter Greetings everyone and welcome back!Here's something powerful, The SUPER POWER BUCK CONVERTER BOARD ...
- Pocket Temp Meter Greetings and welcome back.So here's something portable and useful: the Pocket TEMP Meter project.As...
- Pico Powered DC Fan Driver Hello everyone and welcome back.So here's something cool: a 5V to 12V DC motor driver based around a...
- Mini Solar Light Project with a Twist Greetings.This is the Cube Light, a Small and compact cube-shaped emergency solar light that boasts ...
- PALPi V5 Handheld Retro Game Console Hey, Guys what's up?So this is PALPi which is a Raspberry Pi Zero W Based Handheld Retro Game Consol...
- DIY Thermometer with TTGO T Display and DS18B20 Greetings.So this is the DIY Thermometer made entirely from scratch using a TTGO T display board and...
- Motion Trigger Circuit with and without Microcontroller GreetingsHere's a tutorial on how to use an HC-SR505 PIR Module with and without a microcontroller t...
- Motor Driver Board Atmega328PU and HC01 Hey, what's up folks here's something super cool and useful if you're making a basic Robot Setup, A ...
- Power Block Hey Everyone what's up!So this is Power block, a DIY UPS that can be used to power a bunch of 5V Ope...
- Goku PCB Badge V2 Hey everyone what's up!So here's something SUPER cool, A PCB Board themed after Goku from Dragon Bal...
- RGB Mixinator V2 Hey Everyone how you doin!So here's a fun little project that utilizes an Arduino Nano, THE MIXINATO...
- Gengar PCB Art Hey guys and how you doing!So this is the GENGAR PCB Badge or a Blinky Board which is based around 5...
- R2D2 Mini Edition So here's something special, A Mini R2D2 PCB that speaks ASTROMECH.Astromech is a fictional language...
-
Atomic Force Microscope - electronic part
46 0 0 -
-
-
DIY Fiber Laser Tube Cutting Machine
118 0 1 -
-
-
DIY Transistor Tester | Build Your Own LCR Meter at Home with Arduino Nano
278 0 3 -