No luck with Neopixel projects

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

No luck with Neopixel projects

Post by AirBubblesCosplay »

These past few weeks have really burned me out. I haven't had such bad luck with any previous projects...
I made a circuit a few weeks ago wired just like this circuit:

https://learn.adafruit.com/breath-of-th ... it-diagram

I had put on a code to make it flicker like fire and it was working. I hadn't put the switch on just yet but I am also using a slide switch like the above circuit. I was sticking the prongs into the slots they would be later soldered into. Everything is work fine. I put the project aside for a few weeks. I come back to it realizing I need to add another strip. I soldered the strips together, modify the code to add the additional 60 pixels. Now it will not turn on. The lights on the Trinket board turn on, but the lights on the JST board are dimmer (with my battery, if hooked up to the wall they are brighter). I cut the strips apart thinking that was the problem. No dice. My original circuit no longer works either. Same thing happensHere is the code I am using:

Code: Select all

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIN 4

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

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 – 500 Ohm resistor on first pixel’s data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit…if you must, connect GND first.

void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code

strip.begin();
strip.show(); // Initialize all pixels to ‘off’
}

void loop() {
int r = 255;
int g = 96;
int b = 12;

for(int x = 0; x <30; x++)
{
int flicker = random(0,40);
int r1 = r-flicker;
int g1 = g-flicker;
int b1 = b-flicker;
if(g1<0) g1=0;
if(r1<0) r1=0;
if(b1<0) b1=0;
strip.setPixelColor(x,r1,g1, b1);
}
strip.show();
delay(random(50,150));
}

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

Re: No luck with Neopixel projects

Post by Franklin97355 »

Could you post large (less than 1 meg), clear, detailed pictures of both sides of your board showing any soldering you have done and the connections to it?

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

franklin97355 wrote:Could you post large (less than 1 meg), clear, detailed pictures of both sides of your board showing any soldering you have done and the connections to it?
Just to reiterate, the circuit had previously worked. The only thing that changed was adding wires for my button. That was it. The circuit was working perfectly fine.
Attachments
IMG_2500.jpg
IMG_2500.jpg (72.63 KiB) Viewed 453 times
IMG_2501.jpg
IMG_2501.jpg (78.71 KiB) Viewed 453 times
IMG_2502.jpg
IMG_2502.jpg (57.42 KiB) Viewed 453 times

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

franklin97355 wrote:Could you post large (less than 1 meg), clear, detailed pictures of both sides of your board showing any soldering you have done and the connections to it?
Attachments
IMG_2499.jpg
IMG_2499.jpg (112.89 KiB) Viewed 453 times

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

I uploaded a test code and it just sits idle with very low light red lights. It's supposed to do a color wipe but it just sits with red. Maybe you can see where something went wrong but since it worked the last time I touched it, I have no clue.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: No luck with Neopixel projects

Post by adafruit_support_mike »

What are you using as a power source? 60 additional pixels can use up to 3.6A of additional current. Even dropping that to 1/3 the worst-case value, which we've found is a decent rule of thumb, they'd want around 1A.

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

I cut off the additional 60. I can’t get my original working circuit to work properly. I was powering by USB through the wall and computer for testing purposes.

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

Update:
I broke down the circuit and then eventually I just removed the strip from the board and tried another board. I was able to get the neopixel test code to run properly. (I've pretty much accepted that something happened to the other board and it is no longer working properly... I swear I've been rougher on my boards and these last few weeks have been ridiculous. No beginner would be able to solder anything if these things are this fragile). Now the issue I am having is placing my old code back. I uploaded two different codes that have worked for me before on multiple neopixel projects. I first tired the one listed above, the pixels just stayed an orange color and did not flicker or do anything to look like fire. The second code is one I've used on rings in the past with great success. It should change the colors from yellow to orange to red slowly. The strip just stayed orange and did not shift colors. Is there something I'm missing strips need in a code that rings don't? Here is the code I am leaning towards now:

Code: Select all

#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(60, PIN, NEO_GRB + NEO_KHZ800);
 
void setup() {
  strip.begin();
  strip.setBrightness(30); //adjust brightness here
  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(16);
  rainbowCycle(16);
}
 
// 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);
  }
}

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: No luck with Neopixel projects

Post by adafruit_support_mike »

There's no electrical difference between NeoPixel strips and NeoPixel rings. The components all have the same connections.

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: No luck with Neopixel projects

Post by kcl1s »

It would be good to see an overall wiring photo including the neopixel connections.

