Thursday, November 4, 2021

RGB LED Matrix Panel

A while ago I had purchased a cheap LED matrix panel from Adafruit. I had intentions of using it as a scrolling menuboard for our Makerspace vending machine project. I re-discovered it and finally spent some time figuring it out.


The panels are relatively simplistic. Mine had 32 LEDs across and 16 down, totalling 512. They run off 5 volts with a maximum draw of 2.5 amps if all LEDs are on. The data interface is HUB75 with 12 total pinouts: 6 data and 6 control.

My first mistake was using the "official" tutorial Adafruit supplied. I spent some time wiring it with jumper wires to a Raspberry Pi, but of course just like Hal with his light bulb I ended up in a spiralling chicken-and-egg situation of missing power supplies, Linux distros, and diagnosing SSH connections when I forgot to enable it in the first place. I even had to build a HDMI monitor because I forgot how to run headless Pis. Ugh.
All I wanted to do was make a colourful sign...

Once I sorted everything it still didn't work! Unknown to me at the time, the Adafruit wiring diagram was outdated because the RGB libraries had been updated which switched around the wiring!

Long story short, I switched to an Arduino Uno. If you're looking to do a similar project here's what I noticed:
  • Adafruit's RGB Matrix library works well. Make sure you install it in your Arduino library.
  • Arduino Unos work but their limited memory makes flicker-free scrolling text a bit trickier. Either use a Mega or strip down the code to make it fit.
  • Maximum current is 2.5amps but for our static "Makerspace" message the draw was a constant 400mA so I powered the matrix off the Arduino 5V pin. I wouldn't recommend this if you have more LEDs lighting up since the maximum draw off the 5V pin is between 400mA-900mA.
  • The code uses the function matrix.Color333(r, g, b) to specify a colour of the LED. The range is from 0-7, so red is 7,0,0 and white is 7,7,7.
  • Ardunio Cloud's limit of 200 seconds/day in compile time is not nearly enough. Stick with the physical editor.