☝ Measuring internal pull-up and pull-down internal resistance of the ESP32

Intro

So, you definitely know, that you can optionally enable or disable weak (because resistance is pretty high) pull-up (for positive) or pull-down (for negative) internal resistor to set stable logic level.

ImageImage

But what is the actual resistance have those pull-up/pull-down resistors? Let's find out this 🤨

Code

Using Arduino framework I configured GPIO1 pin as OPEN DRAIN with pull-up:

  1. <br />#define GPIO_PULLUP 1
  2.  
  3. // the setup function runs once when you press reset or power the board
  4. void setup() {
  5. // initialize digital pin LED_BUILTIN as an output.
  6. pinMode(GPIO_PULLUP, INPUT_PULLUP);
  7.  
  8. pinMode(LED_BUILTIN, OUTPUT);
  9.  
  10.  
  11. }
  12.  
  13. // the loop function runs over and over again forever
  14. void loop() {
  15. digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
  16. delay(1000); // wait for a second
  17. digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
  18. delay(1000); // wait for a second
  19. }
  20.  

Pin States

So, after configuring GPIO1 now can have one of two states:

SINK LOW (GPIO: 0V)WEAK HIGH (GPIO: 3.3V)
ImageImage
  1. &nbsp;

Measuring

It's easy to do measuring by using multimeter with uA regime, so I just connect positive probe to the GPIO1 and negative probe to the devboard GND.

Image

And this cause current flow through internal pull-up resistor, so we can see the real value:

Image

Calculations

Because MCU powering voltage is 3.3V (measured before) and the current is 73.4uA, the resistance is:

R = U/I = 3.3V/73.4 uA = 44.96 kOhm

Datasheet (update from 2024/02/03)

Hah, I just found that resistance is openly written in the ESP32-S3 datasheet, and as you can see value 45kOhm is corresponds to the calculated resistance 44.96kOhm:

Image

Conclusions

  • Earlier I expected weak internal resistors value ~47k, so the reality confirmed it 😎
  • Calculated value corresponds to the specified in the datasheet
177
No comments yet. Be the first to add a comment!
Cookies?