This guide will show you how to add an IR receiver to a Teensy 3.1 to play patterns on a 32x32 Pixel RGB LED Matrix Panel. The Teensy 3.1 runs an Arduino sketch that draws to the display, listens for IR remote commands, and refreshes the display at a high frame rate with good color depth. The SmartMatrix Shield makes it easy to connect everything together.
* This guide can be used in combination with the SmartMatrix Animated GIF Player guide. Adding a microSD card adds support for playing animated GIF files in addition to patterns in the Arduino Sketch.
We will explain the basic soldering and wiring to connect the IR receiver to the SmartMatrix Shield, and how to load the Arduino sketch that controls everything onto the Teensy 3.1.
The demo video shows the display mounted in a shadow box display with frosted acrylic diffuser (1/4" gap between LEDs and diffuser on the right, 1/2" gap on the left). The LEDs look better when diffused, whether its through a piece of copy paper or through specialty lighting acrylic. The frame is a subject for a future tutorial.
32x32 RGB LED Matrix Panel
A 32x32 RGB LED Matrix Panel is an affordable way to add over a thousand bright pixels to your project. Compared to a Neopixel matrix, these panels use smaller LEDs which are bright but not as blinding, and have a higher pixel density. Unlike a Neopixel matrix, the panel requires a microcontroller to refresh the LEDs continuously to display an image. It takes about 40% of the CPU time and most of the memory of an Arduino Uno just to refresh a panel, and that's with a low refresh rate and a limited 12-bit color palette. To get a better image quality, we will use a more powerful microcontroller.
Despite its small size, the Teensy 3.1 packs a lot of horsepower as it uses an ARM Cortex M4 CPU that runs at 72MHz and has 64kB of RAM. This is more than enough power and memory to refresh the display with a high refresh rate and full color palette. Even better, the processor in the Teensy 3.1 comes with a DMA engine that can move data from memory to pins to allow refreshing the display in the background, so the main program can run without as many interruptions. The Teensy 3.1 is programmable using a modified Arduino IDE, and uses many of the same libraries as normal Arduino boards, so it should be familiar to program for anyone that has written an Arduino sketch before.
SmartMatrix Shield and Library
The SmartMatrix Shield is the best way to connect the Teensy 3.1 to the RGB LED Matrix Panel. The shield takes care of routing the 13 signals needed to refresh the display, adds convenient connectors for power, and brings the unused signals out to a convenient expansion header. The SmartMatrix Library includes code that refreshes the display in the background, and provides functions that make it easy to draw to the display and scroll text on top of the drawing.
Aurora Arduino Sketch
Aurora is an Arduino Sketch designed to give a lot of options for displaying customizable content on a 32x32 RGB Matrix Panel, with an easy to use interface controllable through an IR remote control. Using the remote you can choose a pattern or animation to display, change the brightness to match ambient light, sleep the display when you are not using it, and enable autoplay to rotate through content automatically.
IR Sensor, Remote, Arduino Library
To remotely control the Arduino sketch we will add an IR Sensor to the SmartMatrix Shield, and use a compatible remote control. The Arduino-IRremote library decodes the signal coming from the IR sensor.
From the project's homepage: "FastLED is a fast, efficient, easy-to-use Arduino library for programming addressable LED strips and pixels such as WS2810, WS2811, LPD8806, Neopixel and more. FastLED is used by thousands of developers, in countless art and hobby projects, and in numerous commercial products."
We use FastLED's helper functions to efficiently generate patterns and work with color palettes. FastLED has a great community, and many of the patterns in our Arduino sketch have been contributed by the FastLED community.
- 32x32 RGB LED Matrix Panel - 6mm pitch
- Teensy 3.1
- SmartMatrix Shield for Teensy 3.1
- 5V 4A Switching Power Supply
- 15-pin right-angle male header
- IR Remote (battery included)
- IR Sensor
- 3-conductor Female/Female Jumper Wires: 3" / 6" / 12"
- Select long enough wires to mount the IR Receiver where you want it. 3" is just long enough to reach the closest edge of the panel.
- Needle Nose Pliers
- Optional for Animated GIFs
- MicroSD Memory Card and SD to MicroSD Adapter
- 6-conductor 3" Female/Female Jumper Wires
- MicroSD Reader to load files onto card
- For SmartMatrix Shield Assembly:
- Soldering Iron
- Diagonal Cutters
- Wire Strippers
- Small Flathead Screwdriver
- X-Acto or similar Knife
- Recommended: Multimeter