LPD8806 LED SUIT

Thought I would start a new clean thread on this topic. There's been some comments here and there on different threads, but I thought I'd start one for those interested to collaborate, share specific code and ideas for the LED Suit topic.

This article peaked my interest as I attend a few festivals a year and it seemed like a great project.

However, his methods were using hard to find (odd) LED strips.

I ended up sourcing LPD8806 because they addressable and would be easy to work with (which they have been!)

I'm using a Teensy 2.0++ for my controller.

My first project is to make shorts for a football game next weekend (and since I only have 1 5m strip at the moment). Once the next strip arrives, I'll make pants.. and 2 more enroute to make a full suit in time for halloween.

Here's the completed portable package:

Top of unit almost done (forgot pull resistor for the button! :frowning: )

Side view: (power, on/off switch, push button, wires for strip at the top)

Bottom:

I used a basic proto type board. In the bottom picture, the entire bottom row is now ground, and the entire top row is 5V power. I added headers to all of the teensy inputs. I used a box cutter to cut the copper in some sections to separate the power/ground and also make a section for the 5V regulator.

Power comes in > on/off Switch > 5V regulator > power the board (teensy and lpd8806 strip)

Im using the SPI pins since I only have the one strip right now.

The case was just a small enclosure I found at the local electronics shop, it was small enough to fit the teensy almost perfectly and still have some room for wires and such. Lucked out!

For power I am using a standard 4 AA battery pack. lithiums have a higher than 6 volts so to not hurt the strip of my Teensy I added a 5V regulator. This will also allow me to upgrade to a bigger, rechargeable battery when I find a good one to use.

Right now, I need to find a good way to enable the button to switch the effect functions. Im currently looking at this project for inspiration:
http://arduino.cc/forum/index.php/topic,81896.0.html Cranium uploaded his code in another topic I cant find at the moment.

Looking for better ideas for switching through the functions/effect!! Please suggest! Right now it just cycles through a few different ones and loops.

My current code is here:

LPD8806 battery power update.

With a 5m strip I was running off those regular alkaline 4 x AA batteries (see pic above) for almost 2 hours yesterday. I did however bypass the voltage regulator since it appears to be cutting off too much power. It runs about 4.8 with the teensy and strip (with no effects), drops to 3.5 or so with general effects running.

It was noticeably dimmer than if connected via USB, which was to be expected. However, for a portable unit this was an impressive run time and seemed to only be slowly dimming. I'll be updating to lithums for the weekend event.. and continue to search for a rechargeable supply.. most likely a 12v lipo.

Power Update:
I ran some multiple test using different supplies, I'll make a chart tonight sometime.

I found the 5V 7805 voltage regulator could only handle a 12V source for about 45mins before it overheats and shuts down (a safety feature built in). I think it would be great for only up to a constant 7V input.

