-
Lance Gilbert authoredLance Gilbert authored
Fadecandy is a project that makes LED art easier, tastier, and more creative. We're all about creating tools that remove the technical drudgery from making LED art, freeing you to do more interesting, nuanced, and creative things. We think LEDs are more than just trendy display devices, we think of them as programmable light for interactive art.
- Video Introduction to Fadecandy
- Introduction by Nick Poole from Spark Fun Electronics
- Tutorial: LED Art with Fadecandy
- Tutorial: 1,500 NeoPixel LED Curtain with Raspberry Pi and Fadecandy
- Presentation slides: Easier and Tastier LED Art with Fadecandy
- LED Interaction Research with Fadecandy at Stimulant labs
Buy a Fadecandy Controller board:
Simple Example
Here's a simple project, a single LED strip controlled by a Processing sketch running on your laptop:
// Simple Processing sketch for controlling a 64-LED strip.
// A glowing color-blob appears on the strip under mouse control.
OPC opc;
PImage dot;
void setup()
{
size(800, 200);
// Load a sample image
dot = loadImage("color-dot.png");
// Connect to the local instance of fcserver
opc = new OPC(this, "127.0.0.1", 7890);
// Map one 64-LED strip to the center of the window
opc.ledStrip(0, 64, width/2, height/2, width / 70.0, 0, false);
}
void draw()
{
background(0);
// Draw the image, centered at the mouse location
float dotSize = width * 0.2;
image(dot, mouseX - dotSize/2, mouseY - dotSize/2, dotSize, dotSize);
}
A More Complex Example
Fadecandy is also useful for larger projects with many thousands of LEDs, and it's useful for art that runs on embedded computers like the Raspberry Pi:
Project Scope
This project is a collection of reusable pieces you can take or leave. The overall goal of making LED art easier, tastier, and more creative is a broad one. To keep this project manageable to start with, there are some rough limitations on what's supported:
- LED strips, grids, and other modules based on the WS2811 or WS2812 chip.
- Common and inexpensive, available from many suppliers for around $0.25 per pixel.
- Something with a USB host port that can run your art.
- Laptops and Mac Minis work great
- The Raspberry Pi is also a great platform for this, but it requires more technical skill
- Distances of no more than 60ft or so between your computer and your farthest LEDs
- USB cables < 50ft
- WS2811 data cables < 10ft
- No more than about 10000 LED pixels total
- There's no hard limit, but it gets more difficult after this point.
- Experimental support for APA102/APA102C/SK9822 via SPI
- Currently only works on Raspberry Pi and requires the WiringPi library. Compile with FCSERVER_HAS_WIRINGPI defined to enable support.
These are fuzzy limitations based on current software capabilities and rough electrical limits, so you may be able to stretch them. But this gives you an idea about the kind of art we try to support. Projects are generally larger than wearables, but smaller than entire buildings.
For example, the first project to use Fadecandy was the Ardent Mobile Cloud Platform at Burning Man 2013. This project used one Raspberry Pi, five Fadecandy controller boards, and 2500 LEDs.
Fadecandy makes no assumptions about how you generate control patterns for the LEDs. You can generate a 2D video and sample pixels from the video, you can make a 3D model of your sculpture and sample a 3D shader for your pixel values, or you can create a unique system specifically for your art.
Fadecandy Controller
The centerpiece of the Fadecandy project is a controller board which can drive up to 512 LEDs (as 8 strings of 64) over USB. Many Fadecandy boards can be attached to the same computer using a USB hub or a chain of hubs.
Fadecandy makes it easy to drive these LEDs from anything with USB, and it includes unique algorithms which eliminate many of the common visual glitches you see when using these LEDs.
The LED drive engine is based on Stoffregen's excellent OctoWS2811 library, which pumps out serial data for these LED strips entirely using DMA. This firmware builds on Paul's work by adding:
- A high performance USB protocol
- Zero copy architecture with triple-buffering
- Interpolation between keyframes
- Gamma and color correction with per-channel lookup tables
- Temporal dithering
- A custom PCB with line drivers and a 5V boost converter
- A fully open source bootloader
These features add up to give very smooth fades and high dynamic range. Ever notice that annoying stair-stepping effect when fading LEDs from off to dim? Fadecandy avoids that using a form of delta-sigma modulation. It rapidly wiggles each pixel's value up or down by one 8-bit step, in order to achieve 16-bit resolution for fades.
Vitals
- 512 pixels supported per Teensy board (8 strings, 64 pixels per string)
- Very high hardware frame rate (~400 FPS) to support temporal dithering
- Full-speed (12 Mbps) USB
- 257x3-entry 16-bit color lookup table, for gamma correction and color balance
Platform
Fadecandy uses the Freescale MK20DX128 microcontroller, the same one used by the Teensy 3.0 board. Fadecandy includes its own PCB design featuring a robust power supply and level shifters. It also includes an open source bootloader compatible with the USB Device Firmware Update spec.
You can use Fadecandy either as a full hardware platform or as firmware for the Teensy 3.0 board.