neo pixel is just blue

Hi !

I’m trying to make a through-hole neopixel work. Just one! No big ambitions anymore. :disappointed_relieved:

I’m working with an arduino nano.

First i thought the breadboard isn’t good for data transmission. I soldered the A6 to the DATA IN pin, to be sure. I get just blue light.

It somehow worked once or twice (and the color changed), but then it went back to just blue. I use the most simple sketch from Adafruit, that is also called ‘simple’, which makes it even worse. (commented out lines etc)

What else can be the problem? (not my soldering skills i hope… :o ).

Because we have no idea what you have done.

No perfectly focussed photograph of your assembly.

No revelation of the code you are using, posted according to the instructions.

So the problem is still that the NEOpixel does not respond but stays blue…

I attached a photo of my setup.

Here is the code i use:

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

#define PIN 6

#define NUMPIXELS 1

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {

pixels.begin();
}
void loop() {

pixels.setPixelColor(0, pixels.Color(0,150,150));

pixels.show();

delay (500);

pixels.setPixelColor(0, pixels.Color(100,15,150));

pixels.show();

delay (500);

}

262d47007c46f88db10a2f6de78b4aa23bc84933.jpg

OK, now before we go further.

Go and read the instructions, then go back and modify your post (use the “More → Modify” option to the bottom right of the post) to mark up the code as such so we can examine it conveniently and accurately.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

Now what we really want is a perfectly focused photograph of your set-up with all wires clearly visible as they terminate on the modules and show that as a link in the text, not an attachment.

The best way to do this is to take it outside in full daylight but not direct sun and use a digital camera at least a metre away from directly above (or very slightly offset to ensure all the connections are able to be distinguished) using the (actual) zoom to just include all parts of the assembly.

Hi Paul,

Relax man. It's just a hobby. (-;

I'm sorry i didn't follow every instruction.

take care!

OK, so you don't want help with this. Fair enough.

What was your purpose in coming here?

Hi Remzo,
I just worked out a scetch that fades through RGB colors. Perhaps you will like it.

/**
Scetch ColorFade is a color fade routine for Adafruit Neo-Pixels
to be run on the Arduino Uno development platform. Colors transition
through green, aqua, blue, violet, red, orange, yellow. Change define
values to suit output pin (PIN) number of Neo-Pixels (PIXEL_NUM)
and delay interval (DELAY_TIME).
@author Mike Tonge
@date 032316
*/
// Required header (Adafruit_Neopixel_Master library)
#include <Adafruit_NeoPixel.h>
// Definitions (change to suit)
#define PIN            6 // Data output pin (Arduino)
#define PIXEL_NUM      2 // Number of Neo-Pixels in series
#define DELAY_TIME   100 // Delay value (miliseconds)
// Setup the NeoPixel library, tell it how many pixels, and which pin to use to send data.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(PIXEL_NUM, PIN, NEO_GRB + NEO_KHZ800);
// Variable declarations
int redVal; // Red value
int greenVal; // Green value
int blueVal; // Blue value
int pixelIndex; // Loop counter to address pixels in series
// Run once
void setup() {
  pixels.begin(); // Initialize the NeoPixel library.
  Serial.begin(9600); // Serial monitor used for diagnostics
} // End setup
// Main method (non-terminating) loop
void loop() { // Begin 'main' loop
  for (int i = 0; i <= 765; i = i + 5) { // Loop counter 'i' used to set RGB values
    // Red off, Green down, Blue up
    if (i < 255) { // If 'i' is less than 255
      redVal = 0; // Red is off
      greenVal = 255 - i; // Green decreases as 'i' increases
      blueVal = i; // Blue increases as 'i' increases
    }
    // Red up, Green off, Blue down
    if (i > 255) { // If 'i' is greater than 255
      redVal = i - 255; // Red increases as 'i' increases
      greenVal = 0; // Green is off
      blueVal = 510 - i; // Blue decreases as 'i' increases
    }
    // Red down, Green up, Blue off
    if (i > 510) { // If 'i' is greater than 510
      redVal = 765 - i; // Red decreases as 'i' increases
      greenVal = i - 510; // Green increases as 'i' increases
      blueVal = 0; // Blue is off
    }
    // Loop address each Neo-Pixel and updates RGB values
    for (pixelIndex = 0; pixelIndex < PIXEL_NUM; pixelIndex++) {
      pixels.setPixelColor(pixelIndex, pixels.Color(redVal, greenVal, blueVal));
      pixels.show(); // Send the updated RGB values to pixel
    }// End 'for' loop
    delay(DELAY_TIME); // Loop delay interval

    // Diagnostic output to Serial Monitor
    /**
    Serial.print(i);
    Serial.print(" , ");
    Serial.print(redVal);
    Serial.print(" , ");
    Serial.print(greenVal);
    Serial.print(" , ");
    Serial.print(blueVal);
    Serial.println();
    */
  }// End 'for' loop
}// End 'main' loop

Also, read the NeoPixel Uberguide available on Adafruit.

I did like it a lot, thanks!

I showed on the Serial Monitor that everything works. This pretty much rules out problems with the Arduino board or sketch.

