Part of my current project involves using led strips (I am using NeoPixels). When using the FastLED library, my programs do not seem to run. I am using pin 6 for the data line of my led strip, and a separate power supply to power the leds. When I run the example code from the FastLED library, nothing seems to happen. I am correctly inputting the right type of strip into the code (WS2812B), and nothing else is changed from the original example code. I find that when I run the blink program, no signal is being sent from pin 6 of my Arduino Nano. I tested it with a multimeter, holding the positive lead to pin 6 and the negative lead to the ground pin, and I read at most 0.3 volts. Is this too low of a voltage to operate the LED strip? If so, is it a problem with the actual arduino? Or could it somehow be a problem with the code? Any help is much appreciated.
#include <FastLED.h>
#define NUM_LEDS 14
#define LED_PIN 6
CRGB leds[NUM_LEDS];
void setup() {
// put your setup code here, to run once:
FastLED.addLeds<WS2812B, LED_PIN>(leds, NUM_LEDS);
}
void loop() {
// put your main code here, to run repeatedly:
leds[1] = CRGB::Blue;
FastLED.show();
delay(1000);
leds[1] = CRGB::Black;
FastLED.show();
delay(1000);
}
Check the version of FastLED library you are using. An issue was reported with one version in another thread recently. Updating to the latest version, or a slightly older version, fixed the problem.
Grumpy_Mike:
Are you measuring the voltage with a meter? If so it will not read the peak value but the average.
Since my original post, I have not been able to get any output voltage from the data pin of the arduino when I measure with my meter.
Grumpy_Mike:
Please post a photograph of your wiring so we can check this.
I don't actually have the LED strip wired to the arduino; I have been troubleshooting to the point where I have nothing connected the arduino except my meter, measuring the voltage of the output pin while running the program. I have the positive meter lead connected to pin 6, and the negative lead connected to ground. No voltage is being registered on the meter.
I also tried using an older version of the library, as well as the NeoPixel library from AdaFruit, neither of which yielded any results.
PaulRB:
Connect an ordinary led and series resistor to pin 6 and run the blink sketch.
If the led does not flash, try a different pin. If other pins will not flash, try a different Arduino.
When running the basic blink sketch a normal led will flash just fine with any pin. It is only while trying to work the LED strip where the pin has no output.
Perhaps there is another sketch I can try that is more similar to that of the FastLED program?
Remove those delays between the turn on and turn off. You will see something like 2.5V if it is working correctly depending on how your meter responds to fast pulses.
Grumpy_Mike:
Remove those delays between the turn on and turn off. You will see something like 2.5V if it is working correctly depending on how your meter responds to fast pulses.
I commented out the delay lines, and the meter reads a constant 0.15 volts while the program is running.
I have wired up the NeoPixel strip exactly as the wiring diagram says, yet nothing is happening. The resistor in the photo is 470 ohm and the capacitor is 1000 uf 16V, as suggested by the AdaFruit Uberguide. The power supply I have wired to the NeoPixel is about 5.3V. I also changed the program to use the D9 pin of the Arduino. Keep in mind that the Nano is also a clone, so the problem still could poosibly be with that.
Grumpy_Mike:
If nothing happens then post a photograph of your setup.
Your code is fine I have run it myself. The only thing you might be surprised at is that the second LED flashes but you might be expecting the first to flash. LEDs are numbered from zero not one.
Do you have the ground of the LED strip connected to the ground of the Arduino?
This is the photograph of the setup (i meant to post it with one of my previous replies). And I wrote the code to activate the second LED because I have wired the LED strip with heat shrink and I made the dumb decision to cover the first LED with it. My ground is connected to both the power supply and the arduino.
Just to troubleshoot further I decided to re solder the leads of the wires onto the LED strip, cutting off the first LED in case it was damaged, and that fixed the problem! Thank you so much to everyone who helped.