Introduction: WiFi Programmable RGB LED Matrix Display in Lego Case

About: I'm a hobbyist of many things

This is a WiFi Raspberry Pi powered 64x32 RGB LED Matrix securely enclosed and framed completely in a plastic brick (Lego) case. Total cost is around $150.

The case does not require any special hardware, nuts, screws bolts, risers or anything else, it is completely assembled out of plastic bricks. The display fits the plastic brick case so well that it secures itself and is even a little difficult to remove once assembled. You need to remove side bricks in order to lift it out.

Once it is built, it is programmable to display anything you like over WiFi and simply plugs into the wall.


  1. Raspberry Pi
  2. RGB Matrix
  3. Power Supply
  4. Adafruit RGB Matrix Hat
  5. Legos
  6. Lego Base Plates

Step 1: Purchase the Parts

Total cost is around $150.

I have provided below the parts that I used.

Raspberry Pi

Can be purchased many place for $45

RGB Matrix

Purchased off eBay for $24

I've attached the eBay listing for the Matrix panel that I purchased.

Power Supply

Purchased off Amazon for $14

"5V Power Supply,PHEVOS AC110V to DC 5v 8A Universal Switching Power Supply for Raspberry PI Models,CCTV, Radio, Computer Project,WS2812B WS2811 WS2801"

Adafruit RGB Matrix Hat

Purchased from the Adafruit website for $25

"Adafruit RGB Matrix HAT + RTC for Raspberry Pi - Mini Kit"

Legos (Generic)

Purchased off Amazon for $34

"GARUNK 1500 Pieces Building Bricks for Kids, 1500 Pcs Classice Building Blocks"

Lego Base Plates

Purchased off Amazon for $10

"EKIND 4 PCS Classic Building Base Block Plates 5" x 10" - Compatible with Building Brickyard Blocks All Major Brands (Green)"

Step 2: Assemble


  • Make sure to use the Lego windows to allow the power supply to dissipate heat to the outside. The power supply does not have a fan, so it is silent. Note: without the windows it will certainly get too hot in there!!
  • Use the 2x2 and 2x4 legos in the case wall to create the "ledge" that the RGB matrix panel sits on, as well as bricks that secure the power supply and raspberry pi in-place.
  • You can power both the Raspberry Pi as well as the panel all through the power connector on the Adafruit RGB Matrix hat
  • To cut the lego base plate to size, I used a fine-toothed saw from a miter box to score and cut the base plate while it was laying flat on a wooden board
  • You can loop through images that display using the led-image-viewer command and update those images via crontab
  • Creating a run script and adding it to the Linux startup script makes it so that your display will just start up when you plug it in
  • For some reason Adafruit makes you solder the GPIO header and power connector onto the hat, so you will need a soldering iron

Driving the Matrix:

Here are the command line options to get the matrix to work correctly, you must include the adafruit-hat-pwm and FM6126A argument, otherwise the panel will not work.

rpi-rgb-led-matrix/utils/led-image-viewer --led-gpio-mapping=adafruit-hat-pwm --led-rows=32 --led-cols=64 --led-panel-type=FM6126A image.png

You can create images using the ImageMagick convert utility that perfectly fit the screen and it may be easier than writing code to draw on the screen. You probably want to download a bitmap font, I used Minecraftia 2.0

/usr/bin/convert -size 64x32 xc:black -font Minecraftia-2.0 -pointsize 20 +antialias -fill white -draw \"text 0,37 ' 123F'\" output.png