Software apps and online services
Hand tools and fabrication machines
I’ve always wanted to play with a big LED matrix, and now I have! 🙂 In this post, I’m making a Pixel Art frame, capable of displaying images, scrolling text, etc. Useful to show the weather, social media notifications, and whatever else you can think of!
The following electronic components were used in this project:
- Raspberry Pi Zero
- 5V/4A Power Supply
- USB OTG Cable
- USB Wifi Dongle
Note: The Pi Zero + OTG cable + WiFi dongle can be replaced by a Pi Zero W.
The Adafruit RGB Matrix HAT makes it easy to connect the matrix using a ribbon cable, but its power input also powers the Pi Zero. This makes wiring a lot simpler and cleaner. If you prefer though, the matrix could be wired directly to the Pi’s GPIO instead, not requiring the HAT anymore!
Detailed instructions on how to connect and wire the HAT can be found on the Adafruit website. To wire the matrix to the Pi directly, check the link to Henner’s GitHub page in the next paragraph.
The Pi Zero runs the latest Raspbian Jessie, but because timing is critical and could affect the matrix, it is recommended to use the “lite” version of the image.
I originally started off with Adafruit’s RGB LED Matrix library to drive the matrix, but that resulted in glitches and flickering when displaying images on the matrix. I then found out that Adafruit’s library is a branch of Henner Zeller’s rpi-rgb-led-matrix library. Henner’s library continued to evolve and introduced various improvements, resulting in a glitch-free display. It is also very well documented and provides different options such as C++ and Python, depending on your coding preferences.
Installing the library and the examples is a piece of cake:
pi@raspberrypi:~ $ git clone https://github.com/hzeller/rpi-rgb-led-matrix pi@raspberrypi:~ $ cd rpi-rgb-led-matrix pi@raspberrypi:~/rpi-rgb-led-matrix $ make -C examples-api-use
One of the demo application takes *.ppm images. If the width is larger than 32 pixels, it is possible to let the image scroll while displaying.
To have something to demonstrate, I downloaded some images and used GIMP to convert them to the ppm format. I’ve then written a small script that iterates through the images in a folder and displays them for five seconds each.
View the code on Gist.
From there, it’s a matter of deciding what you want to display, based on which triggers. You could easily display the weather forecast for the day, or display the social media symbol for which you’ve just received a notification, etc … It’s all up to you!
To hold the electronics together and give the project a proper finish, I created a custom frame consists of wood, acrylic and window tint foil. Using the miter saw, four pieces of “meranti” were cut in order to create a basic frame, with the inner space large enough to fit the LED matrix. Grooves were made using the table saw to hold the acrylic in place.
Window tinting foil purchased on eBay was used to give the acrylic a slight mirror look while allowing the light of the LEDs to shine through from behind. The acrylic with foil was then inserted in the grooves, and the four pieces of wood glued together. Using some saw dust mixed with glue, any gaps were filled. To allow the frame to stand up, a small rod was inserted in the back, giving the frame an additional point of support.
Finally, a bit of beeswax was applied to the wooden frame.
Like it? What would you display? Let me know in the comments! 🙂