Problem with led's[ch8207]

I have bought an LED strip that is identical to every other strip myfriends at college have messed about with and got working (fading,colour mixing etc) BUT the common part for this strip is the earth(see attached image) Having a common power + seems to be the normal way of swtiching LEDsvia the earth - and seems to be the easiest way of doing PWM. How do I control this weird strip? Help!

Wait, so it's common cathode (Negative/ground)?

Then it's simple. Just connect the common cathode to ground, and PWM each (R, G, and B) like normal. The higher you PWM it, the brighter it'll be.

If it's common anode (positive), then you simply do the same thing in reverse. Attach the anode to +5V, and PWM each pin (R, G, and B). Except this time, the LOWER you PWM it, the brighter it'll be.

At the end of it, Isn't it about creating potential differences?

Thanks guys for the replies, but I've tried all sorts of obviousthings and they don't work If its not too much trouble could you post a circuit diagram with partnumbers (darlington arrays etc) Thanks Pala

First question is … is that a 5V or 12V strip?

  • The only real difference is the rating of the built in resistors.

Many of those strips seems to be 12v and running it using 5v most likely will produce no output.

If this is a 5V setup, you can run right from the arduino with nothing but wires (no other components needed).

If you are not sure if this is a 5v or a 12v strip and nothing below works … then you may have a 12 volt need.

If you have 5V - try this (doing so to a 12v rated LED won’t hurt it) :
Hook the common wire to ground.
Hook Red to 9, Green to 10 and Blue to 11 and try this code.

(if you do this and it does not work … then try hooking the common to 5v in case you have common anode - but it sounded as though this is common ground).

  • Due to the fact that this does a fade up and down means you should see activity with either setup (common anode or cathode if connected property).
/*
 * RGB Fader
 *
 * The basic Arduino example.  Turns on an RGB LED to various color.
 * Be sure to use the correct resistors for your LED.
 *
 * Joseph Francis - Open Source
 */

//--- Using PWM Pins
int rPin = 9;                 // Red LED connected to digital pin 9
int gPin = 10;                // Green LED connected to digital pin 10
int bPin = 11;                // Blue connected to digital pin 11

int iDelay = 500;             // Standard Delay
int iFadeDelay = 10;          // Delay when fading

void setup()                  // run once, when the sketch starts
{
  //Digital pins can be used for input or output of On/Off states
  //PWM pins can read on/off only but can output a range from 0 to 255
  pinMode(rPin, OUTPUT);      // sets the digital pin as output
  pinMode(gPin, OUTPUT);      // sets the digital pin as output
  pinMode(bPin, OUTPUT);      // sets the digital pin as output

}

void ledOff(){
   //-- turns off all the LEDs
  setLedRGB(0,0,0);
}
void ledOn(){
   //-- turns on all the LEDs
  setLedRGB(255,255,255);
}

//-- Set the RGB Led using these Red, Green and Blue values (from 0 to 255 .. hence byte data type)
void setLedRGB(byte r, byte g, byte b){
  analogWrite(rPin, r);
  analogWrite(gPin, g);
  analogWrite(bPin, b);
}

void loop()                     // run over and over again
{
  
  //--- Turn all the LED's pins off
  ledOff();
  delay(iDelay);                  // delay some

  // Cycle through the Common 7 colors (White, Red, Green, Blue, Yellow, Majenta)
  setLedRGB(255,255,255);      // set all on for white
  delay(iDelay);               // delay some between changes to look at it
  setLedRGB(255,0,0);          // set red
  delay(iDelay);
  setLedRGB(0,255,0);          // set green
  delay(iDelay);
  setLedRGB(0,0,255);          // set blue
  delay(iDelay);

  setLedRGB(255,255,0);        // set red and green for yellow
  delay(iDelay);
  setLedRGB(255,0,255);        // set red and blue for majenta
  delay(iDelay);
  setLedRGB(0,255,255);        // set blue and green for cyan
  delay(iDelay);

  ledOff();
  delay(iDelay);

  //--- The above samples could be run using standard pins (not PWM)
  //--- The fading sample below uses analogWrite, which needs PWM pins (a limited amount and use timers to work)

  //fade up red and back down
  for (int i = 0 ; i <= 255 ; i++ ){
    setLedRGB(i,0,0);          //set red value using PWM
    delay(iFadeDelay);
  }
  for (int i = 255 ; i >= 0 ; i-- ){
    setLedRGB(i,0,0);          //set red value using PWM
    delay(iFadeDelay);
  }

  //--- cycle through color mixing
  
  //-- fade up red
  for (int i = 0 ; i <= 255 ; i++ ){
    setLedRGB(i,0,0);
    delay(iFadeDelay);
  }
  //-- fade to yellow
  for (int i = 0 ; i <= 255 ; i++ ){
    setLedRGB(255,i,0);
    delay(iFadeDelay);
  }
  //-- fade to green
  for (int i = 255 ; i >= 0 ; i-- ){
    setLedRGB(i,255,0);
    delay(iFadeDelay);
  }
  //-- fade to cyan
  for (int i = 0 ; i <= 255 ; i++ ){
    setLedRGB(0,255,i);
    delay(iFadeDelay);
  }
  //-- fade to blue
  for (int i = 255 ; i >= 0 ; i-- ){
    setLedRGB(0,i,255);
    delay(iFadeDelay);
  }
  //-- fade to majenta
  for (int i = 0 ; i <= 255 ; i++ ){
    setLedRGB(i,0,255);
    delay(iFadeDelay);
  }
  //-- fade to white
  for (int i = 0 ; i <= 255 ; i++ ){
    setLedRGB(255,i,255);
    delay(iFadeDelay);
  }
  delay(1000);               // delay some
  
}