Can I use the input-only pins to connect to a pushbutton without a resistor?

cal237
Posts: 5
Joined: Mon Jul 12, 2021 3:15 pm

Can I use the input-only pins to connect to a pushbutton without a resistor?

Postby cal237 » Mon Jul 12, 2021 6:56 pm

On ESP32 the last GPIO pins are input-only and it says they have no software pullup or pulldown resistors. Can I still use them to connect to pushbuttons in the way that is described at https://www.instructables.com/Arduino-B ... -resistor/ (That is, without any external resistor, connecting the button straight to ground)?

I want to connect the buttons this way because it is much easier and only requires 2 wires, as opposed to https://microcontrollerslab.com/push-bu ... h%20state. this version, which requires a resistor and extra wires for each button.

ESP_Sprite
Posts: 8884
Joined: Thu Nov 26, 2015 4:08 am

Re: Can I use the input-only pins to connect to a pushbutton without a resistor?

Postby ESP_Sprite » Tue Jul 13, 2021 3:43 am

No. If the button is not pressed and there is no pull-up, the pin will be picking up all kinds of random signals and the level you read will be random/undefined.

cal237
Posts: 5
Joined: Mon Jul 12, 2021 3:15 pm

Re: Can I use the input-only pins to connect to a pushbutton without a resistor?

Postby cal237 » Sat Jul 31, 2021 1:25 pm

Ok, so I need to implement my own pull-up/pull-down as shown in the 2nd link if I want to use those pins. Thanks for your help!

Who is online

Users browsing this forum: No registered users and 28 guests