I however, hacked apart a cheap USB car adapter (similar to: http://dx.com/p/universal-usb-power-car-adapter-black-27331) , which included some resisters, capacitors, etc. with 12V in, 5V out,0 max output of 1A. It lasted over 2 hours with the 12V source and didnt shut down. Adds a bit of extra bulk to the battery to controller but since it's already built it saves some times and convenience.

Heres my final code for my LED shorts. with my local sports team colors (blue and gold). The secret mode is green for when we lost (the other teams colors)

I kept the other default effect (chase and wave) in there but I did not use them in my selection.

This code works great with the button.

#include "LPD8806.h"
#include "SPI.h"
/*****************************************************************************/
// Full 5m LPD8806 STRIP
/*****************************************************************************/

#define holdTime 3000  //used to time button hold for special function
#define buttonPin 23   //Default button pin

//To DISABLE Auto USB to save power
const int usb_usb_disable = 0;     //disabled usb is enable to save power
int mode = 0;                      // default mode is off (0)
int nummodes = 8;                  //number of total modes
long btnDnTime;                    // time the button was pressed down
long btnUpTime;                    // time the button was released

// Number of RGB LEDs in strand:
int nLEDs = 160;

//LPD8806 strip = LPD8806(32, dataPin, clockPin);  // In case use different pins.
LPD8806 strip = LPD8806(nLEDs);                    // Default to SPI pins 21 and 22 on Teensy 2.00

void setup() {
  if (usb_usb_disable) Serial.end(); //Disable USB is the usb_usb_disable is 0
  Serial.begin(9600);                // Set up serial communication at 9600bps to debug via usb
  pinMode(buttonPin, INPUT);         //Enable BUTTON
  // Start up the LED strip
  strip.begin();                     // Start up the LED strip
  // Update the strip, to start they are all 'off'
    for (int i = 0; i < 160; i++){        
      strip.setPixelColor(i, 0, 0,0);  
      strip.show(); 
    }
  strip.show();
  //Set OUTPUT to pins to save power
  for (int i=0; i<20; i++){ pinMode(i, OUTPUT);  }
  for (int i=24; i<46; i++){ pinMode(i, OUTPUT); }
}

/************************************************************/
// function prototypes, do not remove these!
void colorChase(uint32_t c, uint8_t wait);
void colorWipe(uint32_t c, uint8_t wait);
void dither(uint32_t c, uint8_t wait);
void scanner(uint8_t r, uint8_t g, uint8_t b, uint8_t wait);
void wave(uint32_t c, int cycles, uint8_t wait);
void rainbowCycle(uint8_t wait);
void police(int);
void failure(int);
void modeSelect();
void returnModeSelect();
uint32_t Wheel(uint16_t WheelPos);
/************************************************************/

/******************************************************************************/
//			Main Loop Function				      //
/******************************************************************************/
void loop() {
   //Serial.println(mode); // OFF
  if (digitalRead(buttonPin)==LOW){
     Serial.println("BUTTON OFF"); // OFF
  }  delay(50);
  
  if (digitalRead(buttonPin)==HIGH){
     Serial.println("BUTTON ON"); // ON
  };
  if (mode == 0) { 
    for (int i = 0; i < 160; i++){        
      strip.setPixelColor(i, 0, 0,0);  
      strip.show(); 
    }
  }
/*****************************************************************************/
   if(digitalRead(buttonPin) == HIGH){           //Runs when button is pressed
     Serial.println("Button pressed, going to returnModeSelect function");
     returnModeSelect();                         //Run function to change mode
     Serial.println("Finished returnModeSelect function, going to modeSelect");
   }
/*****************************************************************************/      

  modeSelect();  //Defaults to 0 = Case 1
  if (mode > 7) mode = 0;
}

/******************************************************************************/
//			Select Mode Function				      //
/******************************************************************************/
void modeSelect(){
  switch (mode){
    case 1:
      Serial.println("ColorWipe & Dither");
      // Fill the entire strip with...
	colorWipe(strip.Color(0,0,127), 10);          // blue
	dither(strip.Color(105,70,0), 20);       // yellow, slow
	dither(strip.Color(  0,  0,127), 20);    // blue, slow
	dither(strip.Color(0,0,0), 5);           // black, fast
	dither(strip.Color(105,70,0), 20);       // yellow, slow
	dither(strip.Color(0,0,0), 5);           // black, fast
	dither(strip.Color(  0,  0,127), 20);    // blue, slow
	dither(strip.Color(105,70,0), 2);       // yellow, slow 
      break;
    case 2:
      Serial.println("POLICE");
	police(250, 10);   // Delay and Repetitions
      break;
    case 3:
      Serial.println("POLICE FAST");
	police(100, 10);   // Delay and Repetitions
      break;
    case 4:
      Serial.println("Back-and-forth lights");
	scanner(105,70,0, 20);           // gold, slow
	scanner(  0,  0,127, 15);        // blue, fast
      break;
    case 5:
      Serial.println("ALL");
	colorWipe(strip.Color(0,0,127), 10);          // blue
	dither(strip.Color(105,70,0), 20);       // yellow, slow
	dither(strip.Color(  0,  0,127), 20);    // blue, slow
	dither(strip.Color(0,0,0), 5);           // black, fast
	dither(strip.Color(105,70,0), 20);       // yellow, slow
	dither(strip.Color(0,0,0), 5);           // black, fast
	dither(strip.Color(  0,  0,127), 20);    // blue, slow
	dither(strip.Color(105,70,0), 2);       // yellow, slow 
	police(250, 15);   // Delay and Repetitions
	scanner(105,70,0, 20);           // gold, slow
	scanner(  0,  0,127, 15);        // blue, fast
	colorWipe(strip.Color(105,70,0), 10);          // gold
	dither(strip.Color(  0,  0,127), 15);         // blue, slow
	dither(strip.Color(105,70,0), 20);       // yellow, slow
	dither(strip.Color(0,0,0), 15);           // black, fast
	scanner(105,70,0, 15);        // gold, slow
	scanner(  0,  0,127, 10);        // blue, fast 
	police(250,10); 
      break;
    case 6:
      Serial.println("rainbow");
	rainbowCycle(0);
      break;
    case 7:
      Serial.println("rainbow");
	failure(250,15);
      break;
  }
}

Full code can be found here:

MODS: Could you move this thread to the Exhibition / Gallery forum??

If you want something moving, then tell us via the "report to moderators" mechanism (as another member did in this instance).
Just putting a request in a post isn't going to work because we don't read every post.