0

I’m trying to get a WS2815 LED strip working with an Arduino Nano ESP32, but I can’t get it to light up. The strange thing is that with an Arduino UNO, using the exact same circuit and sketch, everything works perfectly.

Here’s my setup:

  • The WS2815 LED strip is powered by 12 V. I’m using a DC-DC converter to step down to 5 V, which powers both the Arduino Nano ESP32 and a SN74AHCT125N buffer.

  • The data signal goes from pin 2 of the Arduino through the buffer (to shift from 3.3 V to 5 V) and then to the D pin of the WS2815 strip.

  • All GNDs (Arduino, DC-DC converter, LED strip, and buffer) are connected together. I’m using the FastLED library.

  • I tested the buffer: when I apply a fixed 3.3 V input, I get 5 V output, so the level shifting seems to be working correctly.

The problem is that when I upload the sketch to the Nano ESP32, the LEDs stay completely off. With the Arduino UNO, the exact same code and wiring work perfectly.

I also noticed that during the compilation and upload process in the Arduino IDE, it shows “Done uploading”, but I suspect the code might not be running correctly on the ESP32, or the compilation may not be fully compatible.

What is causing the problem?

    #include <FastLED.h>
    
    #define NUM_LEDS 79
    #define DATA_PIN 2
    
    CRGB leds[NUM_LEDS];
    
    void setup() {
      FastLED.addLeds<WS2815, DATA_PIN, GRB>(leds, NUM_LEDS);
      FastLED.setBrightness(180);
    }
    
    void loop() {
      fill_solid(leds, NUM_LEDS, CRGB::Red);
      FastLED.show();
      delay(1000);
    
      fill_solid(leds, NUM_LEDS, CRGB::Blue);
      FastLED.show();
      delay(1000);
    
      fill_solid(leds, NUM_LEDS, CRGB::Green);
      FastLED.show();
      delay(1000);
    }

IDE Screenshot IDE Screenshot

Arduino Nano ESP32 Circuit Arduino Nano ESP32 Circuit

Arduino UNO Circuit Arduino UNO Circuit

6
  • I wanted to update this thread and thank everyone who offered suggestions. I finally found the solution! Thanks again for all the help! I'm posting this solution here in case anyone else runs into this same frustrating problem. Commented Nov 13 at 11:46
  • 1
    please do not post a picture of text unless absolutely necessary ... copy and paste the IDE output ... format as code for readability Commented Nov 13 at 17:32
  • OK. What was the solution? Commented Nov 13 at 18:09
  • 1
    please write an answer below ... the solution does not belong in the question body Commented Nov 14 at 15:42
  • I solved the issue with the Arduino Nano ESP32. It wasn't the wiring, but a pin mapping problem in the Arduino IDE. The fix involved two steps: IDE: Change the setting in Tools > Pin Numbering to "By GPIO number (legacy)". (The default "By Arduino pin" was the issue). Code: Update the pin definition to use the GPIO name (e.g., change #define DATA_PIN 2 to #define DATA_PIN D2). After these changes, the LED strip worked. It seems libraries like FastLED require this "legacy" numbering on the ESP32. Commented Nov 14 at 20:31

1 Answer 1

1

Since the OP hasnt posted the answer and Question closure may occur, I am copying it over.

I solved the issue with the Arduino Nano ESP32. It wasn't the wiring, but a pin mapping problem in the Arduino IDE. The fix involved two steps:

  1. IDE: Change the setting in Tools > Pin Numbering to "By GPIO number (legacy)". (The default "By Arduino pin" was the issue).
  2. Code: Update the pin definition to use the GPIO name (e.g., change #define DATA_PIN 2 to #define DATA_PIN D2).

After these changes, the LED strip worked. It seems libraries like FastLED require this "legacy" numbering on the ESP32.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.