Using the internal LED of ESP32-C3 Super Mini

Hi Folks,
i hope, i am in the right category.

I have some ESP32-C3 Super Mini from Ali.
https://de.aliexpress.com/item/1005006829779961.html?spm=a2g0o.order_list.order_list_main.11.1cf95c5fEpMmuo&gatewayAdapt=glo2deu

According to this Thread

the internal LED is attached to PIN8. Unfortunately i cant get any of my three boards to work with the Blink Sketch. All other pins described on the picture work fine. I only use the USB Connector as power source.
Does somebody have an idea why the LED isnt working?

Best regards

The diagram shows LED B connected to chip pin GPIO8
image

but confusing, I also see this

image
so I don't know what to make of it

1. This is the location of onBoard LED (Blue color) on my ESP32C3 Super Mini Board (Fig-1). The LED is found connected at GPIO-8 as proved by the sketch of Step-2.

ESP32C3SuperMiniBoardPic-2
Figure-11:

2. Uplaod the following sketch with these parameters in IDE 2.2.1.
IDE 2.2.1
Board: "LOLIN C3 Mini"
Port: "COM6" (TAMC Termod S3)
USB CDC on Boot: "Enabled"
Upload Speed: 921600

#define LED_BUILTIN 8
char myData[20];

void setup() 
{
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() 
{
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);    
  byte n = Serial.available();
  if (n != 0)
  {
    byte m = Serial.readBytesUntil('\n', myData, sizeof (myData)-1);
    myData[m] = '\0';
    Serial.println(myData);
  }
  Serial.println("Hello");
}

3. Check that onBoard LED is blinking at 2-sec interval.
4. Check that you can communicate with the InputBox/OutputBox of the Serial Monitor.

Note:
Use DVM in sond mode to check the coninuity between cathode-pin of the onBoard LED and every GPIO of the Board to find which GPIO is actually connected with the onBoard LED of your Board.

1 Like

I think i`ve found the reason for not working. It seems, that the LED is soldered in the wrong direction. On all of my three boards a little arrow on the LED points to the pins.
On this photo


the LED is soldered in the other direction, the arrow points towards the controller.

Crap...

You must verify it using DVM in sound mode.

The Picture with the pink solder Mask is taken from here:

Its not my board. On my board the LED is definitely reverse mounted

Hi everyone,

I'm working with an ESP32-C3 Super Mini, and I've noticed an interesting behavior with the onboard LED. The LED is connected to GPIO 8, and I observed that it turns off when I set the GPIO to High and turns on when I set it to Low.

This inverted logic seems a common design choice in ESP32 boards, particularly for onboard LEDs. It allows the microcontroller to sink current rather than source it, which can be more efficient and provides better control over the LED's brightness.

GolamMostafa´s code works perfectly for me, but I have to invert High/Low as I mentioned.


1 Like

Better use MakerGO ESP32 C3 SuperMini

1 Like

Often the LEDs are attached to so called strapping pins which condition the boot behaviour and these pins generally have to be high at boot time so they [the LEDs] are wired on the high side, that is LOW = ON.

It works if you set the LED to off. Basically off = on and on = off. Weird. The only reason I didn't return mine is because I thought "maybe what if I set it to off" and it actually turned on.

I am using "off" and "on" because I am programming in MicroPython, I do not completely understand C++ yet. By "off = on" and "on = off" I mean "off is HIGH" and "on is LOW".

But you are not setting the LED to off by setting its pin to LOW. Because of the way this LED is connected LOW is on and HIGH is off

In a similar vein, if you arrange a switch to take a pin LOW when closed and use INPUT_PULLUP in pinMode() then you can determine that the switch is closed by detecting the LOW state on the pin. I assume that you think that is wrong too

Apologies for my lack of clarity. I am at the core a MicroPython user thus I did not exactly understand the LOWs and HIGHs. I've updated my findings to make more sense.

As a matter of interest, how would you turn the LED of this board on using MicroPython ?

You can use .value(0) or .off()

from machine import Pin
LED = Pin(8, Pin.OUT)
LED.value(0) # First method
LED.off() # Second method

Whether those commands turn the LED on or off depends on how the LED is wired

You have previously said

Not weird at all because of how the LED is wired
image

Interesting...
I have done a few PCB designs for a few projects, but never have I seen an LED without a dedicated ground pin like that. I've only seen GPIO --> LED --> Resistor --> GND or GPIO --> Resistor --> LED --> GND.
In this case, I believe the GPIO acts like a ground since it is basically set to 0V when in the LOW state? But it has a voltage by default, thus not completing the circuit in the HIGH state?

Humans tend to think of HIGH meaning on and LOW meaning off but that has no meaning to the LED. It turns on when current flows through it whatever the source. All that matters is that there is a source of current

Yeah, that's exactly the reason why it seems odd at first. But when you think about it, it's all about the current's flow and the pins' wiring setup.

I am from an older generation, but we use to sink the current to the chip IO pin most of the time

Guys, I used pin 15, and everything worked perfectly.