The Arduino Nano remains one of the most popular microcontrollers in the maker community due to its compact form factor and breadboard-friendly design. Based on the ATmega328P 8-bit AVR microcontroller, it packs nearly the same power as the larger Arduino Uno but in a much smaller footprint. To utilize this board effectively, a deep understanding of the Arduino Nano pinout is essential.

Each of the 30 pins on the Nano serves a specific purpose, and many pins are multiplexed, meaning they can perform multiple functions depending on the software configuration. This article provides an exhaustive technical breakdown of the Arduino Nano pin layout, electrical constraints, and functional capabilities.

Quick Reference Summary of Arduino Nano Pins

The Arduino Nano features 30 pins arranged in two rows of 15. Below is a high-level categorization of these pins to help you navigate the board's capabilities quickly.

Category Total Pins Specific Designations
Digital I/O 14 D0 to D13
Analog Inputs 8 A0 to A7 (10-bit resolution)
PWM Channels 6 D3, D5, D6, D9, D10, D11
Communication 3 Interfaces UART (D0, D1), I2C (A4, A5), SPI (D10, D11, D12, D13)
Power & Ground 7 VIN, +5V, +3.3V, GND (x2), RST (x2)
External Interrupts 2 D2 (INT0), D3 (INT1)

Powering the Arduino Nano Through Dedicated Pins

The power management system of the Arduino Nano is versatile, allowing it to be powered via USB or external sources. Understanding the voltage limits of these pins is the first step in preventing hardware failure.

The VIN Pin (External Power Input)

The VIN pin is used to supply external power to the board when not using the USB connection. While the official specifications state a range of 6V to 20V, the recommended input voltage is 7V to 12V. This is because the onboard voltage regulator (usually the AMS1117 or similar) must drop the excess voltage as heat.

Supplying 20V will cause the regulator to run extremely hot, potentially leading to thermal shutdown or permanent damage. Conversely, supplying less than 7V may result in the 5V rail dropping below its stable threshold, causing unpredictable behavior in sensors and the microcontroller itself.

The +5V and +3.3V Output Pins

The +5V pin provides a regulated voltage used to power the ATmega328P and external components. When powered via USB, this pin receives power directly from the USB bus (minus a small diode drop). When powered via VIN, this pin serves as the output of the 5V regulator.

The +3.3V pin is provided by the onboard USB-to-Serial chip (such as the FT232RL or CH340). It is important to note that the current capability of the 3.3V rail is limited—usually around 50mA. This is sufficient for small sensors but inadequate for high-power devices like ESP8266 Wi-Fi modules or NRF24L01 transceivers without an external capacitor or regulator.

Ground (GND) and Reset (RST)

The Nano provides two GND pins to simplify circuit wiring on a breadboard. These pins are internally connected. The RST pin, when pulled to a logic LOW state, resets the microcontroller. This is useful for adding an external reset button if the onboard button is obstructed by a shield.

Digital Input and Output Capabilities

The Arduino Nano has 14 digital pins (D0 to D13) that can function as either inputs or outputs. These operate at a 5V logic level.

Current Limits and Logic Levels

Each GPIO (General Purpose Input/Output) pin can source or sink a maximum of 40mA. However, the recommended continuous operating current is 20mA per pin. Furthermore, the total current drawn from all pins combined should not exceed 200mA to avoid damaging the ATmega328P silicon.

  • Logic HIGH: 5V
  • Logic LOW: 0V
  • Internal Pull-up Resistors: All digital pins have internal pull-up resistors (20-50 kΩ) that can be activated via software using pinMode(pin, INPUT_PULLUP).

Special Digital Pins

  • Pin 13 (SCK / LED): This pin is connected to the onboard "L" LED. It also serves as the Clock (SCK) pin for SPI communication. Note that the LED and its series resistor can sometimes interfere with sensitive high-speed signals if the pin is used as an input.
  • D0 (RX) and D1 (TX): These are connected to the hardware UART. While they can be used as general GPIO, doing so often interferes with uploading sketches or serial debugging.

Pulse Width Modulation (PWM) on the Nano

Not all digital pins are created equal. The Arduino Nano supports 8-bit PWM on six specific pins: D3, D5, D6, D9, D10, and D11. These pins can simulate an analog voltage by rapidly switching the output between 0V and 5V.

PWM Frequencies and Timer Conflicts

The PWM functionality is controlled by the internal hardware timers of the ATmega328P:

  1. Timer 0 (Pins 5 and 6): These operate at approximately 980Hz. Timer 0 is also responsible for the millis() and delay() functions. Altering the prescaler for this timer will cause time-related functions in your code to run at the wrong speed.
  2. Timer 1 (Pins 9 and 10): These operate at approximately 490Hz. Timer 1 is a 16-bit timer often used by the Servo library. If you use the Servo library, PWM functionality on pins 9 and 10 is usually disabled.
  3. Timer 2 (Pins 3 and 11): These operate at approximately 490Hz.

Detailed Look at Analog Input Pins (A0 - A7)

The Arduino Nano features eight analog inputs, labeled A0 through A7. This is two more than the Arduino Uno, which only provides A0 to A5.

The 10-bit Analog-to-Digital Converter (ADC)

The ATmega328P uses a successive-approximation ADC. By default, it maps input voltages between 0V and 5V to integer values between 0 and 1023. This results in a resolution of approximately 4.9mV per unit.

A6 and A7 Limitations

A critical detail often missed by beginners is that A6 and A7 are pure analog inputs. Unlike A0 through A5, which can be configured as digital pins (D14 through D19), A6 and A7 lack the internal digital circuitry. You cannot use digitalWrite() or digitalRead() on these two pins. They are strictly for analogRead().

AREF Pin

The AREF (Analog Reference) pin allows you to set an external reference voltage for the ADC. For instance, if you are measuring a sensor that outputs between 0V and 3.3V, connecting 3.3V to AREF and calling analogReference(EXTERNAL) will increase the resolution of your readings within that specific range.

Hardware Communication Interfaces

The Arduino Nano is designed to communicate with other sensors, modules, and microcontrollers using three primary hardware protocols.

UART (Universal Asynchronous Receiver/Transmitter)

  • Pins: D0 (RX) and D1 (TX).
  • Usage: Used for serial communication with a PC via USB or with other TTL serial devices.
  • Pro Tip: In our tests, if you are using an external serial device on these pins, you must disconnect it before uploading a new sketch to the Nano, as the USB-to-Serial chip and the external device will conflict on the same data lines.

I2C (Inter-Integrated Circuit)

  • Pins: A4 (SDA) and A5 (SCL).
  • Usage: Also known as TWI (Two Wire Interface). This protocol allows you to connect dozens of sensors (like the MPU6050 or OLED displays) using just two wires.
  • Requirement: The I2C bus requires pull-up resistors (typically 4.7kΩ) to function correctly, though many breakout modules include these resistors already.

SPI (Serial Peripheral Interface)

  • Pins: D10 (SS), D11 (MOSI), D12 (MISO), and D13 (SCK).
  • New Terminology: In recent documentation, MOSI is referred to as COPI (Controller Out, Peripheral In) and MISO as CIPO (Controller In, Peripheral Out).
  • Usage: High-speed communication used for SD card modules, RFID readers, and high-resolution displays.

External Interrupts for Real-Time Response

When your project needs to respond instantly to an event (like a button press or an encoder pulse), using digitalRead() in a loop might be too slow. This is where external interrupts come in.

The Arduino Nano supports hardware interrupts on two pins:

  • INT0 on Digital Pin 2
  • INT1 on Digital Pin 3

