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.

zhekaus
  • 439
  • 2
  • 6
  • 16
  • 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" – Filip Franik Oct 28 '19 at 07:38

3 Answers3

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

Rozona Zoro
  • 154
  • 3
  • The heat generated by the internal pullup is negligible. 2. Some boards (not the AVR-based ones) have INPUT_PULLDOWN.
  • – Edgar Bonet Oct 28 '19 at 08:57