A very simple way to find out the exact internal pullup resistance of the ESP32.

FRDM4236
Posts: 7
Joined: Mon Dec 19, 2022 12:30 am

A very simple way to find out the exact internal pullup resistance of the ESP32.

Postby FRDM4236 » 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.

zapta1
Posts: 9
Joined: Sat Jan 21, 2023 12:10 am

Re: A very simple way to find out the exact internal pullup resistance of the ESP32.

Postby zapta1 » Sun Jan 22, 2023 5:20 am

Good idea.

Alternatively you can use a fix resistor, measure the voltage and calculate the pull-up (R2) using https://ohmslawcalculator.com/voltage-d ... calculator

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 71 guests