Input_pullup not working properly

Good morning everyone,

I have a quick question about the use of a input_pullup setting.

The board that i have is a ESP32-WROOM-32 and i am using GPIO-35, not connecting it to anything at the moment.

Programming the Input as INPUT_PULLUP and making a simple if like so;

void setup() {
  pinMode(35, INPUT_PULLUP); // Declaring Arduino Pin as an Input
} 
 
void loop() {

if(digitalRead(35) == LOW)
  {
    Serial.println("LOW");
  }

}

But, when nothing is connected to the input, it is still printing LOW (as it is activated somehow).
When connecting it to 5v, it stops printing LOW.
Connecting it to GND or just let it 'float' it will print LOW.

Any idea why a floating input is activated even when i am using the PULLUP internal resistor?

Many thanks all :slight_smile:

Welcome to the forum

ESP32 pins 34, 35, 36 and 39 are input only pins and do not have internal pullup resistors

Hi @UKHeliBob,

Thanks for your fast response!
I noticed it were INPUT ONLY pins, but didn't knew there are no internal pullup resistors then.

Thanks for the clarification :slight_smile:

Have a good day ahead!

Just put a 10-20k external resistor up to +V on the pin.

Is on portB of the ESP32 and does not have input pull ups.

Read the docs,

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/gpio.html

I would suggest ordering another ESP32 as you probably have damaged it. You stated you placed 5V on a GPIO, that usually damages the part. "When connecting it to 5v, it stops printing LOW." The ESP32's operating voltage range is 2.2 to 3.6V . Under normal operation the ESP32 Thing will power the chip at 3.3V.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.