1

I am using Adafruit Neopixel Library to work with a strand of 21 RGB LEDs. AT this point only the first 16 light up. It is not a soldering problem, battery issue or a short. This troubleshooting page suggests to

"confirm that the number of LEDs in the LPD8806() constructor match the number of LEDs in the strip (both will be 32 if using the strandtest example and a single meter of LEDs)."

But looking at the library code below, I am not certain where to modify. Adafruit_Neopixel master zip has 2 files, which contain source code. One is Adafruit_Neopixel.cpp and the other Adafruit_Neopixel.h.

Thank you.

3
  • It is not a soldering problem, battery issue or a short. You're driving this thing off a battery? How many Amps is your power supply?
    – aaa
    Commented Mar 25, 2016 at 7:20
  • @Paul 2000mAh at 3.7V Lipo battery
    – ksenia
    Commented Mar 25, 2016 at 7:32
  • Do you have a link/datasheet? Or do you know the "C" rating? And do you have a voltage/multi-meter?
    – aaa
    Commented Mar 25, 2016 at 7:42

3 Answers 3

5

When something works, but not completely, it's often due to power issues.

Embedded things, microcontrollers/Arduino are fairly robust and "logical". Hence, if your Arduino program works today, it'll work tomorrow.

Analog devices, or electricity is (in my eyes) often a bit vague. A chip can get enough power to run, but not enough to work properly.

The NeoPixel

Adafruit has an extremely elaborated tutorial/userguide.

Powering the NeoPixels

This also seems to fit your problem.

enter image description here

You could try powering the strip from the middle. Since your voltage isn't stable, your amperage might not be as high and the resistance may be a little big. It's actually quite impressive that it works.

Each NeoPixel can draw up to 60 milliamps at full brightness.

2000mAh does not mean it can (always) deliver 2000mA. It depends on the "C" or discharge rating of the battery. So if your battery is rated 0.5 C it'll only be able to supply 1000mA (for 2 hours).

60*21 would be well over 1000mA, actually 60*16 is just below 1mA, so this would fit your problem.

The voltage of a battery depends on how much charge it has.

Check google for: "LiPo voltage drop"

If all else fails

There is a chance that that particular LED is broken. The signal will not continue to the other LED's and thus the light of the strip will end there. Try to drive the LED's behind the LED that fails. (With the power supply closer).

I'm also not sure if you can supply 3.7V and then use 5V logic. Things like that would often break a microcontroller (when running on 3.3V, you usually can't receive 5V?)

6
  • This is a good answer. I have a strip of 300 NeoPixels, and sending "pure white" to them, the other end has gone yellow. And this is with a power supply that should cope with the current requirements. Your 21 pixels, at full brightness, and consuming 60 mA would need 1.26 amps. Are you powering them from a separate power supply? One with that capacity?
    – Nick Gammon
    Commented Mar 25, 2016 at 8:38
  • @NickGammon according to the comment in the main question he's powering 21 LED's off a "2000mAh at 3.7V Lipo battery" but he hasn't yet specified the maximal discharge rate/current (which might be below 2000mA).
    – aaa
    Commented Mar 25, 2016 at 8:43
  • See my amended reply. 3.7V is a little low for the specs.
    – Nick Gammon
    Commented Mar 25, 2016 at 10:43
  • @NickGammon Good point, if you check Li-Po discharge curves, it would also mean that the battery has to have 20%> charge since the voltage drops when you have less charge. But apart from that it should work, Adafruit itself states that it is possible for wearable projects — a 3.7 Volt lithium-polymer battery. (Adafruit Neopixel Uberguide)
    – aaa
    Commented Mar 25, 2016 at 10:53
  • @NickGammon the discharge rate for the battery is 2C. Here is the spec for the battery solarbotics.com/product/battr15
    – ksenia
    Commented Mar 25, 2016 at 15:22
3

You don't modify the library at all. The page refers to the constructor which is the last line here:

#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

So that would send to 60 NeoPixels. Change the 60 to however-many you have.

To compare, try running my library here. That doesn't use the Adafruit library. Use the minimal demo code, and change PIXELS to be 21.

#include <SPI.h>
#include <NeoPixels_SPI.h>

const unsigned int PIXELS = 8; // Number of pixels in the string

void setup ()
  {
  ledsetup();
  showColor (PIXELS, 0xB2, 0x22, 0x22);  // firebrick
  } // end of setup

void loop ()
  {
  } // end of loop

Note that you connect the NeoPixels data to pin D11 of your Uno in this case.


@Paul 2000mAh at 3.7V Lipo battery


according to the comment in the main question he's powering 21 LED's off a "2000mAh at 3.7V Lipo battery"

Yes, well let's look at the specs:

WS2812 specs

If you lose 0.2V over the first 8 LEDs you are under spec for the voltage.

2
  • I did change the num of PIXELS to 21 in every example in your library and still only 16 light up. any thoughts, suggestions?
    – ksenia
    Commented Mar 25, 2016 at 7:17
  • Maybe that particular LED is broken. Try if you can power/test the LED's after LED 16.
    – aaa
    Commented Mar 25, 2016 at 7:22
0

With most led strips you can supply power from both ends if you are experiencing voltage drop.

You can do this with two separate power supply units if you don't have one unit that is capable of powering the entire strip.

I'm not sure if power is your entire problem, but if it is you could try this solution.

If it's a problem with the Neopixel library You could also try the excellent FastLED library and see if that helps you sort out your issues.

1
  • Could you expand upon your answer a little, and explain why it might help? Even though your answer may be correct, unfortunately, as it stands, your answer has been flagged for "its length and content" and may be deleted. Commented Mar 26, 2016 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.