[Feasibility] Live control of WS2812b LEDs w/ Android Bluetooth

Hi everyone,

I'm looking to start a new project and was wondering if anyone can comment on the feasibility of the following:

  • I will be making a custom control board based off of the ATMega 328 and a slave bluetooth chip; will also be making a custom LED strip based off of the WS2812b LEDs (same ones used in Adafruit's NeoPixel line).

  • I'm mainly looking to use the finished product to do light painting with; what I'd like to do is to be able to pair the control board over bluetooth with my android phone. The android app will do the following:

  1. load desired images from the web/computer, etc.
  2. slice said images into 1 pixel wide slices
  3. send each slice over to the ATMega, one slice at a time.
  • The ATMega will then:
  1. take each of these slices (w/ color and position information)
  2. push it to the LED Strip, such that each slice from the original image corresponds to what is lit up on the LED strip on a time scale.

Was wondering:

  • What is the most efficient way to go about coding the microcontroller? (I'm likely going to be using the arduino environment)
  • Will I have to upload a new sketch each time I change an image, or is it possible to create a general code that listens for data from the android, stores any incoming in a buffer, and send it out to the LEDs?

Thank you for your time! :slight_smile:

How many LEDs are we talking about?

If you dealing with a lot of LEDs, one library you might want to look at is the OctoWS2811 LED Library written by Paul Stoffregen for his Teensy 3.0 microprocessor (OctoWS2811 LED Library, Driving Hundreds to Thousands of WS2811 LEDs with Teensy 3.0). It processes data in 8 parallel strips. IIRC, the OctoWS2811 is fast enough for light painting, but it may not be fast enough for POV (persistance of vision) type of things. I think the problem there is the speed of the WS2811/WS2812 lights is fixed and ultimately can't be changed fast enough.

The Teensy 3.0 processor is available from Paul at his store: Teensy USB Development Board. You can also buy them at adafruit.com and tindie.com. It is an ARM processor (instead of an ATmega2560) that comes in a DIP-28 style package (2 rows of 14 pins) with extra pins available underneath, and in the last row of the Teensy 3.0. It uses the Arduino 1.0.x environment for programming. You run an installer afterwards to add the Teensy 3.0 support. Obviously there are some differences due to hardware (ARM vs. ATmega, 3.3v vs. 5v), but at the digitalWrite, etc. layer it is fairly compatible.

There are various discussions of led strips over at the Teensy forum that discusses the tradeoffs of OctoWS2811 versus other approaches that you might want to check out: PJRC (Teensy) Forum

In terms of bluetooth, it is a fairly slow protocol, so you would not able to load the lights in real-time. I could imagine hooking up a SD card to the Teensy 3.0 to hold the patterns, and using bluetooth to download the new patterns from your phone when the lights are off, saving it to the SD card, and then during the performance, you could use bluetooth to select different patterns.

Thanks Michael for your help across various forums, haha. I'll be making the jump to the Teensy forum now: seems like a fantastic product!