Skip to content

Arduino Internal Pull-Up Resistor Not Working

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about Arduino Internal Pull. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.

The Problem

The internal pull-up resistor does not pull the pin HIGH as expected.

Quick Fix

Wrong

pinMode(5, INPUT);  // No pull-up enabled
Pin 5 floats — readings are unstable.
pinMode(5, INPUT_PULLUP);  // Enable 20k pull-up
int val = digitalRead(5);
Serial.println(val);  // Prints 1 when floating
1 (HIGH) when nothing is connected to pin 5.

Prevention

Always use INPUT_PULLUP instead of INPUT for switches and buttons connected to GND. Internal pull-ups are 20-50 kOhm on AVR, ~45 kOhm on ESP32. For stronger pull, use an external resistor (10 kOhm recommended).

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### How strong is the internal pull-up?

20-50 kOhm on AVR (Uno, Mega), ~45 kOhm on ESP32, ~35 kOhm on SAMD. This is weak but sufficient for switches.

Can I use INPUT_PULLDOWN?

INPUT_PULLDOWN is available on ESP32, SAMD, and some ARM boards. AVR does not have internal pull-downs. Use an external resistor on Uno/Mega.

Does pull-up work on all pins?

Most digital pins support pull-up. Pins used for special functions (serial, I2C) may behave differently. Check the datasheet.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro