The classic Arduino Nano is one of the smallest boards built around the ATmega328P and remains useful anywhere you want the familiar UNO R3 architecture in a breadboard-friendly 45 × 18 mm format.
Electrically, the classic Nano is very close to the ATmega328P-based UNO generation:
- 8-bit AVR CPU at 16 MHz;
- 32 kB Flash;
- 2 kB SRAM;
- 1 kB EEPROM;
- 5 V logic;
- 14 standard digital pins;
- 8 analog inputs;
- 6 PWM outputs;
- UART, SPI and I²C;
- two dedicated external interrupt pins;
- additional pin-change interrupt capability.
The Nano also exposes two extra ADC channels, A6 and A7, that the classic UNO does not bring out. Those two pins are useful but have one important limitation: they are analog-input only.
This guide maps every Arduino Nano pin to the ATmega328P peripheral behind it, explains PWM and timer ownership, ADC behaviour, SPI, I²C, UART and interrupts, and highlights the pin conflicts that matter when several peripherals are used at once.
Arduino Nano Classic Specifications
| Feature | Classic Arduino Nano |
|---|---|
| Main MCU | ATmega328P |
| CPU architecture | 8-bit AVR |
| Clock speed | 16 MHz |
| Operating logic voltage | 5 V |
| Flash | 32 kB |
| SRAM | 2 kB |
| EEPROM | 1 kB |
| Digital I/O | D0-D13 |
| PWM outputs | 6 |
| Analog inputs | A0-A7 |
| ADC resolution | 10 bit |
| UART | 1 |
| SPI | 1 hardware SPI interface |
| I²C/TWI | 1 hardware two-wire interface |
| Dedicated external interrupts | D2 / INT0 and D3 / INT1 |
| USB connector | Mini-B |
| USB interface | FT232RL USB-to-serial |
| Recommended VIN | 7-12 V |
| Maximum recommended current per I/O | 20 mA |
Complete Arduino Nano Pinout
| Arduino pin | ATmega328P pin/function | Main functions |
|---|---|---|
| D0 | PD0 / RXD | Digital I/O, UART RX, pin-change interrupt |
| D1 | PD1 / TXD | Digital I/O, UART TX, pin-change interrupt |
| D2 | PD2 / INT0 | Digital I/O, external interrupt 0, pin-change interrupt |
| D3 | PD3 / INT1 / OC2B | Digital I/O, PWM, external interrupt 1, pin-change interrupt |
| D4 | PD4 / XCK / T0 | Digital I/O, pin-change interrupt, timer/external clock functions |
| D5 | PD5 / OC0B / T1 | Digital I/O, PWM, pin-change interrupt |
| D6 | PD6 / OC0A / AIN0 | Digital I/O, PWM, analog comparator input, pin-change interrupt |
| D7 | PD7 / AIN1 | Digital I/O, analog comparator input, pin-change interrupt |
| D8 | PB0 / ICP1 / CLKO | Digital I/O, Timer1 input capture, pin-change interrupt |
| D9 | PB1 / OC1A | Digital I/O, PWM, pin-change interrupt |
| D10 | PB2 / SS / OC1B | Digital I/O, PWM, SPI SS, pin-change interrupt |
| D11 | PB3 / MOSI / OC2A | Digital I/O, PWM, SPI COPI/MOSI, pin-change interrupt |
| D12 | PB4 / MISO | Digital I/O, SPI CIPO/MISO, pin-change interrupt |
| D13 | PB5 / SCK | Digital I/O, SPI clock, built-in LED, pin-change interrupt |
| A0 | PC0 / ADC0 | Analog input, digital I/O, pin-change interrupt |
| A1 | PC1 / ADC1 | Analog input, digital I/O, pin-change interrupt |
| A2 | PC2 / ADC2 | Analog input, digital I/O, pin-change interrupt |
| A3 | PC3 / ADC3 | Analog input, digital I/O, pin-change interrupt |
| A4 | PC4 / ADC4 / SDA | Analog input, digital I/O, I²C SDA, pin-change interrupt |
| A5 | PC5 / ADC5 / SCL | Analog input, digital I/O, I²C SCL, pin-change interrupt |
| A6 | ADC6 | Analog input only |
| A7 | ADC7 | Analog input only |
Physical Header Layout
The classic Nano uses two rows of 15 pins.
Viewed from the component side with the Mini-B USB connector at the top, the traditional pin order is:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Left side Right side D1 / TX VIN D0 / RX GND RESET RESET GND 5V D2 A0 D3 A1 D4 A2 D5 A3 D6 A4 D7 A5 D8 A6 D9 A7 D10 AREF D11 3V3 D12 D13 |
This narrow dual-row format makes the Nano particularly convenient for breadboards and compact prototypes.
Digital Pins D0-D13
The standard Nano exposes 14 named digital pins:
|
1 2 3 4 |
D0 to D13 |
Typical usage:
|
1 2 3 4 5 6 7 8 |
pinMode(8, OUTPUT); digitalWrite(8, HIGH); pinMode(7, INPUT_PULLUP); int state = digitalRead(7); |
The ATmega328P GPIO is 5 V logic when the Nano is powered normally.
Arduino’s current pinout recommends a maximum of 20 mA per I/O pin. That is a design limit for normal use, not a target operating current for every pin.
Do Not Power Loads Directly from GPIO
A Nano pin can drive:
- logic inputs;
- small LEDs through resistors;
- chip-select lines;
- low-current control signals.
It should not directly power:
- motors;
- relays;
- solenoids;
- high-power LEDs;
- large speakers.
Use a transistor, MOSFET or driver IC for those loads.
PWM Pins
The six PWM-capable Nano pins are:
|
1 2 3 4 5 6 7 8 9 |
D3 D5 D6 D9 D10 D11 |
They are normally marked with a tilde:
|
1 2 3 4 5 6 7 8 9 |
~D3 ~D5 ~D6 ~D9 ~D10 ~D11 |
Use:
|
1 2 3 4 |
analogWrite(9, 128); |
to request approximately 50% duty cycle on D9.
PWM Is Not a True Analog Voltage
On the classic Nano:
|
1 2 3 4 |
analogWrite() |
generates PWM.
There is no hardware DAC.
A value of 128 does not generate a steady 2.5 V output. It rapidly switches the pin between 0 V and 5 V with approximately 50% duty cycle.
For an actual analog voltage, use:
- an external DAC;
- a filtered PWM output;
- a newer Arduino board with an integrated DAC.
PWM Timer Mapping
The PWM outputs are divided across the ATmega328P’s three timers:
| Timer | PWM pins | Hardware outputs |
|---|---|---|
| Timer0 | D5, D6 | OC0B, OC0A |
| Timer1 | D9, D10 | OC1A, OC1B |
| Timer2 | D3, D11 | OC2B, OC2A |
Timer0 Is Used by millis() and delay()
Timer0 has a special role in the Arduino core.
It is used to generate the timing behind:
|
1 2 3 4 5 6 |
millis() micros() delay() |
If you directly reconfigure Timer0 registers to change PWM behaviour on D5 or D6, you can break Arduino timekeeping.
This is one reason low-level timer code must be written carefully.
Timer1
Timer1 is a 16-bit timer and is often used for applications requiring finer timing resolution.
Its PWM outputs are:
|
1 2 3 4 5 |
D9 = OC1A D10 = OC1B |
Libraries for:
- servos;
- precise pulse generation;
- frequency measurement;
- input capture;
may use Timer1 internally.
If a library takes ownership of Timer1, PWM behaviour on D9/D10 may change.
Timer2
Timer2 is an 8-bit timer.
Its PWM outputs are:
|
1 2 3 4 5 |
D3 = OC2B D11 = OC2A |
Some tone-generation and timing libraries use Timer2, so again check for conflicts when several timing libraries are combined.
Analog Inputs A0-A7
The classic Nano exposes eight analog channels:
|
1 2 3 4 5 6 7 8 9 10 11 |
A0 A1 A2 A3 A4 A5 A6 A7 |
The ATmega328P ADC is 10 bit.
So:
|
1 2 3 4 |
analogRead(A0) |
returns:
|
1 2 3 4 |
0 to 1023 |
ADC Resolution
With a nominal 5 V reference, one ideal 10-bit ADC step is approximately:
|
1 2 3 4 5 |
5 V / 1024 ≈ 4.88 mV |
This is quantisation resolution, not guaranteed measurement accuracy.
Reference variation, noise, ADC error and sensor accuracy still affect the result.
A0-A5 Can Also Be Digital Pins
A0 through A5 are connected to ATmega328P Port C GPIO and can be used digitally.
For example:
|
1 2 3 4 5 |
pinMode(A0, OUTPUT); digitalWrite(A0, HIGH); |
or:
|
1 2 3 4 |
pinMode(A3, INPUT_PULLUP); |
A6 and A7 Are Different
A6 and A7 are dedicated ADC inputs in the 32-pin ATmega328P package.
They do not have normal digital GPIO hardware.
So this is valid:
|
1 2 3 4 |
int value = analogRead(A6); |
but this is not:
|
1 2 3 4 5 |
pinMode(A6, OUTPUT); digitalWrite(A6, HIGH); |
The same restriction applies to A7.
Why the Nano Has A6 and A7 but UNO R3 Does Not
The Nano uses the surface-mount 32-pin version of the ATmega328P.
That package provides:
|
1 2 3 4 5 |
ADC6 ADC7 |
as additional analog-only pins.
The classic socketed UNO R3 uses the 28-pin package, where those two ADC-only channels are not available externally.
AREF
The AREF pin is the ADC reference input.
Arduino normally uses the supply voltage as the default ADC reference.
An external reference can be selected through:
|
1 2 3 4 |
analogReference(EXTERNAL); |
when the hardware is wired appropriately.
Do not connect an arbitrary external voltage to AREF while the ADC is still configured for an incompatible internal/reference mode.
Internal 1.1 V Reference
The ATmega328P also includes an internal reference that Arduino can select using:
|
1 2 3 4 |
analogReference(INTERNAL); |
On the ATmega328P-based Nano this is nominally around 1.1 V.
A lower reference can improve voltage resolution for small sensor signals, provided the input never exceeds the selected reference range.
UART Serial Pins
The hardware UART uses:
|
1 2 3 4 5 |
D0 = RX D1 = TX |
In Arduino code:
|
1 2 3 4 |
Serial.begin(115200); |
uses this hardware USART.
USB and Serial Share the UART
The classic Nano uses an FT232RL USB-to-serial converter.
The FT232RL is connected to the ATmega328P UART.
That means:
|
1 2 3 4 5 6 7 8 9 10 |
computer USB ↓ FT232RL ↓ D0 / D1 UART ↓ ATmega328P |
If an external device is also connected to D0/D1, it can interfere with:
- sketch upload;
- Serial Monitor;
- USB serial communication.
Avoid Heavy External Loading on D0/D1 During Upload
If uploads fail while another UART device is connected, disconnect that device temporarily or add isolation so it does not fight the USB serial interface.
This is especially common with:
- GPS modules;
- Bluetooth serial modules;
- other microcontrollers;
- RS-232/RS-485 converters.
SPI Pins
Hardware SPI uses:
|
1 2 3 4 5 6 7 |
D10 = SS D11 = MOSI / COPI D12 = MISO / CIPO D13 = SCK |
Current Arduino terminology increasingly uses:
|
1 2 3 4 5 |
COPI = Controller Out Peripheral In CIPO = Controller In Peripheral Out |
Older documentation and libraries commonly use:
|
1 2 3 4 5 |
MOSI MISO |
They refer to the same signal directions in this context.
Basic SPI Example
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <SPI.h> const int chipSelect = 10; void setup() { pinMode(chipSelect, OUTPUT); digitalWrite(chipSelect, HIGH); SPI.begin(); } |
D10 Is Special in SPI Master Mode
D10 maps to the ATmega328P hardware SS pin.
When using the MCU as an SPI controller/master, it is good practice to configure D10 as an output even if another pin is used as the actual peripheral chip-select.
This prevents accidental switching into SPI peripheral/slave mode if the hardware SS pin is allowed to become an input and is pulled low.
D13 Is Shared with the Built-In LED
D13 is both:
|
1 2 3 4 |
SPI SCK |
and:
|
1 2 3 4 |
LED_BUILTIN |
So the onboard LED may flicker during SPI communication.
The LED circuitry can also slightly load the SCK line, although this is normally acceptable at typical Arduino SPI speeds.
I²C Pins
The hardware two-wire interface uses:
|
1 2 3 4 5 |
A4 = SDA A5 = SCL |
Arduino accesses it through:
|
1 2 3 4 |
#include <Wire.h> |
and:
|
1 2 3 4 |
Wire.begin(); |
Basic I²C Scanner
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#include <Wire.h> void setup() { Serial.begin(115200); Wire.begin(); for (uint8_t address = 1; address < 127; address++) { Wire.beginTransmission(address); uint8_t error = Wire.endTransmission(); if (error == 0) { Serial.print("Found device at 0x"); if (address < 16) { Serial.print("0"); } Serial.println(address, HEX); } } } void loop() { } |
A4/A5 Cannot Be Independent Analog Inputs While I²C Is Active
A4 and A5 are multifunction pins.
When I²C is in use:
|
1 2 3 4 5 |
A4 = SDA A5 = SCL |
you should not simultaneously expect them to behave as independent ADC channels.
If you need eight analog channels plus I²C, the Nano’s A6/A7 can help because they remain dedicated analog inputs.
External Interrupt Pins
The two dedicated external interrupt inputs are:
|
1 2 3 4 5 |
D2 = INT0 D3 = INT1 |
Use Arduino’s normal API:
|
1 2 3 4 5 6 7 8 |
attachInterrupt( digitalPinToInterrupt(2), myISR, RISING ); |
External Interrupt Modes
The standard Arduino API supports modes such as:
|
1 2 3 4 5 6 7 |
LOW CHANGE RISING FALLING |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
volatile bool eventFlag = false; void myISR() { eventFlag = true; } void setup() { pinMode(2, INPUT_PULLUP); attachInterrupt( digitalPinToInterrupt(2), myISR, FALLING ); } void loop() { if (eventFlag) { eventFlag = false; // normal work here } } |
Keep Interrupt Service Routines Short
Inside an ISR:
- set flags;
- increment counters;
- capture timestamps;
- return quickly.
Avoid:
- long delays;
- slow Serial output;
- complex floating-point work;
- blocking I²C transactions.
Pin-Change Interrupts
The ATmega328P also supports pin-change interrupts.
These are available across most exposed GPIO ports and can detect a logic change on many pins beyond D2 and D3.
The important distinction is:
|
1 2 3 4 5 6 7 8 9 10 |
D2 / D3 → dedicated INT0 / INT1 → directly supported by attachInterrupt() many other GPIO → PCINT pin-change interrupt system → requires lower-level code or a suitable library |
Which Nano Pins Support Pin-Change Interrupts?
On the classic Nano, pin-change interrupt capability is available on the ordinary Port B, C and D GPIO pins, including:
- D0-D13;
- A0-A5.
A6 and A7 are ADC-only inputs and do not provide normal GPIO pin-change interrupt capability.
Pin-Change Interrupt Groups
The ATmega328P groups pin-change inputs by port:
| Group | Nano pins |
|---|---|
| Port D / PCINT16-23 | D0-D7 |
| Port B / PCINT0-5 exposed | D8-D13 |
| Port C / PCINT8-13 exposed | A0-A5 |
All pins in a group share an interrupt vector, so software must determine which pin actually changed.
When to Use INT0/INT1 vs PCINT
Use D2/D3 dedicated external interrupts when:
- you need the simplest Arduino API;
- edge type matters;
- the signal is important and deserves its own interrupt source.
Use pin-change interrupts when:
- you need interrupts on more pins;
- you need to monitor several buttons or encoders;
- you are comfortable with lower-level AVR code or a supporting library.
Input Capture on D8
D8 maps to:
|
1 2 3 4 |
ICP1 |
the Timer1 input-capture pin.
This hardware can capture the Timer1 counter value at the exact moment an external edge arrives.
It is useful for:
- pulse-width measurement;
- frequency measurement;
- RPM inputs;
- precise event timing.
For timing-critical measurement, input capture can be much more accurate than repeatedly polling a pin in loop().
Analog Comparator
D6 and D7 also connect to the ATmega328P analog comparator:
|
1 2 3 4 5 |
D6 = AIN0 D7 = AIN1 |
This peripheral can compare two analog voltages directly in hardware.
It is less commonly used in beginner Arduino code but can be useful for:
- threshold detection;
- zero-cross detection;
- fast analog event detection.
Power Pins
The classic Nano exposes:
- VIN;
- 5V;
- 3V3;
- GND;
- AREF;
- RESET.
VIN
Arduino’s current Nano pinout specifies:
|
1 2 3 4 |
7-12 V |
as the VIN input range for the board.
VIN feeds the onboard regulator.
Do not confuse VIN with the 5 V rail.
5 V Pin
The 5 V pin is the main regulated logic rail.
Depending on how the board is powered, it can be used as:
- regulated 5 V output;
- regulated 5 V input.
If feeding the board directly from 5 V, use a clean regulated supply and understand that you are bypassing the VIN regulator path.
3.3 V Pin
On the classic Nano, the 3.3 V output is provided by the USB interface circuitry.
Arduino’s current pinout specifies a maximum of approximately:
|
1 2 3 4 |
50 mA |
from the 3.3 V pin.
Do not treat it as a high-current 3.3 V supply.
RESET Pins
The Nano exposes reset on both sides of the board.
Pulling RESET low restarts the ATmega328P.
The USB-to-serial interface also uses the reset circuitry during normal sketch upload.
Mini-B USB
The classic Nano uses a Mini-B USB connector.
This is one of the easiest visual differences between the classic Nano and newer Nano-family boards, many of which now use Micro-USB or USB-C.
The Mini-B connector provides:
- 5 V power;
- USB serial communication;
- sketch upload through the FT232RL.
FT232RL LEDs
The Nano includes TX and RX activity indicators driven by the USB-to-serial interface.
They flash when serial data crosses the USB connection.
They are separate from the user-controllable D13 built-in LED.
Built-In LED
The standard built-in LED is connected to:
|
1 2 3 4 |
D13 |
Use:
|
1 2 3 4 5 |
pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, HIGH); |
Remember that D13 is also the hardware SPI clock pin.
Common Pin Conflicts
| Pin | Shared functions |
|---|---|
| D0 | GPIO / UART RX / USB serial path |
| D1 | GPIO / UART TX / USB serial path |
| D2 | GPIO / INT0 |
| D3 | GPIO / PWM / INT1 / Timer2 |
| D5 | GPIO / PWM / Timer0 |
| D6 | GPIO / PWM / Timer0 / comparator |
| D8 | GPIO / Timer1 input capture |
| D9 | GPIO / PWM / Timer1 |
| D10 | GPIO / PWM / SPI SS / Timer1 |
| D11 | GPIO / PWM / SPI MOSI/COPI / Timer2 |
| D12 | GPIO / SPI MISO/CIPO |
| D13 | GPIO / SPI SCK / built-in LED |
| A4 | ADC / GPIO / I²C SDA |
| A5 | ADC / GPIO / I²C SCL |
Nano vs UNO R3 Pin Behaviour
The Nano and UNO R3 share the same basic ATmega328P architecture.
So the following standard mappings are effectively the same:
- D0/D1 UART;
- D2/D3 external interrupts;
- D3/D5/D6/D9/D10/D11 PWM;
- D10-D13 SPI;
- A4/A5 I²C;
- 10-bit ADC;
- 5 V logic.
The most obvious Nano differences are:
- much smaller board;
- breadboard-friendly dual-row layout;
- Mini-B USB;
- A6 and A7 analog-only inputs;
- no dedicated DC barrel jack.
Nano vs Newer Nano Boards
Do not assume every board carrying the “Nano” name has the same processor or electrical behaviour.
The modern Nano family includes boards based on:
- ATmega4809;
- Renesas RA4M1;
- ESP32-S3;
- nRF52840;
- SAMD21;
- RP2040;
- Silicon Labs Matter-capable hardware.
The physical family resemblance is strong, but:
- logic voltage;
- PWM capability;
- ADC resolution;
- USB;
- wireless features;
- peripheral routing;
can differ dramatically.
When the Classic Nano Still Makes Sense
The board remains useful for:
- existing AVR projects;
- 5 V sensor systems;
- simple embedded controllers;
- breadboard prototypes;
- legacy libraries;
- projects where 2 kB RAM is sufficient;
- learning low-level AVR registers and timers.
ATmega328P Lifecycle Note
Microchip currently lists the ATmega328P as not recommended for new designs.
That does not make existing Nano boards unusable. It does mean that for a new commercial design with a long production horizon, you should evaluate a newer MCU rather than selecting the ATmega328P solely because it is familiar.
For hobby, education and maintenance of existing AVR projects, the classic Nano remains extremely practical.
Quick Pin Reference
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
UART D0 RX D1 TX External interrupts D2 INT0 D3 INT1 PWM D3 D5 D6 D9 D10 D11 SPI D10 SS D11 MOSI / COPI D12 MISO / CIPO D13 SCK I2C A4 SDA A5 SCL ADC A0-A7 10 bit Analog-only A6 A7 Built-in LED D13 |
Best Practices
- Keep D0/D1 free during upload if external UART hardware causes conflicts.
- Remember that A6/A7 are analog-only.
- Do not reconfigure Timer0 casually if you depend on
millis()ordelay(). - Check timer ownership before combining Servo, tone and custom PWM code.
- Use D2/D3 for simple
attachInterrupt()applications. - Use pin-change interrupts when you need interrupt capability on more GPIOs.
- Remember D13 is both SPI SCK and the built-in LED.
- Remember A4/A5 are both ADC inputs and I²C pins.
- Keep normal GPIO current well within Arduino’s 20 mA-per-pin recommendation.
- Use drivers for relays, motors and other power loads.
Final Thoughts
The classic Arduino Nano is essentially the familiar ATmega328P Arduino architecture compressed into a small breadboard-friendly board.
Its most important pin mappings are:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
D0/D1 → UART D2/D3 → dedicated external interrupts D3/D5/D6/D9/D10/D11 → PWM D10-D13 → SPI A4/A5 → I²C A0-A7 → 10-bit ADC A6/A7 → analog only |
The Nano’s simplicity is also its limitation. There is no Wi-Fi, Bluetooth, native USB, hardware DAC or large RAM pool. But for small 5 V AVR projects, that simplicity can be exactly what you want.
The biggest traps are equally straightforward:
- A6/A7 cannot be used as digital GPIO;
- D0/D1 share the hardware UART with the USB serial interface;
- Timer0 changes can break Arduino timekeeping;
- SPI, PWM and the built-in LED share several pins;
- A4/A5 are unavailable as independent analog inputs while used for I²C.
Once those constraints are understood, the classic Nano remains one of the easiest ATmega328P boards to integrate into compact breadboard and embedded projects.