Time-sensitive! Help!

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
Webs
 
Posts: 3
Joined: Sat Oct 26, 2013 12:53 pm

Time-sensitive! Help!

Post by Webs »

So, I've built this: http://learn.adafruit.com/superhero-pow ... t/build-it

I have Arduino installed and running with all the Adafruit extras and the Gemma blink test worked as expected.

However, now when I upload the strandtest, all I get is one LED on the NeoPixel ring constantly lit at what seems to be maximum pinkish white(?) brightness. Looking at the back (non LED side) of the NeoPixel ring, the one LED that lights up is the one directly clockwise from the Data Out connection.

Strandtest:

Code: Select all

#include <Adafruit_NeoPixel.h>

#define PIN 6

// 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(60, PIN, NEO_GRB + NEO_KHZ800);

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

void loop() {
  // Some example procedures showing how to display to the pixels:
  colorWipe(strip.Color(255, 0, 0), 50); // Red
  colorWipe(strip.Color(0, 255, 0), 50); // Green
  colorWipe(strip.Color(0, 0, 255), 50); // Blue
  rainbow(20);
  rainbowCycle(20);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}
When I upload the Powerplant code, the entire NeoPixel ring and the central Flora light up blue, but they flicker rapidly and randomly(?) instead of pulse as they are supposed to.

Powerplant code:

Code: Select all

//Superhero Power Plant
//fades all pixels subtly
//code by Tony Sherwood for Adafruit Industries

#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(17, PIN, NEO_GRB + NEO_KHZ800);

int alpha; // Current value of the pixels
int dir = 1; // Direction of the pixels... 1 = getting brighter, 0 = getting dimmer
int flip; // Randomly flip the direction every once in a while
int minAlpha = 25; // Min value of brightness
int maxAlpha = 100; // Max value of brightness
int alphaDelta = 5; // Delta of brightness between times through the loop

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

void loop() {
  flip = random(32);
  if(flip > 20) {
    dir = 1 - dir;
  }
  // Some example procedures showing how to display to the pixels:
  if (dir == 1) {
    alpha += alphaDelta;
  }
  if (dir == 0) {
    alpha -= alphaDelta;
  }
  if (alpha < minAlpha) {
    alpha = minAlpha;
    dir = 1;
  }
  if (alpha > maxAlpha) {
    alpha = maxAlpha;
    dir = 0;
  }
  // Change the line below to alter the color of the lights
  // The numbers represent the Red, Green, and Blue values
  // of the lights, as a value between 0(off) and 1(max brightness)
  //
  // EX:
  // colorWipe(strip.Color(alpha, 0, alpha/2)); // Pink
  colorWipe(strip.Color(0, 0, alpha)); // Blue
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
  }
}
I am convinced that I have installed Arduino and the extras correctly, and that I built the hardware correctly. The only thing I can think of that might be a problem is if the Flora I used is a version one instead of a version two. I have no idea how I would tell the difference or how to fix that if it is the problem.

Can anybody help by tonight? Please?
Last edited by Webs on Sat Oct 26, 2013 3:01 pm, edited 1 time in total.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Time-sensitive! Help!

Post by adafruit_support_rick »

Webs wrote:The only thing I can think of that might be a problem is if the Flora I used is a version one instead of a version two. I have no idea how I would tell the difference or how to fix that if it is the problem.
Are you referring to these lines:

Code: Select all

//   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)
The v1 and v2 refer to the NeoPixels, not to the Flora. There was an older (now discontinued) Flora NeoPixel. The Ring is a NeoPixel V2 device
Webs wrote:However, now when I upload the strandtest, all I get is one LED on the NeoPixel ring constantly lit at what seems to be maximum brightness. Looking at the back (non LED side) of the NeoPixel ring, the one LED that lights up is the one directly clockwise from the Data Out connection.
That may indicate a wiring problem. Please post clear, detailed pictures of the connections between the Gemma and the ring.

Webs
 
Posts: 3
Joined: Sat Oct 26, 2013 12:53 pm

Re: Time-sensitive! Help!

Post by Webs »

I colour-coded the wires to make this clearer. I used the same colours as the circuit diagram here: http://learn.adafruit.com/superhero-pow ... it-diagram
circuit.jpg
circuit.jpg (552.97 KiB) Viewed 581 times

Webs
 
Posts: 3
Joined: Sat Oct 26, 2013 12:53 pm

Re: Time-sensitive! Help!

Post by Webs »

It's a v2 Flora Neopixel. It says so right on it. Duh.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Time-sensitive! Help!

Post by adafruit_support_rick »

Thanks for the color-coding - that actually helps a lot!

Well, the wiring looks OK. But what you describe still sounds like a connection problem. The solders on the ring and NeoPixel look like they might be a little iffy. I'd re-flow all of your solders, including the ones on the Gemma, and add more solder. Make sure to heat both the wire and the pad The solder should flow up the wire and across the pad. A good solder joint looks like this - the surface is concave and shiny.
Solder%20Joint.gif
Solder%20Joint.gif (7.78 KiB) Viewed 563 times
We have a nice tutorial on soldering - you might want to have a look:
http://learn.adafruit.com/adafruit-guid ... ring/tools

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

Re: Time-sensitive! Help!

Post by pburgess »

In the strandtest sketch, first change the pin number to 1:

Code: Select all

#define PIN 1
Select "Gemma 8 MHz" from the Board menu and upload. Any improvement?

mmwjohnston
 
Posts: 6
Joined: Thu Apr 03, 2014 1:47 pm

Re: Time-sensitive! Help!

Post by mmwjohnston »

Did this ever get resolved? I'm having the same issue here. I have everything soldered up and the code loaded. When I turn on power, a couple of the neo-pixels blink (random every time) on then off. Then, all the pixels turn on at once (not in a cool pattern like the video in the tutorial) and change brightness very rapidly. So much so it's painful to look at. I will double check my solder connections soon, but I was wondering if this chain got resolved.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Time-sensitive! Help!

Post by adafruit_support_rick »

@mmwjohnston: that sounds like a completely different problem. Please post pictures of your assembly and soldering.

mmwjohnston
 
Posts: 6
Joined: Thu Apr 03, 2014 1:47 pm

Re: Time-sensitive! Help!

Post by mmwjohnston »

@adafruit_support_rick: I will post some images and maybe a video later today. Thanks for the reply.

mmwjohnston
 
Posts: 6
Joined: Thu Apr 03, 2014 1:47 pm

Re: Time-sensitive! Help!

Post by mmwjohnston »

Okay here are my images and a video.
Image
Image
Image
Image
Image
Image
Image

Video: https://dl.dropboxusercontent.com/u/170 ... 9%20PM.mov

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

Re: Time-sensitive! Help!

Post by pburgess »

I think this may be related to the higher threshold voltage seen on the latest batches of NeoPixels. Reducing the battery voltage might clear this up. Here's some things to try:

- If you have some NiMH or NiCd rechargeables, try those in the battery pack instead of alkaline cells (~3.6V instead of ~4.5).
- If by chance you have one of our small JST-equipped 3.7V LiPo batteries from another project, test using that.
- Add a diode (such as a common 1N4001) in series on the + wire from the battery pack, which will drop the output voltage slightly (~3.8V instead of ~4.5).

Please let me know if that addresses the problem. If so, we might need to adjust some of our tutorials.

mmwjohnston
 
Posts: 6
Joined: Thu Apr 03, 2014 1:47 pm

Re: Time-sensitive! Help!

Post by mmwjohnston »

Sorry for the delay in response. I built this for PAX East and just got back. I came up with a solution and the Arc Reactor worked great.

@pburgress, I don't have any of those batter packs or power supplies (yet) so I couldn't just try them out. I also didn't have a diode either. I do have very nice adjustable power supplies and a diode at work. I'm going to try them today and see if that helps.

What I did do in the mean time is add a delay to the for loop that writes the current color to the LEDs.

Code: Select all

// Fill the dots one after the other with a color
void colorWipe(uint32_t c) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(15);
  }
}
This slowed down the pulsing and I had to adjust the delay to get it right, but it did work. I also changed how the flip direction worked so that the light pattern would go brightest to dimmest every time and back (basically removed the random). I kind of like it a little better.

Here is the code for that:

Code: Select all

//Superhero Power Plant
//fades all pixels subtly
//code by Tony Sherwood for Adafruit Industries

#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(17, PIN, NEO_GRB + NEO_KHZ800);


int dir = 1; // Direction of the pixels... 1 = getting brighter, 0 = getting dimmer
int flip; // Randomly flip the direction every once in a while
int minAlpha = 25; // Min value of brightness
int maxAlpha = 100; // Max value of brightness
int alphaDelta = 5; // Delta of brightness between times through the loop
int alpha = minAlpha + alphaDelta; // Current value of the pixels

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

void loop() {
  // Some example procedures showing how to display to the pixels:
  if (dir == 1) {
    alpha += alphaDelta;
  }
  if (dir == 0) {
    alpha -= alphaDelta;
  }
  if (alpha < minAlpha) {
    alpha = minAlpha;
    dir = 1;
  }
  if (alpha > maxAlpha) {
    alpha = maxAlpha;
    dir = 0;
  }
  // Change the line below to alter the color of the lights
  // The numbers represent the Red, Green, and Blue values
  // of the lights, as a value between 0(off) and 1(max brightness)
  //
  // EX:
  //colorWipe(strip.Color(alpha, 0, alpha/2)); // Pink
  colorWipe(strip.Color(0, 0, alpha)); // Blue
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(15);
  }
}
I'll let you know about the voltages later today or tomorrow.

mmwjohnston
 
Posts: 6
Joined: Thu Apr 03, 2014 1:47 pm

Re: Time-sensitive! Help!

Post by mmwjohnston »

@pburgess,

I just hooked up the arc reactor with the original code to a HP adjustable power supply. I varied the voltages from 4.5 to as low as 2.9 V. While the brightness of the arc reactor did change the flickering did not. So I don't think it's a voltage problem. Honestly, I'm not really sure what the problem is but the code I published in the previous updated did seem to help. Let me know if I can do anything else to help this tutorial.

I think you all did a great job and I really like how it turned out. My friends were so impressed they want me to make some for them as well so I might get additional versions and see what happens. Thanks again for doing so much for the electronics community.

Also, I wanted to post that I used https://www.ponoko.com/ to get my laser cut acrylic. They took the design you had on Thing verse and submitting it was really easy, and not too expensive.

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

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