A very simple way to find out the exact internal pullup resistance of the ESP32.
Posted: Sat Jan 21, 2023 1:15 am
A while ago I came across a message about finding internal pull-up resistance of the ESP32, but I don't remember when.
It is not difficult to do. No calculation is needed.
To enable internal pull-up on an IO pin such as GPIO04, add the following line of code in your setup() function.
pinMode(4, INPUT_PULLUP); // enable internal pull-up resistor on GPIO04.
Usually the pull-up resistance is between 50K-100K. Connect a 100K potentiometer between the GPIO04 pin and GND, adjust it and stop when the voltage at the GPIO04 pin is 1.65V. At that time the adjusted value of the potentiometer is exactly equal to the value of the internal pullup resistance.
If you don't have a potentiometer at hand, just make resistors in series or parallel to get the voltage reading something close to the 1.65V. The value of the combined resistors will be near the internal pull up resistance.
I use the GPIO pin 4 as an example, you can change it to any GPIO pin.
It is not difficult to do. No calculation is needed.
To enable internal pull-up on an IO pin such as GPIO04, add the following line of code in your setup() function.
pinMode(4, INPUT_PULLUP); // enable internal pull-up resistor on GPIO04.
Usually the pull-up resistance is between 50K-100K. Connect a 100K potentiometer between the GPIO04 pin and GND, adjust it and stop when the voltage at the GPIO04 pin is 1.65V. At that time the adjusted value of the potentiometer is exactly equal to the value of the internal pullup resistance.
If you don't have a potentiometer at hand, just make resistors in series or parallel to get the voltage reading something close to the 1.65V. The value of the combined resistors will be near the internal pull up resistance.
I use the GPIO pin 4 as an example, you can change it to any GPIO pin.