Hey guys, Wondering if anyone has any experience with APA104?

Hey guys,

Wondering if anyone has any experience with APA104? Just wondering if I’m stupid, my LEDs are faulty or it’s just a glitch as they’re in beta with FASTled still I think.

My leds are not doing what I’d expect at all, when I use the code below to make one white led travel the wire it does so but the rest of the leds flash random colours on and off. After that I tried just flashing one LED red (after making the code GRB rather than RGB) it’s red but it flashes kind of yellow as well and the next led sometimes comes on and just kind of stays on.

My copy of the first light code that is flashing randomly:

#include “FastLED.h”

///////////////////////////////////////////////////////////////////////////////////////////
//
// Move a white dot along the strip of leds. This program simply shows how to configure the leds,
// and then how to turn a single pixel white and then off, moving down the line of pixels.
//

// How many leds are in the strip?
#define NUM_LEDS 150

// Data pin that led data will be written out over
#define DATA_PIN 2

// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define CLOCK_PIN 8

// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];

// This function sets up the ledsand tells the controller about them
void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(2000);

  FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);

}

// This function runs over and over, and is where you do the magic to light
// your leds.
void loop() {
// Move a single white led
for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
// Turn our current led on to white, then show the leds
leds[whiteLed] = CRGB::White;

  // Show the leds (only one of which is set to white, from above)
  FastLED.show();

  // Wait a little bit
  delay(100);

  // Turn our current led back to black for the next loop around
  leds[whiteLed] = CRGB::Black;

}
}

Ohh and in case it is relevant my LED strip is connected to a dedicated 5v 4.2A power supply and the data signal is coming from an Uno (pin 2)

Hmmm, I haven’t used APA104, but here’s some thoughts.

Did you try it with just a few pixels?
#define NUM_LEDS 8

Do you have a resistor (200-470 ohm range) between the output pin on the UNO and the data input on the LED strip?

Have you measured the voltage at the start and also at end of strip?

What is the UNO being powered by, and on what pin?

Marc, even when set to one pixel that pixel tends to flicker a strange colour intermittently and the signal bleeds into the next pixel eventually lighting it up the colour I told the software to light the first.
The pixels on the strip all have their own resistor built into the strip (I assume it is on the power line not the data) but no I don’t have a resistor on the data line between the strip and the arduino, I can test that when I get home, in all my reading I haven’t come across that suggestion before :).
I’ll measure the voltages when I get home.

Andrew, The uno is just powered by the USB port I’m using to program it, but that could never handle the current needed for the strip so I have the strips power connected to the power supply I mentioned in my first question.

Thanks for your support guys :).

Forgot to ask if you have ground of the UNO and your separate 5v 4.2A power supply tied together? The grounds must be connected between the two otherwise wackyness will ensue.

… I knew I’d forgotten something, no I don’t hahaha, that might be it! I’ll try that too when I get back.

Thanks guys, it was the ground line facepalm

It’s an easy one to forget. But now you’ll know right away next time. :slight_smile: And thankfully it’s an easy fix.