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.
Right
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
← Previous
Arduino delay() Blocks All Other Operations
Next →
Arduino digitalRead Returns Wrong Value
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro