Arduino Nano esp32 with WS2812B LEDs

I'm trying to run this project but I am running into an issue (Arduino Nano ESP32 - NeoPixel LED Strip | Arduino Nano ESP32 Tutorial). The lights do not turn on. I used an arduino uno and was able to turn the lights on but once swapped over the the arduino nano esp32 I cannot. I have the project setup identically to the tutorial, not sure what I am missing...


This how-to

seems to be missing from the IDE 2.x category where you posted. It might help you.

The NeoPixel LED Strip specifies a 5 volt logic level to work. The 3.3 volts of the esp32 may or may not work. In your case try a level shifter and see if that helps.

Unfortunately is works often enough that there are a lot of bad posts that infer it will work.:slightly_frowning_face:

I am using an external power supply of 5V.

Yes, but the voltage of that green wire that connects the Nano ESP32 board to the LED strip is 3.3 V. This is the problem.

The Arduino board is communicating with the LED strip by sending pulses of electricity. These pulses are the binary control signals which tell the brains of each LED what it should do. When the Nano ESP32 board wants to send a binary 0 to the LED brain, it sets the pin to 0 V. When the Nano ESP32 board wants to send a binary 1 to the LED brain, it sets the pin to 3.3 V. This is known as the "logic level". When the LED strip is powered at 5 V, 3.3 V is below the minimum rated voltage which the LED brain considers to be a binary 1.

A logic level shifter takes the 3.3 V signals from the Nano ESP32 and converts it to 5 V signals that the LED brain can recognize.

There is some additional information here:

As on alternative, reduce that to 4.7V (if you have adjustable power supply).

I tried 4.5 Volts, still nothing.

Then your problem is different.
LED-strip can draw several amps of current, depending on number of LEDs. It's not ok to use breadboard to power it.
Wire your black and red directly to power supply screw connector, with one additional black for common GND.

Since it's such a short distance and only 6 LEDs why wouldn't 3.3 V work? Feels like the esp32 isn't sending any data.

Same issue when wired directly. Could this be an issue with the esp32?

Since it's such a short distance and only 6 LEDs why wouldn't 3.3 V work? Feels like the esp32 isn't sending any data.

So direct 4.5V supply, common ground, 6 LEDs?
If you don't get anything out, time to post your code (using code tags).

Here is the latest config with the code.


``

void setup() {
  NeoPixel.begin();  // initialize NeoPixel strip object (REQUIRED)
}
void loop() {
  NeoPixel.clear();  // set all pixel colors to 'off'. It only takes effect if pixels.show() is called

  // turn pixels to green one-by-one with delay between each pixel
  for (int pixel = 0; pixel < NUM_PIXELS; pixel++) {           // for each pixel
    NeoPixel.setPixelColor(pixel, NeoPixel.Color(0, 255, 0));  // it only takes effect if pixels.show() is called
    NeoPixel.show();                                           // update to the NeoPixel Led Strip

    delay(500);  // 500ms pause between each pixel
  }

  // turn off all pixels for two seconds
  NeoPixel.clear();
  NeoPixel.show();  // update to the NeoPixel Led Strip
  delay(2000);      // 2 seconds off time

  // turn on all pixels to red at the same time for two seconds
  for (int pixel = 0; pixel < NUM_PIXELS; pixel++) {           // for each pixel
    NeoPixel.setPixelColor(pixel, NeoPixel.Color(255, 0, 0));  // it only takes effect if pixels.show() is called
  }
  NeoPixel.show();  // update to the NeoPixel Led Strip
  delay(1000);      // 1 second on time

  // turn off all pixels for one seconds
  NeoPixel.clear();
  NeoPixel.show();  // update to the NeoPixel Led Strip
  delay(1000);      // 1 second off time
}

@jjyep101 try this with the code from post 1, the tutorial code. Keep the wiring the same.

Change #define PIN_NEO_PIXEL D2 // The Arduino Nano ESP32 pin connected to NeoPixel
To #define PIN_NEO_PIXEL 5 // The Arduino Nano ESP32 pin connected to NeoPixel

Now before you download this modified code go to the Tools menu and change
"Pin Numbering: By Arduino pin"
To
"Pin Numbering: By GPIO number"

1 Like