Help with Arduino Nano ESP32 and WS2812B LEDs

Hello! This is my first electronics project with Arduino, I am just trying to get an LED to light up with Ada Fruit Neopixel. I checked that voltage is going to the LED..Here is my code:

*#include <Adafruit_NeoPixel.h>*

*#define PIN_WS2812B D2*
*#define NUM_PIXELS 1*

*Adafruit_NeoPixel WS2812B(NUM_PIXELS, PIN_WS2812B, NEO_GRB + NEO_KHZ800);*

*void setup() {*
*  WS2812B.begin();*
*}*

*void loop() {*
*  WS2812B.setPixelColor(0, WS2812B.Color(255, 0, 0));*
*  WS2812B.setBrightness(100);*
*  WS2812B.show();*
*  delay(500);*
*  WS2812B.setPixelColor(0, WS2812B.Color(0, 0, 0));*
*  WS2812B.show();*
*  delay(500);*
*}*

Thank you everyone : ))) <3

Please post a wiring DIAGRAM that shows all your connections.

Are you connecting the red wire to VIN? Or to +5V?

What are all these stars( * ) in the code?

The only thing I see hooked up to the red power rail is a red wire going to the LED. Did you mean to hook up power to that rail?

1 Like

Looks like the whole code is commented out.

Regardless, keep in mind that the nano esp32 uses 3.3v logic levels and the ws2812b requires 5v logic levels to work properly and reliably.

1 Like

Okay I tried to draw it out!

So you really don't have any power going to the red rail to power the LED. That's not going to work, is it?

1 Like

I was told just the Arduino had enough voltage to power at least one LED :sleepy_face: I even checked that it had 5Vs going into the LED wires

Which part of "you don't have anything connected to the LED's power pin" aren't you getting?

No Arduino is going to power anything if you don't connect power from the Arduino to it.

1 Like

I can't see in your photo where D2 is connected to anything, and the yellow wire that should go there appears to just disappear.

Is in fact the physical wiring IDENTICAL to the hand drawing? Ifg it is, connect the red rail to the NANO 5V out pin.

1 Like

NOT voltage, current. You need to start at the beginning and understand electricity. OHMS law and Kirchovs laws are a good place to start. Then consider connecting wires.
This will get you started
8-kirchhoffs-laws.pdf (4.0 MB)
Here are some web sites
LINK
LINK
The best learning aid for OHMS law is the Falstad simulator.
Here is LINK but you can also download it but it will have a weird name, just rename it something like Falstad.

you're strangely weird for reacting like this trying to teach someone :rofl: thanks anyway dude

Thank you for this!!! <3

You were told at least 3 times that you didn't have power connected to the LED. You react strangely for someone asking for help and then not responding to questions asked of you or listening to answers provided. I'll waste no more time here.

1 Like

Disagree: You were told 4 times directly that the LED was not connected to 5V. In case you are completely unaware, 5V is needed for power, and the 3.3V from D2 is a logic input to turn on the LED. Think of it this way: the missing 5V is like a motor in the car, and the 3.3V logic is the driver.
Now do you get it?
You are totally unprepared for even this simple circuit. Get a copy of the Arduino Cookbook and read it cover to cover.
Maybe get Electronics Cookbook first.

From a communication standpoint, you offering resources for someone to understand the full basic picture of the missing piece in a patient way was more helpful than the way the other replies were coming in with attitude. So in actuality, you @sonofcy had the perfect response. However, now...

I was warned this forum had a tone for people being completely rude for beginners to ask questions but had hopes that was biased-

This convo completely proved it :joy:

You were ASKED a question re power 4 times over 2 days thus wasting the time of at least 3 VOLUNTEERS and you think you are the injured party?

The majority of volunteers on here are much older than the average person asking questions. Perhaps unfortunatly we older types have a different (to say the least) code of behaviour. We learned at an early age to take responsibility and be humble when quizzing our mentors. Sadly it appears that the newer generation thinks they should be treated with kid gloves and they are quick to blame everyone but themselves.

You probably don't know that there are settings in our profiles that allow us to deal with this, so that is where I am headed.

Hi! Welcome to the Forum.

I don’t like people leaving the Forum with this impression. So, let’s try one more time.

The picture of your circuit in post #1 and the figure in post #6 shows your LED connected to 3 wires:

  • Black wire, connected to the breadboard (-) rail and to the Nano GND image
  • Yellow wire, connected to the 470r resistor and to D2 pin of the Nano image
  • Red wire, connected to the (+) rail of the breadboard, which is not connected to anything else. image

That means whatever voltage you say that is going to the circuit is not coming from where it should be.

Considering that the board is connected to the USB, the pin VUSB will provide 5V and enough current to drive one LED. So, to fix the electronic part of your project , it’s enough to connect another wire between the (+) rail of the breadboard and VUSB pin of the Nano.

PS:

1 Like

Your code works (blinks a WS2812 on pin "D2" RED), but you need to drive the WS2812 with the proper voltage. So Some WS2812 require 12VDC, some 5VDC.

In post #18 I'm assuming the OP's LED is 5V and that the red/yellow/black wires are soldered to the correct LED pins… :nerd_face: