High-Power Leds and shiftregisters

Hey,

I’m trying to build a little flexible lightsystem for some model-photography. I want several rgb leds in a row, which i can dim and set to specific colors on my Laptop or whatever computer. So far i worked out the software interface in processing which looks like this

import processing.serial.*;

import controlP5.*;

Serial myPort; 

ControlP5 cp5;

int bang_count=0;
int rows=-1;
int cols=0;

ArrayList<Ligthswitch> switches;

void setup() {
  size(520, 400);
  background(255, 255, 255);

  cp5= new ControlP5(this);
  cp5.addBang("bang")
    .setPosition(width-100, 200)
      .setSize(40, 40)
        .setId(0)
          ;

  switches = new ArrayList<Ligthswitch>();

  //start seriel port i/o
  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 9600);
}

void draw() {
  background(255, 255, 255);
  for (int i = 0; i < switches.size(); i++) {
    Ligthswitch ls = (Ligthswitch) switches.get(i);
    ls.read();
  }
} 

public void bang() {
  bang_count = bang_count+1;
  if (rows<2) {
    rows++;
  }
  else {
    cols++;
    rows=0;
  }
  switches.add(new Ligthswitch(bang_count, rows, cols));
  println(bang_count+", r="+rows+", c="+cols);
}

here is the Ligthswitch class

class Ligthswitch {

  int pin;
  float brigthness=0;
  float old_b;
  int myrow;
  int mycol;

  Ligthswitch(int id, int r, int c) {
    pin=id;
    myrow=r;
    mycol=c;
    int xpos=myrow*width/4+10;
    int ypos=mycol*100+50;
    cp5.addSlider("sliderValue"+pin)
      .setPosition(xpos, ypos)
        .setRange(0, 255)
          .setId(pin)
            .setWidth(100)
              ;
  }
  void read() {
    brigthness = cp5.controller("sliderValue"+pin).getValue();
    if (brigthness != old_b) {
      println(pin + ", b=" + brigthness);
      old_b=brigthness;
      WriteVal();
    }
  }

  void WriteVal() {
    int t=10;
    //zeilenumbruch für arduino, ende ziffernkombination
    char c = char(t);
    // int wird als string umgewandelt
    String spin=nf(pin, 2);
    int bri= int(brigthness);
    String sbri=nf(bri, 3);

    myPort.write(spin+","+sbri+c);
  }
}

on the arduino side im using the shiftPWM library hooked up to one shiftregister at the moment. the code is a combination of some examples i found and looks like that

/************************************************************************************************************************************
 * Fade in LED's one by one using ShiftPWM with one shift register
 ************************************************************************************************************************************/

// You can choose the latch pin yourself.
const int ShiftPWM_latchPin=8;

#define SHIFTPWM_NOSPI
const int ShiftPWM_dataPin = 11;
const int ShiftPWM_clockPin = 12;


// If your LED's turn on if the pin is low, set this to true, otherwise set it to false.
const bool ShiftPWM_invertOutputs = false;

// You can enable the option below to shift the PWM phase of each shift register by 8 compared to the previous.
// This will slightly increase the interrupt load, but will prevent all PWM signals from becoming high at the same time.
// This will be a bit easier on your power supply, because the current peaks are distributed.
const bool ShiftPWM_balanceLoad = false;

#include <ShiftPWM.h>   // include ShiftPWM.h after setting the pins!

// Here you set the number of brightness levels, the update frequency and the number of shift registers.
// These values affect the load of ShiftPWM.
// Choose them wisely and use the PrintInterruptLoad() function to verify your load.
// There is a calculator on my website to estimate the load.

unsigned char maxBrightness = 255;
unsigned char pwmFrequency = 75;
int numRegisters = 8;
int numRGBleds = numRegisters*8/3;

void setup(){

  // Sets the number of 8-bit registers that are used.
  ShiftPWM.SetAmountOfRegisters(numRegisters);

  // SetPinGrouping allows flexibility in LED setup.
  // If your LED's are connected like this: RRRRGGGGBBBBRRRRGGGGBBBB, use SetPinGrouping(4).
  //ShiftPWM.SetPinGrouping(3); //This is the default, but I added here to demonstrate how to use the funtion

  ShiftPWM.Start(pwmFrequency,maxBrightness);

  Serial.begin(9600);
  Serial.println("Hello");
  ShiftPWM.SetAll(0);
}


void loop()
{ 
  ShiftPWM.SetOne(0, 255);
  comm(); 
}

void comm(){
  while (Serial.available() > 0) {

    // look for the next valid integer in the incoming serial stream:
    int pin = Serial.parseInt(); 
    // do it again:
    int bri = Serial.parseInt(); 
    if (Serial.read() == '\n') {
      // constrain the values to 0 - 255 and invert
      // if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
      ShiftPWM.SetOne(pin, bri);
    }
  }
}

this is my breadboard layout

so far everything works fine. Now i’m just using regular low current leds with 20 mA which is for photography just not enough light, so i wanted to exchange the regular leds with high-power leds (this e.g. http://tinyurl.com/ojeakdg stupid question but this is a module, does it mean it has the heatsink build right in?) but dont know exactly how. I guess with some npn transistors and a dc power supply.
And for example if i use 3 shiftregisters and 24 of this led(so 8rgb sets in the end) it need with 350 mA altogether almost 8400 mA with 3.5V which would be quiet odd for one powersupply . Is there a possibilty to use several powersupplys?
So my biggest problem is to understand how to hook up the High power leds to the shift register. Any help or suggestion is very welcome.

thanks

Martin

does it mean it has the heatsink build right in?

Yes but that heat sink needs to be bolted onto another.

it need with 350 mA altogether almost 8400 mA with 3.5V which would be quiet odd for one powersupply .

Yes.

I guess with some npn transistors and a dc power supply

No. For each LED you need a constant current supply capable of 350mA. You can drive a few constant current circuits from the same power supply. Google around for a circuit or ready built module.