1872 WS2812b LEDS?


My project right now involves making 13 metres of 144led WS2812b strips. I am very new to electronics like this, so keep that in mind :slight_smile:

I’ve wired up 13 metres with a 5v 60A power supply. Should be more than enough. I’m also using an arduino mega 2560 with no resistors or capacitors.

Why are the LEDS not as smooth as 1 metre for example? I set the FPS to 160, then 240 and eventually tried 10000. Seems like it doesn’t change anything? Why is this happening and how can i make the 13 metres smooth again?

#include <FastLED.h>


// FastLED “100-lines-of-code” demo reel, showing just a few
// of the kinds of animation patterns you can quickly and easily
// compose using FastLED.
// This example also shows one easy way to define multiple
// animations patterns and have them automatically rotate.
// -Mark Kriegsman, December 2014

#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning “Requires FastLED 3.1 or later; check github for latest code.”

#define DATA_PIN 6
//#define CLK_PIN 4
#define LED_TYPE WS2811
#define NUM_LEDS 1872

#define BRIGHTNESS 100
#define FRAMES_PER_SECOND 10000

void setup() {
delay(1000); // 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

// 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

// send the ‘leds’ array out to the actual LED strip
// insert a delay to keep the framerate modest

// 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

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(190), 200, 250);

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 = ColorFromPalette(palette, gHue+(i2), beat-gHue+(i10));

  • }*
    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;*
  • }*
    If I’ve missed anything else, please let me know, as i’m just getting into electronics.
    Thank you.
    arduino.ino (3.61 KB)

Please modify your post and insert code tags. Without them, as you can see, the forum corrupts your code.

I've wired up 13 metres with a 5v 60A power supply. Should be more than enough.

Your strip could draw over 100A. However, you can use a function in the FASTLED library to automatically dim the whole strip if your patterns draw over 60A.

With this much current, you will need to connect power at both ends of the strip and at regular intervals along its length. The copper conductors on the strip cannot carry more than a few amps without dropping the voltage and affecting the colours produced. Several large capacitors, e.g. 1000uF should be connected to the strip, where the power is connected.

I set the FPS to 160, then 240 and eventually tried 10000. Seems like it doesn't change anything?

These strips run at a data rate of 800KHz or 800K bits per second. With over 1,800 leds, 1800x24 bits must be sent per frame, 43K bits, so the fastest possible speed will be 17~18 frames per second.

There is a library and a device called something like "octo-ws2812" which can allow you to split your strip into up to 8 sections and send data to each section simultaneously, increasing the frame rate up to 8 times. I'm not sure if that is compatible with Mega.

Another option would be to split your strip into sections and have each section show identical patterns. The identical patterns might not be noticeable with careful selection of patterns. If so, you can send the same data to each section, increasing your frame rate that way.