# Ws2812b not working

**URL:** <https://forum.arduino.cc/t/ws2812b-not-working/1167006>\
**Category:** General Guidance\
**Created:** [September 10, 2023, 6:13am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006 "2023-09-10T06:13:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 6:13am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/1 "2023-09-10T06:13:26Z")

</div>

Hi..... I recently got my WS2812B LED strip. I am not able to run it. I hove connected the vcc to +5v the gnd to gnd and the data pin to the pin 7 of an arduino nano with a 330 ohm resister in between.  
Code:-

```arduino
#include <FastLED.h>

#define LEDPIN 7
#define NUMOFLEDS 60

CRGB leds[NUMOFLEDS];

void setup() {

  FastLED.addLeds<WS2812, LEDPIN, GRB>(leds, NUMOFLEDS);

}

void loop() {

  for (int i = 0; i <= 9; i++) {
    leds[i] = CRGB ( 0, 0, 255);
    FastLED.show();
    delay(40);
  }
  for (int i = 9; i >= 0; i--) {
    leds[i] = CRGB ( 255, 0, 0);
    FastLED.show();
    delay(40);
  }
}

```

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [September 10, 2023, 6:20am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/2 "2023-09-10T06:20:43Z")

</div>

What sort of Arduino are you using?

Each LED can draw a maximum of 60mA you have 60 LEDs, you can't get that much current from the 5V output of any kind of Arduino. You have to use an external 5V power source, with the negative wire also connected to the Arduino's ground pin.

---

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 6:22am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/3 "2023-09-10T06:22:14Z")

</div>

Arduino Nano

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [September 10, 2023, 6:23am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/4 "2023-09-10T06:23:18Z")

</div>

Show us good images of your wiring.

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [September 10, 2023, 6:27am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/5 "2023-09-10T06:27:17Z")

</div>

> [@Samar2013](#):
>
> Arduino Nano.

What sort of nano, there are seven different types of Nano.

---

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 6:39am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/6 "2023-09-10T06:39:24Z")

</div>

![20230910_115629](https://europe1.discourse-cdn.com/arduino/original/4X/5/6/4/5645ce8de1454a0607c4b252b766da97820f3319.jpeg)

 ![20230910_115618](https://europe1.discourse-cdn.com/arduino/original/4X/7/2/6/726f4183f9f5722a705ce8d257944a4d35c54912.jpeg)

---

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 6:40am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/7 "2023-09-10T06:40:51Z")

</div>

The generic nano with CH430G driver

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [September 10, 2023, 6:45am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/8 "2023-09-10T06:45:58Z")

</div>

- If you upload the blink sketch, does a LED flash on the NANO ?

- Make sure the resistor is making good contact.

---

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 6:47am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/9 "2023-09-10T06:47:14Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [September 10, 2023, 6:48am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/10 "2023-09-10T06:48:39Z")

</div>

- Your code works here.

- Do you have a voltmeter ?

---

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 6:48am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/11 "2023-09-10T06:48:55Z")

</div>

yeah

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [September 10, 2023, 6:50am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/12 "2023-09-10T06:50:04Z")

</div>

- Measure the voltage between 5v and GND **at the LED strip** , what is it.

- just for the heck of it change this to 9 **#define NUMOFLEDS 60**

BTW  
The NANO may be able to power 9 LEDs but 60 will not work, for that you will need an external power supply.

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [September 10, 2023, 6:51am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/13 "2023-09-10T06:51:58Z")

</div>

> [@Samar2013](#):
>
> generic nano with CH430G driver

If it has a CH4030G then it is not a real Arduino it is a clone or a fake Arduino. However this tell me you have a 5V data signal. Many of the different Nano types only produce 3V3 signals that need to be boosted to 5V to get it to work correctly, that is why I was asking.

---

<div class="post-metadata">

**Author:** ![Samar2013](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/samar2013/32/924877_2.png) [@Samar2013](https://forum.arduino.cc/u/Samar2013)\
**Post date:** [September 10, 2023, 7:03am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/14 "2023-09-10T07:03:36Z")

</div>

I found out that the led strip was bad so I replaced it and it worked

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [September 10, 2023, 12:38pm UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/15 "2023-09-10T12:38:29Z")

</div>

> [@Samar2013](#):
>
> the led strip was bad

It may be that you only damaged the first LED on the strip. If you have more time than money, you can look forward to seeing if any part(s) of the bad strip still work.

a7

---

<div class="post-metadata">

**Author:** ![anon76350110](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@anon76350110](https://forum.arduino.cc/u/anon76350110)\
**Post date:** [September 10, 2023, 12:59pm UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/16 "2023-09-10T12:59:29Z")

</div>

> [@Samar2013](#):
>
> ![20230910_115618](https://europe1.discourse-cdn.com/arduino/original/4X/7/2/6/726f4183f9f5722a705ce8d257944a4d35c54912.jpeg)

It would appear by this photo that YOU HAVE IT CONNECTED BACKWARDS

Check the arrows on the LED Strip.

That connector is not used for going towards the power supply  
that connector is used for connecting to other strips  
meaning.... it's an Output, Not an Input

Very common Mistake

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [September 11, 2023, 1:09am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/17 "2023-09-11T01:09:25Z")

</div>

> [@anon76350110](#):
>
> by this photo

- Neopixel +5v \>\> red \>\> connector \>\> green \>\> Nano 5v pin
- Neopixel SIG \>\> green \>\> connector \>\> purple + resistor \>\> white \>\> Nano D7
- Neopixel GND \>\> white \>\> connector \>\> black \>\> Nano GND pin  
 ![both](https://europe1.discourse-cdn.com/arduino/original/4X/b/e/8/be87ac73fcf84c3dea21e541f1d3b5bfbc253052.png)  
I think it is good.

---

<div class="post-metadata">

**Author:** ![anon76350110](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@anon76350110](https://forum.arduino.cc/u/anon76350110)\
**Post date:** [September 11, 2023, 1:42am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/18 "2023-09-11T01:42:29Z")

</div>

> [@xfpd](#):
>
> I think it is good.

To know if it's good the markings on the PCB Strip must be checked, current must flow in the direction of the arrows.  
this connector is usually at the opposite end of the strip so as to allow interconnection to the next strip which is why it's a common mistake to connect to it

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [September 11, 2023, 2:43am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/19 "2023-09-11T02:43:34Z")

</div>

> [@anon76350110](#):
>
> markings on the PCB Strip

Yes, now I see how the Nano output is likely hooked to the Output end of the Pixel strip.

 ![arrow](https://europe1.discourse-cdn.com/arduino/original/4X/1/3/9/139b5970088d2814905d010a9a1ae108f2bc720e.jpeg)

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [September 11, 2023, 5:53am UTC](https://forum.arduino.cc/t/ws2812b-not-working/1167006/20 "2023-09-11T05:53:37Z")

</div>

> [@anon76350110](#):
>
> current must flow in the direction of the arrows.

No.  
The data signal must flow in the directions of the arrow, not the current.

[Next page](https://forum.arduino.cc/t/ws2812b-not-working/1167006.md?page=2)
