1
\$\begingroup\$

I am trying to use my ESP32-S3-DevKitC-1 microcontroller to power RGB addressable LEDs via the ESP-IDF 5.5 Command Prompt, but I am not able to power on the LEDs. I have tested the microcontroller with the sample Hello World project and it worked fine. The microcontroller is connected to my laptop via a USB A to USB micro B cable.

The information about the microcontroller is hyperlinked above, but for reference, I am currently connecting the ESP-32 5V power supply (orange wire) from 24J to the right + rail, the ESP-32 Ground (green wire) from 44A to the right - rail, and the ESP-32 GPIO4 (yellow wire) from 41J to 55A. I have connected 1 330 ohm resistor from 55E to 55F. The LED's 5V (red wire) is connected to the right + rail, the LED's Ground (black wire) is connected to the right - rail, and the LED's Din is connected to 55J.

I am new to circuits, so any help would be appreciated.

Edit: This has the pins on the dev board and the datasheet: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-devkitc-1/user_guide_v1.1.html. The LED strip is a 5V WS2812B Addressable RGB LED Strip. I have used it once before with a different microcontroller and it has successfully lit up, but I tested that this ESP32-S3 works. By "power on" I'm just trying to get my code to light up the LED. "Din" is "Data in". The datasheet for the LEDs is here: https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf. I pushed the board between 23 B-I and 44B-I. The ESP32-S3 pins diagram is below.

Diagram

Current Circuit

My code is attached below for reference. There are no errors when building and running it through the ESP-IDF 5.5 Command Prompt.

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "led_strip.h"
#include "led_strip_rmt.h"

#define LED_GPIO    4      // DIN pin on your strip
#define LED_COUNT   30     // <-- set this to how many pixels you connected

static const char *TAG = "ws2812_demo";

void app_main(void)
{
    // ---- LED strip config ----
    led_strip_config_t strip_config = {
        .strip_gpio_num = LED_GPIO,
        .max_leds       = LED_COUNT,
        // Most WS2812 use GRB byte order:
        .led_pixel_format = LED_PIXEL_FORMAT_GRB,     // if your headers support it
        .led_model        = LED_MODEL_WS2812,         // ditto
        .flags.invert_out = false,
    };

    // ---- RMT backend config ----
    led_strip_rmt_config_t rmt_config = {
        .clk_src           = RMT_CLK_SRC_DEFAULT,
        .resolution_hz     = 10 * 1000 * 1000,  // 10 MHz is fine
        .mem_block_symbols = 64,
        .flags.with_dma    = false,
    };

    led_strip_handle_t strip = NULL;
    ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &strip));
    ESP_LOGI(TAG, "LED strip created");

    // Clear start
    ESP_ERROR_CHECK(led_strip_clear(strip));
    vTaskDelay(pdMS_TO_TICKS(50));

    while (1) {
        // Fill RED
        for (int i = 0; i < LED_COUNT; i++) led_strip_set_pixel(strip, i, 255, 0, 0);
        led_strip_refresh(strip);
        vTaskDelay(pdMS_TO_TICKS(500));

        // Fill GREEN
        for (int i = 0; i < LED_COUNT; i++) led_strip_set_pixel(strip, i, 0, 255, 0);
        led_strip_refresh(strip);
        vTaskDelay(pdMS_TO_TICKS(500));

        // Fill BLUE
        for (int i = 0; i < LED_COUNT; i++) led_strip_set_pixel(strip, i, 0, 0, 255);
        led_strip_refresh(strip);
        vTaskDelay(pdMS_TO_TICKS(500));

        // Chase ORANGE down the strip (simple “ripple”)
        for (int k = 0; k < LED_COUNT; k++) {
            for (int i = 0; i < LED_COUNT; i++) led_strip_set_pixel(strip, i, 0, 0, 0);
            led_strip_set_pixel(strip, k, 255, 80, 0);
            led_strip_refresh(strip);
            vTaskDelay(pdMS_TO_TICKS(30));
        }

        // Off
        led_strip_clear(strip);
        vTaskDelay(pdMS_TO_TICKS(300));
    }
}
\$\endgroup\$
8
  • \$\begingroup\$ What do you mean unable to power the LED strip? So is there 5V supply on the LED strip or is it missing? Also, it is difficult to see if the resistor is on the same rows with yellow and white data wires. It is also unknown if the LED data protocol is correct for that strip or if the data voltage is incompatible. \$\endgroup\$ Commented Sep 29 at 10:12
  • \$\begingroup\$ tad, You need to provide information about the LED strip to get a meaningful answer to your questions. Is there a data sheet to which you can provide a link? If not, you must provide whatever you know about the LED strip, and/or describe any testing or evaluation you have done on it. E.g. What is the function of Din? \$\endgroup\$ Commented Sep 29 at 10:28
  • 1
    \$\begingroup\$ "I have connected 1 330 ohm resistor from 55E to 55F." doesn't really help at all, what we need to know is the pins on the devboard. The breadboard pins are random depending on where you happened to push the board in. \$\endgroup\$ Commented Sep 29 at 10:32
  • \$\begingroup\$ It's hard to tell if you have wired it correctly, and while addressable LEDs usually work with a 3.3v GPIO, they don't always. I would load WLED or some other known working software and see if the LED responds. If not, you have an electric problem. If it does, you have a software bug. \$\endgroup\$ Commented Sep 29 at 14:34
  • \$\begingroup\$ This has the pins on the dev board and the datasheet: docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/…. The LED strip is a 5V WS2812B Addressable RGB LED Strip. I have used it once before with a different microcontroller and it has successfully lit up, but I tested that this ESP32-S3 works. By "power on" I'm just trying to get my code to light up the LED. "Din" is "Data in". The datasheet for the LEDs is here: cdn-shop.adafruit.com/datasheets/WS2812B.pdf. Please let me know if you need any more info, sorry if it is confusing. \$\endgroup\$ Commented Sep 29 at 15:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.