Theory Question About Pull Down Resistors

Thread Starter

jblake416

Joined Apr 9, 2026
16
Hello all. I have a generic theoretical question about pull down resistors and GPIO pins. If I had a microcontroller pin configured as an output, which is then connected to an LED and current limiting resistor (something low, like 100 ohms for example), when compiling and code the pin will float and the LED will flicker during this process. To correct this, I know the general solution is to connect a high value resistor (such as 10K) between the pin and ground, so that it holds the pin low until the compilation process has completed. When the pin is eventually driven high through code, the current will flow through the LED as the path of least resistance. My question is, why does the stray voltage produced while the pin is floating also still not go through the LED, as it would have less resistance than the pull-down resistor. Thanks.
 

Ian0

Joined Aug 7, 2020
13,256
Hello all. I have a generic theoretical question about pull down resistors and GPIO pins. If I had a microcontroller pin configured as an output, which is then connected to an LED and current limiting resistor (something low, like 100 ohms for example), when compiling and code the pin will float and the LED will flicker during this process. To correct this, I know the general solution is to connect a high value resistor (such as 10K) between the pin and ground, so that it holds the pin low until the compilation process has completed. When the pin is eventually driven high through code, the current will flow through the LED as the path of least resistance. My question is, why does the stray voltage produced while the pin is floating also still not go through the LED, as it would have less resistance than the pull-down resistor. Thanks.
Are you sure that your microcontroller does not have pull-UP resistors which are enabled by default at power up? (Quite a lot do).
If so you can avoid the LED flash by connecting the LED between the pin and the positive supply.
 

BobTPH

Joined Jun 5, 2013
11,638
If I had a microcontroller pin configured as an output, which is then connected to an LED and current limiting resistor (something low, like 100 ohms for example), when compiling and code the pin will float and the LED will flicker during this process
Have you observed this, or are you theorizing? A floating pin should not produce enough current to drive an LED on.
 

Thread Starter

jblake416

Joined Apr 9, 2026
16
Are you sure that your microcontroller does not have pull-UP resistors which are enabled by default at power up? (Quite a lot do).
If so you can avoid the LED flash by connecting the LED between the pin and the positive supply.
I'm using an ESP32, which has pullups which can be enabled through code, but it's happening during the compile process, so code isn't running yet.
 

Thread Starter

jblake416

Joined Apr 9, 2026
16

ronsimpson

Joined Oct 7, 2019
4,798
Please tell us what computer and which pin. I have a project where certain pins tell us how the bootup is going. Many people put LEDs on these pins. Fortuny, I have relays connected to two pins that toggle during bootup.
 

BobTPH

Joined Jun 5, 2013
11,638
Please tell us what computer and which pin. I have a project where certain pins tell us how the bootup is going. Many people put LEDs on these pins. Fortuny, I have relays connected to two pins that toggle during bootup.
What tools are you using? Compilation of programs foe embedded processors generally take place on a different system and don’t even meed the target board connected.

Please describe your “compilation” workflow and where in the process you are seeing this flickering.
 

Thread Starter

jblake416

Joined Apr 9, 2026
16
hi jb,
Is the flickering causing any problems on the compiled code result?


E
No, once it's compiled it functions normally. Once the project is finished though the LED will be replaced with a relay and I'm concerned that there could be the same effect happening while in use, and I don't want it inadvertently activating the relay randomly. So, I'd like to ensure it's pulled low at all times until the pin is set HIGH through code.
 
I think two different things are being mixed together here.

The compilation happens on the computer, so it cannot directly affect the ESP32 pins. The LED is more likely flickering while the program is being uploaded, when the ESP32 resets, or while its boot code is running.

Also, current does not only take the path with the lowest resistance; it divides between all available paths. When the GPIO is truly floating, only a very small leakage or noise current is available. The 10k resistor is normally enough to hold the pin close to ground, so the LED does not reach its forward voltage.

However, if the ESP32 boot code actively drives or toggles that pin, a pull-down resistor may not stop the flicker. Some ESP32 pins have boot, strapping or serial functions, so the exact GPIO number and ESP32 board would be useful. Choosing a different GPIO may be the easiest fix.
 
Top