Arduino and LPD8806 (48/m) LED strip lighting up but randomly

Hi all,

I’ve just received a 5m strip of LEDs (LPD8806, 48 LEDs per metre) and hooked it up to an Arduino Uno R3. I thought it would then be a case of simply uploading the longstrandtest examples to get the thing started.

Unfortunately, it wasn’t that simple! :blush:

When I turn it on, part of the strip lights up and starts flashing different colours rapidly and randomly, part of it lights up but doesn’t really change colour, and the rest is off. If I pull the wires out of the Arduino, the whole strip lights up white, so I know the strip isn’t faulty.

I’m guessing it’s due to the code perhaps being intended for the Adafruit strips which are 32/m instead of 48. So I tried to change references to the length I could find in LPD8806.cpp and change them to 48, but that’s not worked either. (and I’ve made sure I’ve set the number of leds in the .pde to 240).

I’m not really sure what else to do now to try get it working properly! :blush: I’ve never really worked with Arduino or LED strips before, so I may be missing something really obvious, but I’d be grateful for any help/guidance! =(

Info on setup: Arduino Uno R3 with yellow wire connected to pin 3, and green to pin 2 (swapping these doesn’t help). Arduino powered via laptop USB for the time being. Strip powered by 5V 10A DC. Red and black wires from LED strip are connected to the power accordingly.

You have no ground connected from the power supply to the Arduino. This is required. You also did not give us any indication of what software, library, or code you're using. This is also required.

Please read How to use this forum for more information.

Thanks for the reply - I was actually planning on picking up a wire tomorrow to connect it (and also connect Arduino to the PSU), was hoping it wasn't needed whilst I was powering via USB :sweat_smile:

The code I'm using is from Adafruit, just the basic example longstrandtest with the only modification being the number of LEDs at the start of the script.

Use a paperclip if you have to, anything. You need ground connected together across all devices.

Honestly, you're not the first person I've seen having issues with that library. That's not to say that it's bad, because I know it works - I have used it myself. But I have moved away from bitbanging and using SPI for much faster data transfers. Search for 'FastSPI' and use that code instead with the SPI port, instead of bitbanging like you are now.

Just tried a paperclip - didn't work at first (think it's a bit thick), but then when I managed to hold it in a certain position, looks like it behaves as expected! That'll teach me to cut corners...

Thanks again for your quick help with this, even though it turned out to be a basic mistake on my side! I'll look into FastSPI too though and give it a shot :)