LED Light show - Multiple Power Sources

by davnirvana on Wed Dec 05, 2012 11:22 am

Hi,

I am very new to this all, but I am currently putting together a light show for graduate school using the Arduino.

Currently, I have two LED sets --
1. a set of 50 12mm pixels, powered by 5V power supply. (similar to http://learn.adafruit.com/12mm-led-pixels/wiring)
and
2. a 3m LED strip from Adafruit, powered by 12V power supply. (http://learn.adafruit.com/rgb-led-strips/usage)

(Optimally, I would add a traditional set of LEDs powered from the Arduino, but that's a question for another day)

My question is this:
Having two separate power supplies, how is this wired? In essence will I have two separate breadboards? One for each power amount? And then do I bring both of the ground lines together and take that back to the Arduino?

I am simply afraid of frying everything. Let me know if my thoughts are correct. If you can, a schematic would be incredibly helpful.

Thank you so much.

I love this process. I look forward to growing in this field and maybe even one day answering questions for people like myself.

-David
davnirvana
 
Posts: 10
Joined: Tue Sep 04, 2012 11:50 am

Re: LED Light show - Multiple Power Sources

by adafruit_support_bill on Wed Dec 05, 2012 11:26 am

The different strips & strands can use different supplies. Just tie all the grounds together with the Arduino ground.
User avatar
adafruit_support_bill
 
Posts: 28161
Joined: Sat Feb 07, 2009 9:11 am

Re: LED Light show - Multiple Power Sources

by davnirvana on Wed Dec 05, 2012 12:26 pm

Thanks for the fast response!

When you say 'tie' together, would that be the equivalent of having it all on the same (-) rail of a breadboard -- which then connect back to GND pin on Arduino?
davnirvana
 
Posts: 10
Joined: Tue Sep 04, 2012 11:50 am

Re: LED Light show - Multiple Power Sources

by adafruit_support_bill on Wed Dec 05, 2012 12:35 pm

would that be the equivalent of having it all on the same (-) rail of a breadboard -- which then connect back to GND pin on Arduino?

Yes. That will do it.
User avatar
adafruit_support_bill
 
Posts: 28161
Joined: Sat Feb 07, 2009 9:11 am

Re: LED Light show - Multiple Power Sources

by davnirvana on Fri Dec 07, 2012 2:03 pm

So here is set-up one; however, nothing is happening. I am using the code from the above tutorial and power from the Arduino Vin.

The MOSFET's don't really seem to fit into the breadboard and I wonder if that could be doing it.
photo.JPG
photo.JPG (791.21 KiB) Viewed 1445 times


Also, I have a 12V supply but have not connected it as I thought I'd try to power from the Arduino.

What should I do?

Thank you so much.
davnirvana
 
Posts: 10
Joined: Tue Sep 04, 2012 11:50 am

Re: LED Light show - Multiple Power Sources

by adafruit_support_bill on Fri Dec 07, 2012 2:11 pm

The MOSFET's don't really seem to fit into the breadboard and I wonder if that could be doing it.

The legs on the MOSFETs are too long to go all the way in, but they should be in deep enough to be gripped by the contact springs.

I can't see all the wiring in the photo. What is the black wire going into the '+' side of the power bus. The usual convention is to use black for ground wires.

Also, I have a 12V supply but have not connected it as I thought I'd try to power from the Arduino.

Are you powering them from the VIN pin, or from the 5v pin? What is powering your Arduino?
User avatar
adafruit_support_bill
 
Posts: 28161
Joined: Sat Feb 07, 2009 9:11 am

Re: LED Light show - Multiple Power Sources

by davnirvana on Fri Dec 07, 2012 3:08 pm

Hey that black wire is from the LED strip. I was assuming that is the 12V on the strip.

Also, it is connected to the Vin, and Arduino is powered by USB. I then tried connecting a 9V battery to the arduino to see if that would do anything, but nothing. The LEDS on the Arduino are on, but the strip is not coming on.

Thank you.
davnirvana
 
Posts: 10
Joined: Tue Sep 04, 2012 11:50 am

Re: LED Light show - Multiple Power Sources

by adafruit_support_bill on Fri Dec 07, 2012 4:02 pm

it is connected to the Vin, and Arduino is powered by USB.

I doubt you would be able to light the strips powering via USB. If anything it would overload your USB port and shut it down.
I then tried connecting a 9V battery to the arduino

Another power source with very limited current. You really need to get yourself a 12v source capable of several amps. An 8x AA pack will do the job also.

Post a photo or diagram showing all your connections.
User avatar
adafruit_support_bill
 
Posts: 28161
Joined: Sat Feb 07, 2009 9:11 am

Re: LED Light show - Multiple Power Sources

by davnirvana on Fri Dec 07, 2012 7:01 pm

It works!

It was adding the 12v supply that did it.

That said, it is only red currently.

___

So I could power a traditional strand from the vin? or 5v?



Awesome. Thanks.
davnirvana
 
Posts: 10
Joined: Tue Sep 04, 2012 11:50 am

Re: LED Light show - Multiple Power Sources

by adafruit_support_bill on Sat Dec 08, 2012 6:56 am

So I could power a traditional strand from the vin? or 5v?

The 5v regulator on the Arduino is only good for a few hundred mA, and is easily overloaded by a a lot of LEDs.
VIN is connected directly to the DC input jack on the Arduino, so the available power depends on what you are using to power the Arduino. (The Arduino itself only needs about 20mA, so anything else is available for LEDs.)
User avatar
adafruit_support_bill
 
Posts: 28161
Joined: Sat Feb 07, 2009 9:11 am

Re: LED Light show - Multiple Power Sources

by davnirvana on Sat Dec 08, 2012 8:30 pm

Excellent. Thanks for that.

I'm currently trying to get the 50-strand of RGB to respond to the Arduino.

I am using this code:

Code: Select all | TOGGLE FULL SIZE
#include <TimerOne.h>
#include "LPD6803.h"

//Example to control LPD6803-based RGB LED Modules in a strand
// Original code by Bliptronics.com Ben Moyes 2009
//Use this as you wish, but please give credit, or at least buy some of my LEDs!

// Code cleaned up and Object-ified by ladyada, should be a bit easier to use

/*****************************************************************************/

// Choose which 2 pins you will use for output.
// Can be any valid output pins.
int dataPin = 11;       // 'yellow' wire
int clockPin = 13;      // 'green' wire
// Don't forget to connect 'blue' to ground and 'red' to +5V

// Timer 1 is also used by the strip to send pixel clocks

// Set the first variable to the NUMBER of pixels. 20 = 20 pixels in a row
LPD6803 strip = LPD6803(20, dataPin, clockPin);


void setup() {
 
  // The Arduino needs to clock out the data to the pixels
  // this happens in interrupt timer 1, we can change how often
  // to call the interrupt. setting CPUmax to 100 will take nearly all all the
  // time to do the pixel updates and a nicer/faster display,
  // especially with strands of over 100 dots.
  // (Note that the max is 'pessimistic', its probably 10% or 20% less in reality)
 
  strip.setCPUmax(50);  // start with 50% CPU usage. up this if the strand flickers or is slow
 
  // Start up the LED counter
  strip.begin();

  // Update the strip, to start they are all 'off'
  strip.show();
}


void loop() {
  // Some example procedures showing how to display to the pixels
 
  colorWipe(Color(63, 0, 0), 50);
  colorWipe(Color(0, 63, 0), 50);
  colorWipe(Color(0, 0, 63), 50);

  rainbow(50);

  rainbowCycle(50);
}

void rainbow(uint8_t wait) {
  int i, j;
   
  for (j=0; j < 96 * 3; j++) {     // 3 cycles of all 96 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel( (i + j) % 96));
    } 
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// Slightly different, this one makes the rainbow wheel equally distributed
// along the chain
void rainbowCycle(uint8_t wait) {
  int i, j;
 
  for (j=0; j < 96 * 5; j++) {     // 5 cycles of all 96 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      // tricky math! we use each pixel as a fraction of the full 96-color wheel
      // (thats the i / strip.numPixels() part)
      // Then add in j which makes the colors go around per pixel
      // the % 96 is to make the wheel cycle around
      strip.setPixelColor(i, Wheel( ((i * 96 / strip.numPixels()) + j) % 96) );
    } 
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// fill the dots one after the other with said color
// good for testing purposes
void colorWipe(uint16_t c, uint8_t wait) {
  int i;
 
  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

/* Helper functions */

// Create a 15 bit color value from R,G,B
unsigned int Color(byte r, byte g, byte b)
{
  //Take the lowest 5 bits of each value and append them end to end
  return( ((unsigned int)g & 0x1F )<<10 | ((unsigned int)b & 0x1F)<<5 | (unsigned int)r & 0x1F);
}

//Input a value 0 to 127 to get a color value.
//The colours are a transition r - g -b - back to r
unsigned int Wheel(byte WheelPos)
{
  byte r,g,b;
  switch(WheelPos >> 5)
  {
    case 0:
      r=31- WheelPos % 32;   //Red down
      g=WheelPos % 32;      // Green up
      b=0;                  //blue off
      break;
    case 1:
      g=31- WheelPos % 32;  //green down
      b=WheelPos % 32;      //blue up
      r=0;                  //red off
      break;
    case 2:
      b=31- WheelPos % 32;  //blue down
      r=WheelPos % 32;      //red up
      g=0;                  //green off
      break;
  }
  return(Color(r,g,b));
}


however I keep getting the issue:
Code: Select all | TOGGLE FULL SIZE
/Users/davnirvana/Documents/Arduino/libraries/LPD6803/LPD6803.cpp: In member function 'void LPD6803::begin()':
/Users/davnirvana/Documents/Arduino/libraries/LPD6803/LPD6803.cpp:140: error: 'Timer1' was not declared in this scope
/Users/davnirvana/Documents/Arduino/libraries/LPD6803/LPD6803.cpp: In member function 'void LPD6803::setCPUmax(uint8_t)':
/Users/davnirvana/Documents/Arduino/libraries/LPD6803/LPD6803.cpp:156: error: 'Timer1' was not declared in this scope


What should I do?

Thank you so much.
davnirvana
 
Posts: 10
Joined: Tue Sep 04, 2012 11:50 am

Re: LED Light show - Multiple Power Sources

by adafruit_support_bill on Sun Dec 09, 2012 6:36 am

Is that the very first error message? Be sure to scroll to the top of the output window to get the first ones as they are typically the most relevant.

Also, what operating system and what version of the IDE are you using?
User avatar
adafruit_support_bill
 
Posts: 28161
Joined: Sat Feb 07, 2009 9:11 am