Go Down

Topic: How can I connect my 12v ws2811 300 led strip (Read 646 times) previous topic - next topic

avvy66

I have a new set of 12 volt led strip lights with 300 leds, and wish to power them from a 12v 8.5 amp power supply.

I have the ground and positive outer wires connected to 12v  ground and positive. Then I have the green data wire , from the inner wires, connected to pin 3 on my arduino, and also have the white ground wire connected to GND on the arduino.

I read on an older post from 2016, about this and someone said to connect both the ground of the arduino and the 12v power supply ground, together.

How do I do that, by running a wire from the ground of the led strip to the ground, or earth? on the 12v power supply.

Thanks

CrossRoads

Gnd from Arduino to Gnd on the 12V supply.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Gnd from Arduino to Gnd on the 12V supply.

You might also need to connect 12V/Gnd to both ends of the strip for better power distribution.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

avvy66

#3
Feb 19, 2018, 04:43 pm Last Edit: Feb 19, 2018, 05:44 pm by avvy66 Reason: Add a picture
I connected the arduino with the USB lead from my pc, and the ground from the arduino to the -V connection where the ground of the outer wire is connected and the leds did not light up. I then moved the ground lead to the earth connection, but still no led lights.

I have added a pic now to show my setup

CrossRoads

Time to post your sketch then. Use the Code tag button, </>
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

avvy66

I am using the FASTLED DemoReel100, and I have added a picture of my setup above this post

Code: [Select]

#define DATA_PIN    3
//#define CLK_PIN   4
#define LED_TYPE    WS2811
#define COLOR_ORDER GRB
#define NUM_LEDS    64
CRGB leds[NUM_LEDS];

#define BRIGHTNESS          96
#define FRAMES_PER_SECOND  120

void setup() {
  delay(3000); // 3 second delay for recovery
 
  // tell FastLED about the LED strip configuration
  FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
  //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);

  // set master brightness control
  FastLED.setBrightness(BRIGHTNESS);
}


// List of patterns to cycle through.  Each is defined as a separate function below.
typedef void (*SimplePatternList[])();
SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };

uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current
uint8_t gHue = 0; // rotating "base color" used by many of the patterns
 
void loop()
{
  // Call the current pattern function once, updating the 'leds' array
  gPatterns[gCurrentPatternNumber]();

  // send the 'leds' array out to the actual LED strip
  FastLED.show(); 
  // insert a delay to keep the framerate modest
  FastLED.delay(1000/FRAMES_PER_SECOND);

  // do some periodic updates
  EVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbow
  EVERY_N_SECONDS( 10 ) { nextPattern(); } // change patterns periodically
}

#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))

void nextPattern()
{
  // add one to the current pattern number, and wrap around at the end
  gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);
}

void rainbow()
{
  // FastLED's built-in rainbow generator
  fill_rainbow( leds, NUM_LEDS, gHue, 7);
}

void rainbowWithGlitter()
{
  // built-in FastLED rainbow, plus some random sparkly glitter
  rainbow();
  addGlitter(80);
}

void addGlitter( fract8 chanceOfGlitter)
{
  if( random8() < chanceOfGlitter) {
    leds[ random16(NUM_LEDS) ] += CRGB::White;
  }
}

void confetti()
{
  // random colored speckles that blink in and fade smoothly
  fadeToBlackBy( leds, NUM_LEDS, 10);
  int pos = random16(NUM_LEDS);
  leds[pos] += CHSV( gHue + random8(64), 200, 255);
}

void sinelon()
{
  // a colored dot sweeping back and forth, with fading trails
  fadeToBlackBy( leds, NUM_LEDS, 20);
  int pos = beatsin16( 13, 0, NUM_LEDS-1 );
  leds[pos] += CHSV( gHue, 255, 192);
}

void bpm()
{
  // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
  uint8_t BeatsPerMinute = 62;
  CRGBPalette16 palette = PartyColors_p;
  uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
  for( int i = 0; i < NUM_LEDS; i++) { //9948
    leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
  }
}

void juggle() {
  // eight colored dots, weaving in and out of sync with each other
  fadeToBlackBy( leds, NUM_LEDS, 20);
  byte dothue = 0;
  for( int i = 0; i < 8; i++) {
    leds[beatsin16( i+7, 0, NUM_LEDS-1 )] |= CHSV(dothue, 200, 255);
    dothue += 32;
  }
}

avvy66

