Trying to control an LED strip

Hey everyone!

I purchased a WS2812B LED strip to use with an Arduino. However, for some reason, I can't get it to work and it's behaving strangely. When I wire it correctly (5V -> 5V, Data pin -> pin 7, GND -> GND), it simply refuses to turn on. I measured the voltage (5V) and current (70mA) if anyone finds it helpful.

When I disconnect the ground pin, the first LED in the strip lights up blue. I cannot get any other result out of the strip.

Here's how I was initially wiring it:

And here's an image without the GND pin connected:

My code if it matters:

#include <FastLED.h>

#define LED_PIN 7
#define NUM_LEDS 4

CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}

void loop() {
  leds[0] = CRGB(255, 255, 255); // changing this 0 or the RGB color does nothing
  FastLED.show();
  delay(500);  
}

How many LEDs does your strip have?

How did you measure these 70mA? With the LEDs on?

Are you powering the LED strip with the 5V output from the Arduino UNO?

This output can only supply a few mAs, nothing that would make an LED strip light up.

Use an external source to power the 5V of the strip,
and don't forget to connect the Gnd of this source to the Arduino's Gnd.

Read this topic: "Measuring Current Draw from LED ring (WS2812B) - #14 by ScottC

Each LED
image

My strip has 144 LEDs. I measured the current draw with all LEDs off as I can't seem to get them to turn on (except the first one when ground is not connected). I have tried an external supply consisting of four AA batteries in series but it didn't do much of anything.

Interesting development... I tried connecting my signal wire to my arduino 5V and the 5V wire to my arduino's signal pin, and the first LED turned bright white. However, I can't change the color or which LED lights up at all. I disconnected this because I don't think I should send 5V thru the signal pin.

I then tried the same on an external 6V power supply (LED strip 5V -> Arduino Signal Pin, LED strip signal pin -> External PSU 6V) and it turned bright red instead.

I think this means my arduino may be bad since it seems like I'm able to control the color based on voltage somehow.

The current with the LED off is very different from the current with it on.
4 x 1.5V batteries are also not able to provide the current you need.
I use a 5V 2A source to light my 30 LED strip.
Read the link I posted and you will understand better.

ohmy.

You want to connect Arduino to LED strip like this:

Arduino SIG ----- SIG LED
Arduino GND ----- GND LED

PWRSPLY GND ----- GND LED
PWRSPLY VCC ----- VCC LED

144 x 0.06A = 8.64 Amps. (That's "worst case" with all LEDs at full-brightness white.)

If you don't need the whole strip for your final project, consider cutting a short strip of 5 or 10 for experimentation and project development. You can even leave the short strip connected along with a longer strip as long as you have enough current capacity.

Even if youneed all 144, you might want to buy a shorter strip to "play with".

If you are using batteries, note that the amp-hour rating is an energy or "life" rating but it still can be a reasonable guideline. i.e. A 1A-hr battery can supply 1 Amp for one hour or 100mA for 10 hours, at which point the voltage will be down to 70 or 80 percent of it's rated voltage. An alkaline AA battery is rated for less than 1Ahr so for 8A, forgetaboutit.

Batteries in series increase the voltage but not the current capability.

But there are no 5V batteries so you generally need a higher voltage and a voltage regulator.

Be careful! The datasheet says 3.5 to 5.3V so you might fry the chips in the LED strip with excess voltage.

Adafruit has TONS of information, including power them.

If you are using the full-length of the strip there is a voltage drop across the tiny conductors in the strip. The more LEDs that are on (more current) and the farther down the strip (more resistance in the conductors) the more voltage is lost. The LEDs will dim the farther you get from the power and the LEDs near the far-end may not work at all. Adafruit recommends "injecting" power about every meter.

Solved! It turns out I was connected to the wrong side of the LED strip... :man_facepalming:

Thanks so much to all that tried to help!

Everyone is kicking themselves now... The answer was right there in the first post:

I think you may need to use the Adafruit Neopixal software/sketch, that what I did, but I was only driving 24-36 5050 leds of the type you mention, so it even worked on batteris...

Never say this again.......It Always Matters
4 things Always

  • The Code
  • The Schematic
  • Explain your goal
  • Explain the Problem
  • What you did so far

So

  1. Why are you using the powerjack and USB Together ?
    2, Why did you connect to those white Connectore.......
    CHECK THE DIRECTION OF THE ARROWS ON THE STRIP
    Your strip is addressable meaning
  • it needs power, Correctly Polarized to work
  • also the protocol demands Data flow in a forward direction

Re this..
leds [0] means its the first pixel
to add more pixels to light up you do this
So if you have 4 you want to light up...

leds[0] = CRGB (255,255,255);
leds[1] = CRGB (255,255,255);
leds[2] = CRGB (255,255,255);
leds[3] = CRGB (255,255,255);

if it does nothing

  • Put a scope probe on the data line (you should see data packets)
  • Put a scope probe on the voltage rails

what do you get??

And... i see i was correct
no kidding i see this mistake everytime.
Those white connectors get people all the time

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.