1

There are two ways of pulling the pins in Arduino – using internal and external resistor. I wonder when I should use external resistor instead of INPUT_PULLUP.

1
  • From my experience the only difference is "external pullup/pulldown is easier to replace" and maybe also "by just looking at the circuit you can see the external resistor so it's easier to understand the design after few months" Oct 28, 2019 at 7:38

3 Answers 3

3

You can use either the internal or external resistor in normal application.

Each method has each own advantages:

Internal resistor

  • Pros: flexible to change by changing the code
  • Pros: Reduce PCB size
  • Pros: Reduce cost (very small)
  • Cons: It may make MCU hot

External resistor

  • Pros: Reduce heat for MCU
  • Cons: Not easy to replace when it is built-in PCB
  • Cons: Increase PCB size

Besides, Pull-up and pull-down resistors are not only used for INPUT port but also for OUTPUT port. In the case of OUTPUT port. The external resistor has another advantage: flexibility in connecting devices with different I/O voltages. For example, in I2C hardware see I2C at the Hardware Level.

NOTE: As far as I know, at the writing time, Arduino library does NOT support INPUT_PULLDOWN

1
  • 1. The heat generated by the internal pullup is negligible. 2. Some boards (not the AVR-based ones) have INPUT_PULLDOWN. Oct 28, 2019 at 8:57
2

"Cons: It may make MCU hot"
It will not. P=V^2/R, so 5*5/20,000 = 1.25mW, that will not make the processor hot. Even turning all 80 in a Mega2560, and pulling them all low, will only dissipate 0.1W.

"NOTE: As far as I know, at the writing time, Arduino library does NOT support INPUT_PULLDOWN" That is because Atmega328P, '1284, '2560, etc. family of devices do not have internal pulldown resistors. Only pullup. See Section 14 of their datasheets, "I/O Ports".

This pullup is generally insufficient for I2C pullup, the rising edge created by the 20K to 50K internal pullup is very slow. External 4.7K down to around 2.2K (depends on how many I2C devices are connected) are needed. And the I2C bus spec says they should be at the end of the bus, not the origin of bus (which is generally the processor).

If you have a long wire coming from a button or switch, that is generally a good time to use an external pullup to ensure good switching levels between high and low.

1

The "Arduino Language" (i.e. the pinMode() function) only knows INPUT_PULLUP.

So you need external resistors for PULLDOWN resistors.

OUTPUT signals are not floating, so the term PULLUP/PULLDOWN resistor does not really apply there.

Besides, the value of an internal pullup resistor is not adjustable. If that value (20 .. 50k) is not appropriate (I²C needs something less than 10k) an external resistor is required.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.