When you say: "Gnd from Arduino to Gnd on the 12V supply", I am a little confused.

Do you mean the actual earth on the power supply: the green and white wire, or the -V output ground: the white wire from the led strip

I have a white wire connected to the arduino from the led strip.

avvy66

Ok, I think I have it done now.

I have the white ground wire from the outer wires connected to the -V port on the 12 Volt power supply, and also have a white ground wire from the inner wires connected to the GND on the arduino.

On the green data wire I have a 510 ohm resistor connected to data pin 3.

One other thing I have done is to swap over 2 arduinos, as the one I was using didn't seem to work with lighting up the led strip. The other arduino , which I robbed from another project, was working correctly and does light up the led strip.

The arduino is powered by a 9 Volt 2 Amp power supply.

Do I need to change the resistor for a different value and do I need to connect any other wires etc.

Grumpy_Mike

#8
Feb 20, 2018, 05:10 pm Last Edit: Feb 20, 2018, 05:10 pm by Grumpy_Mike
Quote
Do I need to change the resistor for a different value and do I need to connect any other wires etc.
For best results connect both ground wires of your strip together and both 5V wires as well if you can. The resistor is fine.

avvy66

For best results connect both ground wires of your strip together and both 5V wires as well if you can. The resistor is fine.
The strip is 12v not 5v, but it won't make any odds.

So I should connect both red wires to the +12v terminal on the power supply, yes, and connect both ground/white wires together.

You can see how they are at the moment from the pic, and it would mean to move one of them to its new position.
Does it matter that , for example, I move the white GND on the arduino to the -V on the power supply.

Thanks

Wawa

#10
Feb 21, 2018, 12:50 am Last Edit: Feb 21, 2018, 12:53 am by Wawa
#define NUM_LEDS 64

Change that number to 100 for a "12volt, 300 LED" strip.
Because a 12volt addressable LED strip works in sets of three (can't control each single LED, as with a 5volt strip).

Are you sure you have connected the data wire to the data input (not the output) of the strip.
Leo..

avvy66

#define NUM_LEDS 64

Change that number to 100 for a "12volt, 300 LED" strip.
Because a 12volt addressable LED strip works in sets of three (can't control each single LED, as with a 5volt strip).

Are you sure you have connected the data wire to the data input (not the output) of the strip.
Leo..
I changed the number of leds in the sketch before I uploaded it. It is 64 now because I couldn't save it as the same name with 300 leds.

The green data wire is connected from the input of the strip; where the arrow points towards the leds, to a digital pwm pin 3, via a 510 ohm resistor on the arduino.

There is a male ws2811 type plug, with 3 pins, connected to the input of the female socket which goes to the strip. It is more secure than just plugging in jumper wires.

Wawa

It seems you don't understand that you only have 100 LED drivers on a 12volt-300LED strip.
That's why you have to set the number to 100, not to 300.
Leo..
 

avvy66

#13
Feb 21, 2018, 01:17 pm Last Edit: Feb 21, 2018, 02:16 pm by avvy66
It seems you don't understand that you only have 100 LED drivers on a 12volt-300LED strip.
That's why you have to set the number to 100, not to 300.
Leo..
  
Ah yes , now I understand as I thought you meant 100 leds, and not drivers as per this:

"Change that number to 100 for a "12volt, 300 LED" strip."

Now I have changed it to 100.

What was also  a bit confusing, was that the line in the sketch says: #define NUM_LEDS    100. LEDS not Drivers.

 
Can I ask for a bit more clarification on connecting the 12v power supply ground to the led strip. Is it just a matter of running a wire from the 12 -V terminal to join up with the led strip ground. Both wires are white

Wawa

#14
Feb 21, 2018, 08:58 pm Last Edit: Feb 21, 2018, 08:59 pm by Wawa
What was also  a bit confusing, was that the line in the sketch says: #define NUM_LEDS    100. LEDS not Drivers.
 
Can I ask for a bit more clarification on connecting the 12v power supply ground to the led strip. Is it just a matter of running a wire from the 12 -V terminal to join up with the led strip ground. Both wires are white
12volt addressable strips are a cut-down version of 5volt addressable strips.
The 5volt strips have a driver chip inside each LED, the 12volt strips have chips that drive groups of three LEDs.
So you can't address each LED of a 12volt strip individually.

How do you power the Arduino. USB or 12volt on V-in.
Leo..

Go Up