This guide will show you how to add a microSD card to a Teensy 3 to play back animated GIFs on a RGB LED Matrix Panel.  The Teensy 3 runs an Arduino sketch that decodes the animated GIF and refreshes the display at a high frame rate with good color depth.  The SmartMatrix Shield makes it easy to connect everything together, with only minimal soldering required if you use a Teensy 3.5 or 3.6.

We will explain how to connect the parts together, how to compile the Arduino sketch that decodes the GIF animations, and go over options for creating your own GIFs.

Bare 32x32 6mm panel on the left, mounted in an 8"x8" shadow box frame with frosted acrylic diffuser on the right.

Major Components

RGB LED Matrix Panel

A multiplexed RGB LED Matrix Panel is an affordable way to add over a thousand bright pixels to your project. Compared to a Neopixel/DotStar matrix, these panels use smaller LEDs which are bright, but not blinding, and have a higher pixel density. Unlike a Neopixel/DotStar 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.

Teensy 3

Despite their small size, the Teensy 3 series dev boards pack a lot of horsepower as they use ARM Cortex M4 CPUs with plenty of RAM. The Teensy 3.2 runs at 72MHz and has 64kB RAM, while the Teensy 3.6 runs at 180 MHz, and has 256kB RAM. Even better, the processors in the Teensy 3 boards come 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.2 has more than enough power and memory to drive a 32x32 display with a high refresh rate and full color palette while decoding GIFs, and the Teensy 3.6 can handle up to a 64x64 display. The Teensy 3 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.

Note that the Teensy 3.2 doesn't have an SD card reader built in. You can add one external to the SmartMatrix Shield, following the pinout listed here, but using a Teensy 3.5/3.6 is the recommended route, and what this guide will cover.

SmartMatrix Shield and Library

The SmartMatrix Shield is the best way to connect the Teensy 3 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.

Parts List for Guide

  • RGB LED Matrix Panel
    • Photos and video in this tutorial use Adafruit's 32x32 6mm pitch panel
    • Also supported are 16x32, 32x32, 64x32, and 64x64 panels in various pixel pitches available from Adafruit
    • You can chain several panels together to create a larger display, but that is out of the scope of this guide. Check out the SmartMatrix Library README file for more details. Keep the number of pixels for a Teensy 3.2 to 1024 or less, and Teensy 3.6 to 4096 or less
  • Teensy 3.2, Teensy 3.5, or Teensy 3.6 with headers soldered
  • SmartLED Shield V4
  • 5V 4A Switching Power Supply
  • MicroSD Reader to load files onto card

Assembling Teensy 3.2

If you're using the Teensy 3.5 or 3.6, you can skip this section

Parts and tools needed for assembling SD adapter for Teensy 3.2:

  • MicroSD Memory Card and SD to MicroSD Adapter
  • 6-conductor 3" Female/Female Jumper Wires
  • 15-pin right-angle male header
  • For assembly
  • Soldering Iron
  • Solder
  • Diagonal Cutters
  • Wire Strippers
  • Small Flathead Screwdriver
  • X-Acto or similar Knife
  • Recommended: Multimeter

This guide was first published on Oct 16, 2014. It was last updated on Mar 08, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.