But... the light stays blue..

So now it is:

  • my soldering (which would be bad for my ego)

  • the light itself (but is its blue and when i pull the ground + 5V wires a bit it flashes to red, so it kind of works)

  • using the wrong legs on the light ( very very bad for my ego because i checked and checked en even changed it once..)

So now it is between an unsolved mystery that only happens to me or ... some shamefull mistake...

keep you posted. [/list]

Hi Remzo,
The Adafruit Neopixel Uberguide suggests using a 470 ohm resister before the data input, and a 1000uf capasitor across power and ground. Read the Basic Connections section for a diagram. Link to the Uberguide:

You are sooo right!!

I even bought that resistor but it somehow disappeared in the process. I'll try and find it back.

Also... I'm playing with Neopixel flora chips. You seem to be using the through hole Neopixel without a decoupling capacitor. The guide states - With through-hole NeoPixels (5mm or 8mm), add a 0.1 μF capacitor between the + and – pins of EACH PIXEL. Individual pixels may misbehave without this “decoupling cap.”

Hi Remzo,

I could not see your photo. I do know this about the through-the-hole NeoPixels: when power is applied and no data is sent or "seen" by the LED, it lights up blue.

That being said, you need to make sure that you have the correct pin with the resistor on it.

If you look at the LED, you have 4 leads and on one side there is a flat spot on the LED case itself. From the flat side you have Data OUT, GND, +5v, Data IN.

Remzo: I'm working with an arduino nano.

First i thought the breadboard isn't good for data transmission. I soldered the A6 to the DATA IN pin, to be sure. I get just blue light.

Is that PIN6 or the A06 pin? That makes a BIG difference in your sketch to be able to tell the NeoPixel library which pin you are sending the data to. the A6 pin in ANALOG 6 which needs to be set into OUTPUT mode.

In your sketch you are sending the data to DIGITAL 6.

So you have verified that the sketch is working but I believe the problem is you are sending the data to the wrong pin.

Try connecting the D6 pin to the Data IN on the NeoPixel and see what happens. One note of caution: Try not to short the power on the LED or any of the data pins because you can blow the pixel. These types do not have reverse voltage protection. I found that out the hard way! One actually exploded!

If you connect the data to Data OUT instead of Data IN, it is very unlikely that you will damage the pixel.

Also check the line where you initially setup the NeoPixel string.

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

You will find that red and green are reversed with these guys. So change NEO_GRB to NEO_RGB to get your colors to mix the way they should. It is not a defect with the LEDs, I think they are internally wired that way.

If after all that it still does not change, try another LED. It might just be a bad connection from the Data IN inside the LED. I had a couple that were like that without me soldering them and Adafruit helped me out.

Let us know how that goes!

You are quite correct there - in the absence of an actual connection - or being connected to the wrong pin which is essentially the same thing as an unused pin on the Arduino simply floats - random fluctuations from environmental electric fields tend to be interpreted as a command for "blue" - noting that it is the third (or is it the first?) in the command byte sequence.

Unfortunately Remzo lost interest in providing sufficient information to permit his layout to be adequately inspected, else we might have been able to sort it out earlier. :roll_eyes:

I have a bunch of these myself and unlike the SMD types and the actual WS2811 chips that I also have, these look like a regular RGB LED in the shape and pin layout. When you apply power to even a string of them, they all light up blue when power is first applied. So even using them in a project, they all are blue at power up and stay that way until you "clear" them. Its just the way these work.

:D

For lighting a single NeoPixel it works fine with only the data and 5v wires connected. Data stays low most of the time, so it seems to be as good as a ground. ☺

I discovered this accidentally but seems very reliable.

That sound like an extremely bad idea! :astonished:

Dear forum members and smart people.

Here is the shamefull moment we've all been waiting for!

I was hesitating if adding a capacitator and resistor would make so much difference. Of course it is better/more safe, but just for testing i must be able to see some colors, no?

Then i read dmilton2004 (i hope you are not 12, are you?) about the pins. So to clarify for everyone: the board has two pin number 6. D6 and A6.

:-* :kissing: :roll_eyes: 8)

in another project i just used the analogue pins as digital, numbered them 12,13,14 etc and never thought about pin numbers since.

Sooo, thanks again.

Hi Remzo,

LOL I am not 12, not for a VERY long time. :D

Use D6 which is pin 6. I know that using the NeoPixel library I did not need to set the pin mode. It does that for you.

All the projects that I am using NeoPixels with are being driven by an ATTiny85 so I use pin 0 on the ATTiny. But on my UNO I use Pin 6 which is D6.

Glad to help! :)

dmilton2004: When you apply power to even a string of them, they all light up blue when power is first applied. So even using them in a project, they all are blue at power up and stay that way until you "clear" them. Its just the way these work.

My APA106 LEDs act the same. Anyone ever tried a pull-up or -down to prevent a floating data pin during initialization?

Yes, I daresay they have (47k pull-down would be fine) and it is entirely sensible if you have a problem - but - if you actually connect them to the pin to which the code accesses, then the first call to the display routine will promptly set them correctly.