Design & Testing

There are three major parts to this guide:

  1. Setting up the software
  2. Building the electronics
  3. Building the gauntlets

All three parts are interrelated…so take some time, do some sketches, read all the way through and do some planning before you start…

  • How many LEDs do you want to use? More LEDs likely means a shorter battery life, but a bigger matrix will show image detail better
  • Where will the battery fit most comfortably along your arm?
  • Will the Feather board work better if it's placed horizontally or vertically?
  • Do you plan to regularly add and update your SD card files?  If so, can you reach your SD card easily?
  • Do you want to be able to swap out batteries, or is stopping to charge your gauntlet with the battery in-place good enough?
  • What super power(s) will these gauntlets give you? Will humanity as a whole benefit from your actions?

Software Setup

The technical parts of this guide build upon our Lightship LED Animation guide…but rather than WiFi, these gauntlets play back animation from a micro SD card*. Skim through that guide to familiarize yourself with all the pieces and terminology. Though this project is built a little differently, many of the same concepts apply, and this saves us a lot of explanation here.

* Though if you’d like WiFi gauntlets instead, that’s entirely 100% possible…substitute a Feather M0 WiFi rather than an Adalogger…same concepts apply, just use the original Lightship code instead.

Steps you'll need to follow:

  1. Install Feather board support in your Arduino IDE and get the "blink" sketch working.
  2. Download and install the necessary libraries: you'll need the Adafruit Dotstar library, the ASF Core library and the Adafruit_ZeroDMA library.
  3. Install Processing vesrion 2.2.1 
  4. Download and extract the ZIP file containing the code for this project.
Do not continue with the build until you have the “blink” sketch working on the Feather M0 board.

Set Up a Test Strip

Testing your LED strip first can save heartbreak later…this lets you know whether the whole strip is in good working order and that you’re making the right connections.

Dotstar strips come with a connector pre-soldered onto the ends.  For testing purposes I like to just cut the connector head off and use the wires to connect directly to my project…or you can trim the plug with wires off the tail end and use that as a connector for the head end.

When connecting to a microcontroller, make certain you’re working from the INPUT end of the LED strip! If you look closely at the face of the strip, you’ll see a series of small arrows pointing from IN toward OUT. Connect to the “in” end…the arrows should be pointing away from the microcontroller.

Tiny solder pads on the strip should be marked + or 5V, D or DI (data in), C or CI (clock in) and or G (ground) or similar. The wires on the end of the strip will be in the same order as the labels; typically a red wire for +5V, black for ground.

led_matrix_cut_connetor.jpg
Cutting off the input plug and soldering to these wires is one option.

Temporarily solder your strand of Dotstars to the Feather M0 board:

Feather M0 Pin

DotStar

11

D or DI (data in)

13

C or CI (clock in)

USB

+ or 5V

GND

– or G

There are spare power wires at the ends of the strip. Make sure the ends of these are covered (or just clip off) so they don’t accidentally contact anything and cause a short.

led_matrix_proto-wiring.jpg
In this case, the output plug and wires were cut off and used as an adapter to the input end.

Later we’ll power the LEDs off a battery, but for testing, use the USB and GND pins.

Use the Arduino Library Manager to install the Adafruit_DotStar library (Sketch→Include Library→Manage Libraries…), or if you’re using an older version of the Arduino IDE, it can be downloaded and installed manually:

Library installation is a frequent stumbling block…if you need assistance, our All About Arduino Libraries guide spells it out in detail.

Once the Adafruit_DotStar library is installed, you can use the “strandtest” sketch to confirm that everything works.

File→Examples→Adafruit_DotStar→strandtest

You’ll need to make a few small changes in the code before uploading to the board. First, edit the number “30” on this line to reflect the actual number of LEDs in your DotStar strip (e.g. 60, 144, etc.):

Download: file
#define NUMPIXELS 30 // Number of LEDs in strip

Then a couple lines down, look for these:

Download: file
#define DATAPIN    4
#define CLOCKPIN   5

Change these values to:

Download: file
#define DATAPIN    11
#define CLOCKPIN   13

Make sure the right board type and serial port are selected, then upload this sketch to the Feather board. After a moment, you should see a set of red pixels chase along the strip, then green, then blue.

The code uploads OK, but no LEDs light!

  • Double-check all the connections between board and strip: Feather pin 11 to strip DI, 13 to CI, USB to + and GND to –.
  • Make sure you’re connected to the input end of the strip (arrows should point away from the microcontroller board).
  • Check that the spare power wires at each end of the LED strip aren’t touching each other or anything conductive around your desk.

LEDs are lit, but the order is not red-green-blue.

Occasionally from batch to batch the manufacturer changes the order in which the LEDs receive color data. You can reorder this data using the last argument to the Adafruit_DotStar() constructor, e.g. try:

Download: file
Adafruit_DotStar strip = Adafruit_DotStar(
  NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR);
Do not continue with the build until you have the “strandtest” sketch working and LEDs animating.
This guide was first published on Jun 05, 2016. It was last updated on Jun 05, 2016. This page (Design & Testing) was last updated on Aug 16, 2019.