Neopixel strip behavior with different boards

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Petazeta
 
Posts: 6
Joined: Tue Jun 03, 2014 1:48 pm

Neopixel strip behavior with different boards

Post by Petazeta »

Hi, I have trouble trying to make a Neopixel strip work with Arduino Lilypad (Atmega 168 version).

The wereable project (a dress) is completely built/wired and works fine with Arduino UNO connected to computer and Neopixels powered by a pack of 4 Nmh batteries (4.8V). My objective is to use that 4.8V pack to power both the Lilypad and the neopixels when the dress goes on stage.

In the project, the Neopixel strip has been cut to 50 individual pixels distributed along the dress, connected by AWG24 wire. The code is adapted from your NeoPixel Tiara (I've altered the number of pixels (50 pixels), the colors (to Yellow, White and Purple), and the number of pixels lit per blink)

For space reasons, I wanted to use the Lilypad mentioned above that I have, instead of the UNO, but when I connect the board to computer via FTDI Basic (and neopixels powered by the same battery pack), the led pattern is completely broken: Instead of random blinks in Yellow, White and Purple, I get some Red-Gren-Blue pixels, other completely white, others not lit at all without blink pattern.

I could record with my phone a test on a spare small strip of 5 leftover neopixels I have if you need it (The dress is under Non-Disclosure-Agreement right now and I cannot show it)

I could try to put the UNO on the dress, problem is the 4.8V battery pack seems not enough to power that board, with the circuit not working at all and very dim RX/TX leds on the UNO. Official datasheet recommends 7-12V for UNO. Maybe if I use a 9V battery just for the UNO plus the 4.8V pack for the Neopixels would it work? Problem is space needed for that configuration would be way more than available.

So, back to Lilypad. Do you know any cause of the bad behavior of the code with Lilypad connected to computer? I've not tried using only a battery because I prefer to test things first with boards connected to computer. By the way, the strandtest sample code you provide, works on both boards.

Thanks for your help.

PD: I have a Flora too! But I have not tried it because according to the Neopixels Uberguide the 3.3v Signal is not enough for long strips (and there are some meters of wire on the data signal from pixel 1 to pixel 50, as they are scattered on a long dress)

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Neopixel strip behavior with different boards

Post by Franklin97355 »

Several things to explore. The Lilypad 168 is an 8mhz processor whereas the Uno is 16 mhz. There may be a way to change the timing, you might check in the Sparkfun or lilypadarduino.org sites. You could try powering the Uno from the 5V pin since that is past the regulator but make sure of the polarity and do not exceed 5.5v. Or you could try the Flora, there are several projects using it with neopixels and you won't know if it works or not without trying. Good luck and show us when you can.

Petazeta
 
Posts: 6
Joined: Tue Jun 03, 2014 1:48 pm

Re: Neopixel strip behavior with different boards

Post by Petazeta »

Hi Again, I've tried with Flora and recorded videos with the different behavior of the boards. So far, FLORA shows the same problem that Lilypad had yesterday.

The code is the following for the three boards (Lilypad 168, UNO and Flora):
Taken from this tutorial https://learn.adafruit.com/neopixel-tiara?view=all and altered on the number of pixels and colors as you can see below.

Code: Select all

//Random Flash animation for Neopixel circuits
//by Dano Wall and Becky Stern for Adafruit Industries
//based on the Sparkle Skirt, minus the accelerometer
#include <Adafruit_NeoPixel.h>

#define PIN 1

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(50, PIN, NEO_GRB + NEO_KHZ800);

// Here is where you can put in your favorite colors that will appear!
// just add new {nnn, nnn, nnn}, lines. They will be picked out randomly
//                          R   G   B
uint8_t myColors[][3] = {{232, 100, 255},   // purple
                         {200, 200, 20},   // yellow 
                         {255, 255, 255},   // white
                          };
                               
// don't edit the line below
#define FAVCOLORS sizeof(myColors) / 3

void setup() {
  strip.begin();
  strip.setBrightness(75);
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
flashRandom(3, 10);  // first number is 'wait' delay, shorter num == shorter twinkle
flashRandom(3, 9);  // second number is how many neopixels to simultaneously light up
flashRandom(3, 10);
}
As recommended on Neopixel best practices, I've added a 1000uF, 6,3V Capacitor and a small resistor. I'm using the Flora enabled IDE

Both videos are recorded using Pin 1 of UNO and Flora Respectively, with boards powered by the USB cable and 4.8Nmh battery pack powering the pixels.

As you can see, UNO shows the desired colors (Purple, Yellow, White) but Flora and Lilypad blink on Red-Blue-Green continuously. Strandtest sample code also fails to work properly on the flora with this setup.

Video UNO. 22Mb MP4: http://www.mediafire.com/watch/775z2doy ... 182453.mp4 (desired result, but not enough space on the wearable for UNO board & 9v battery)
Video Flora. 17MB MP4: http://www.mediafire.com/watch/hbkjvm6d ... 182836.mp4 (Bad behavior, like with Lilypad. Notice the continuous RGB flash cycle)
Picture breadboard: http://www.mediafire.com/view/vq65xjzzd ... 183217.jpg

Could you help me fixing this? I have no idea why the pixels are showing wrong random colors.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Neopixel strip behavior with different boards

Post by pburgess »

The Lilypad and Flora are both 8 MHz 3.3V devices. I'm fairly certain this is voltage related...NeoPixels won't correctly respond to a signal that's below 70% of the supply voltage. With a 4.8V battery supply, that puts the 3.3V signal right at the "iffy" level (and freshly-charged NiMHs may have a slightly higher voltage). There's a few things you can try:

- First, take one of the NiMH cells out of the battery holder and jumper across the gap with a piece of wire (so you're running on 3 cells, about 3.6V). Does everything work then? If so, it's definitely voltage related.

You -could- run everything off 3 cells, but this is at the lower end of what the NeoPixels will tolerate, and your colors will be dim (especially blue). Other options:

- Use a small 5V microcontroller board such as the Pro Trinket 16 MHz. Very tiny, but doesn't have the sewable pads of the Flora & Lilypad.

- Use a logic level shifter IC to boost the 3.3V signals from the Flora to the ~4.8V of the NeoPixels. The 74AHCT125 works for this: https://www.adafruit.com/products/1787

- Add a diode in series on the battery pack + output, which will cut the voltage by about 0.7V and should put the NeoPixels within working range of the 3.3V microcontroller. This is only good for about 1A max though (about 16 NeoPixels running full tilt), so it requires your code limit the number and brightness of pixels simultaneously lit.

Petazeta
 
Posts: 6
Joined: Tue Jun 03, 2014 1:48 pm

Re: Neopixel strip behavior with different boards

Post by Petazeta »

pburgess wrote:The Lilypad and Flora are both 8 MHz 3.3V devices. I'm fairly certain this is voltage related...
Thanks for your help. I gave it a try bypassing the USB connection and powering the Flora with the same battery that powers the leds (attaching the + and - of the leds to Vbatt and GND pins on the flora) and everything worked like a charm

:)

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”