Pin Configuration of Arduino Nano: A Comprehensive Guide
The Arduino Nano is a compact, breadboard-friendly microcontroller board based on the ATmega328P (or ATmega168 in older models). Its versatility and small size make it ideal for embedded projects. This guide provides a detailed breakdown of its pin configuration, functions, and practical considerations.
1. Overview of Arduino Nano Pins
The Nano features 30 pins, categorized as follows:
14 Digital I/O Pins (D0–D13): Can be used for digital input/output, PWM, and interrupts.
8 Analog Input Pins (A0–A7): Six (A0–A5) double as digital pins (14–19), while A6–A7 are analog-only.
Power Pins: 5V, 3.3V, Vin, GND, AREF, and RESET.
Communication Pins: UART, SPI, and I2C.
Special Function Pins: ICSP header and built-in LED.
2. Digital Pins (D0–D13)
Each digital pin operates at 5V, with a 20mA recommended current limit. Key features include:
PWM Pins (~)
Pins 3, 5, 6, 9, 10, 11 support 8-bit PWM (0–255) for analog output (e.g., dimming LEDs).
External Interrupt Pins
Pins D2 (INT0) and D3 (INT1) can trigger interrupts on rising/falling edges.
Pin | PWM | Interrupt | Alternate Functions |
---|---|---|---|
D0 | No | No | UART RX |
D1 | No | No | UART TX |
D2 | No | Yes (INT0) | Digital I/O |
D3 | Yes | Yes (INT1) | PWM, Digital I/O |
D4 | No | No | Digital I/O |
D5 | Yes | No | PWM, Digital I/O |
D6 | Yes | No | PWM, Digital I/O |
D7 | No | No | Digital I/O |
D8 | No | No | Digital I/O |
D9 | Yes | No | PWM, Digital I/O |
D10 | Yes | No | PWM, SPI SS |
D11 | Yes | No | PWM, SPI MOSI |
D12 | No | No | SPI MISO |
D13 | No | No | SPI SCK, Built-in LED |
3. Analog Pins (A0–A7)
Resolution: 10-bit (0–1023).
A0–A5: Can serve as digital pins 14–19.
A6–A7: Analog-only inputs (not usable as digital pins).
Pin | Analog Channel | Digital Pin (if applicable) |
---|---|---|
A0 | 0 | 14 |
A1 | 1 | 15 |
A2 | 2 | 16 |
A3 | 3 | 17 |
A4 | 4 | 18 (SDA for I2C) |
A5 | 5 | 19 (SCL for I2C) |
A6 | 6 | N/A |
A7 | 7 | N/A |
4. Power Pins
Pin | Function | Specifications |
---|---|---|
5V | Regulated 5V output | Sourced from USB or Vin |
3.3V | Regulated 3.3V output | Max 150mA |
Vin | Input for external power (7–12V) | Bypasses USB power |
GND | Ground reference | Multiple pins available |
AREF | Analog reference voltage (0–5V) | Set via analogReference() |
RESET | Reset the microcontroller (active low) | Connect to GND to reset |
5. Communication Interfaces
UART (Serial)
RX (D0): Receive data.
TX (D1): Transmit data.
SPI
SS (D10): Slave Select.
MOSI (D11): Master Out Slave In.
MISO (D12): Master In Slave Out.
SCK (D13): Serial Clock.
ICSP Header: Duplicates SPI pins for programming.
I2C
SDA (A4): Data line.
SCL (A5): Clock line.
6. Special Function Pins
Built-in LED: Connected to D13.
ICSP Header: 6-pin header for direct programming (MOSI, MISO, SCK, RESET, VCC, GND).
7. Physical Pinout Layout
The Nano has two rows of 15 pins each. The top row includes D13–AREF, and the bottom row includes D0–D12, GND, RESET, etc. Refer to the diagram below for exact placement:
8. Technical Specifications
Microcontroller: ATmega328P (32KB flash, 2KB SRAM).
Operating Voltage: 5V.
Clock Speed: 16MHz.
Analog Inputs: 8 channels (10-bit resolution).
DC Current per I/O Pin: 20mA (recommended), 40mA (max).
9. Example Applications
PWM LED Dimming: Use pin 9 with
analogWrite()
.Temperature Sensor: Read analog data via A0.
I2C Display: Connect an OLED to A4 (SDA) and A5 (SCL).
SPI Data Logging: Interface an SD card module using D10–D13.
10. Common Mistakes & Troubleshooting
A6/A7 as Digital Pins: These are analog-only.
Overloading 3.3V Pin: Use an external regulator for higher current.
Floating Inputs: Enable pull-up resistors with
pinMode(pin, INPUT_PULLUP)
.
Conclusion
The Arduino Nano’s pin configuration offers flexibility for diverse projects, from simple LEDs to complex communication protocols. Understanding its digital, analog, power, and communication pins ensures efficient project design. Always refer to datasheets for voltage/current limits to avoid damage.
Kevin Chen
Founder / Writer at Rantle East Electronic Trading Co.,Limited
I am Kevin Chen, I graduated from University of Electronic Science and Technology of China in 2000. I am an electrical and electronic engineer with 23 years of experience, in charge of writting content for ICRFQ. I am willing use my experiences to create reliable and necessary electronic information to help our readers. We welcome readers to engage with us on various topics related to electronics such as IC chips, Diode, Transistor, Module, Relay, opticalcoupler, Connectors etc. Please feel free to share your thoughts and questions on these subjects with us. We look forward to hearing from you!