By using the attachInterrupt() function, the microcontroller will stop what it is doing and execute a specific ISR (Interrupt Service Routine) the moment the state of the pin changes (RISING, FALLING, or CHANGE). This is essential for applications like measuring the RPM of a motor or handling emergency stop triggers.

Advanced Feature: ICSP Header Mapping

On the end of the Nano board opposite the USB port, there is a 2x3 grid of pins known as the ICSP (In-Circuit Serial Programming) header. These pins provide a direct link to the ATmega328P's programming interface.

  • Pin 1: MISO (D12)
  • Pin 2: +5V
  • Pin 3: SCK (D13)
  • Pin 4: MOSI (D11)
  • Pin 5: RESET
  • Pin 6: GND

The ICSP header is primarily used to burn a new bootloader onto the chip or to program the board using an external programmer (like an AVRISP mkII or another Arduino) if the USB-to-Serial chip is damaged.

Port Manipulation for High-Performance Coding

For advanced users, the Arduino abstraction layer (digitalWrite) can be slow. Direct Port Manipulation allows you to control multiple pins simultaneously and at much higher speeds. The Nano pins map to three ports on the ATmega328P:

  1. Port B (D8 to D13): Digital pins 8 through 13.
  2. Port C (A0 to A5): Analog pins A0 through A5 (used as digital).
  3. Port D (D0 to D7): Digital pins 0 through 7.

For example, writing to the PORTD register can change the state of eight pins in a single clock cycle, which is vital for timing-sensitive tasks like driving a parallel 16x2 LCD.

Electrical Safety and Handling Best Practices

When working with the Arduino Nano pin layout, following these guidelines will extend the life of your hardware:

  1. The 5V Logic Hard Limit: Never apply more than 5.5V to any I/O pin. If you are interfacing with a 12V sensor, use a logic level shifter or a voltage divider.
  2. Avoiding Short Circuits: When the Nano is powered via USB, the 5V pin is active. Be careful not to let loose wires touch the metal casing of the USB port, as this can cause a short and potentially shut down your computer's USB port.
  3. Capacitive Decoupling: When driving motors or servos from a shared power source, place a large capacitor (100uF or higher) across the 5V and GND pins to smooth out voltage spikes that could reset the Nano.
  4. Breadboard Alignment: Ensure the Nano is fully seated in the breadboard. Loose connections on the power pins can cause the bootloader to hang or the board to brown out during high-current operations.

Frequently Asked Questions

Can I use A6 and A7 as digital outputs?

No. Hardware-wise, pins A6 and A7 on the ATmega328P are only connected to the Analog Multiplexer and do not have the digital output driver circuitry found on other pins.

What is the difference between the Nano V3.0 and older versions?

The V3.0 uses the ATmega328P, whereas older versions (V2.x) often used the ATmega168, which has half the flash memory and half the RAM. Always check the chip marking to ensure your code fits within the memory limits.

Why does my Nano reset when I open the Serial Monitor?

The Nano is designed with an "Auto-Reset" feature. When the DTR line of the USB-to-Serial chip is toggled (which happens when a serial connection is opened), it pulls the Reset pin LOW through a capacitor. This allows the Arduino IDE to upload code without requiring a manual button press.

How much current can I draw from the 5V pin?

When powered via USB, the current is limited by your computer's USB port (usually 500mA) and the onboard 500mA PTC fuse. When powered via VIN, it is limited by the onboard regulator's thermal capacity, typically around 500mA to 800mA depending on the input voltage.

Conclusion

Mastering the Arduino Nano pin layout is about more than just knowing where to plug in a wire. It is about understanding the relationship between the hardware timers, the ADC's resolution, and the electrical limits of the ATmega328P. Whether you are building a simple LED flasher or a complex drone flight controller, knowing that D3 and D11 share a timer, or that A6 and A7 cannot drive a relay, will save you hours of debugging. By respecting the 20mA current per pin limit and utilizing the hardware communication interfaces like I2C and SPI, you can unlock the full potential of this tiny yet powerful microcontroller.