Best I can tell from the photos you are powering the neopixels with BAT connection on the charger. With no lipo battery I don't see how that would work and with a battery the most you will get is about 4.2 v

I believe BAT+ on the Trinket is IN only.

Another thing is you are using the backpack with a 5 v Trinket. The docs say it can work but will be under-powered.

I would go back to the basics and just hook your neopixels to the Trinket only using the USB pin for power.

Fellow hobbyist
Keith

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

kcl1s wrote:It would be good to see an overall wiring photo including the neopixel connections.

Best I can tell from the photos you are powering the neopixels with BAT connection on the charger. With no lipo battery I don't see how that would work and with a battery the most you will get is about 4.2 v

I believe BAT+ on the Trinket is IN only.

Another thing is you are using the backpack with a 5 v Trinket. The docs say it can work but will be under-powered.

I would go back to the basics and just hook your neopixels to the Trinket only using the USB pin for power.

Fellow hobbyist
Keith
Heyo. To add info to somethings, I was using a Lipo battery. In my very first post I followed the circuit diagram for the zelda sword to a T. I used the same battery and products. The thing WAS working. I soldered in the wire for my switch, then it stopped. The Lipo battery I was hoping to use was this one: https://www.adafruit.com/product/1781

Same one the guy uses in his circuit. I've attached the image of the circuit below. Note... the circuit was working with the above battery and all that jazz.

I tried another board and got the test code to work. Awesome. But once, I try and attach the code I want to use (in my previous post) the strip does not do what it's supposed to do. I just hooked everything up with alligator clips the way you suggested. Positive into USB, Data to Pin #1, Ground to ground. and not the strip just flashes bright white for a second and shuts off. The USB power I am using is a USB portable battery says the following to be as exact as possible:

Input= 5V
Output=5V
Capacity= 2000mAh/3.6V (7.2Wh)

At this point nothing is soldered together anymore because I tried so many different things I ended up just tearing the whole circuit apart. The above happens with alligator clips. I'll attach photos below of how it is hooked up now for testing.
Attachments
IMG_6728.JPG
IMG_6728.JPG (769.45 KiB) Viewed 360 times
leds_circuit-diagram.jpg
leds_circuit-diagram.jpg (383.11 KiB) Viewed 360 times

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

I feel real dumb. I rechecked the pinouts and #1 does not work for USB. It is now #4. Things are happening. Little wonky but it's probably the bad connection with the alligator clips. I think that's a step in the right direction. I'm heading to a friends to do some prop work but I will try soldering this tonight.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: No luck with Neopixel projects

Post by adafruit_support_mike »

Don't beat yourself up over it.. we all make those kinds of mistakes, and more often than most of us really like to admit. ;-)

One of the best things you can do is keep a notebook while you're working on projects, and when anything goes wrong, write it down. If the solution ends up being one of those maddeningly simple things (oh yeah, I pulled the jumper and only one side of the breadboard had power) write that down too, and spend a couple minutes thinking of reasonable things you could have done to prevent that error (wire a power LED on both halves of the breadboard).

We never stop making mistakes. The trick is to try to avoid making the same mistake over and over.

User avatar
AirBubblesCosplay
 
Posts: 71
Joined: Sat Nov 28, 2015 5:02 am

Re: No luck with Neopixel projects

Post by AirBubblesCosplay »

Yeah that’s a good idea. Unfortunately I still cannot get any code to work properly. And I still have no idea what made my circuit stop working in the first place. I have less than a week to figure it out =\

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: No luck with Neopixel projects

Post by adafruit_support_mike »

When in doubt, stop and back out to the last known working configuration.

It's easier to make progress starting from a system that works, making a small tweak, getting that to work, then making another tweak. The number of possible problems increases with the sqare of the number of interacting parts. If you have more than three or four unknown pieces, there's a good chance that you'll get two or more problems that feed into each other, and that's just a nightmare. A typo in one section can cause problems somewhere else.

Stubbing in new functions with Serial.print() statements, building separate toy programs that demo the next feature you want to add before trying to knit it into the main code, and relentless testing every step of the way makes it easier to advance.

I begin every program with some equivalent to "hello, world.", either printing it out or lighting an LED. It's a sanity check I can use to make sure the basic system works, and takes a couple of minutes. Then I can build the system's output using hardcoded values, since that's easiest to test, and then I can use the output system to debug code that generates output values. Roughing in the overall structure of the code that way usually takes less than an hour, and I know everything works at that level when I start adding specific features.

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

Return to “General Project help”