Arduino Nano pinout: every pin, its chip pin and its limits
Beginner
Or see every lesson.
- 455parts on the bench
- 43boards running now
- 1.00xreal time, on every board
The Arduino Nano is an Uno’s ATmega328P on a board that pushes into a breadboard, with two analog inputs an Uno has no pad for. This page lists all thirty pins with the ATmega328P port pin behind each, which pins do PWM and on which timer, the I2C, SPI and interrupt pins, the power pins and their limits, and which pin to use for what.
The circuit above is a Nano in Mokxi with a potentiometer on A7, one of the two analog-only pins, fading an LED on pin 9. The table is read from the same board model the simulator runs, and where the simulator does less than the board, the page says so.
Every pin, with its ATmega328P pin
With the USB socket at the top, the left header reads D1, D0, RESET, GND, then D2 to D12. The right header reads VIN, GND, RESET, 5V, A7 down to A0, AREF, 3V3 and D13. RESET and GND each appear twice, at both ends of the board on one trace. Pins 0 to 7 are port D, 8 to 13 are port B and A0 to A5 are port C, the same as on an Uno, so a register-level sketch moves across unchanged.
In code, digital pins are their numbers and the analog pins are A0 to A7. A0 to A5 are also digital pins 14 to 19.
| Pin | Chip pin | What it can do | Watch out for |
|---|---|---|---|
| 1 | PD1 | TX: Serial out, to the USB-to-serial chip. | Leave free, or uploads and the serial monitor break. |
| 0 | PD0 | RX: Serial in, from the USB-to-serial chip. | Leave free, or uploads and the serial monitor break. |
| RESET | PC6 | Reset: low restarts the chip. Two holes, one trace. | Not a GPIO. |
| GND | - | Ground. Two holes. | - |
| 2 | PD2 | Digital. INT0: attachInterrupt. | A good first choice for a button. |
| 3 | PD3 | PWM on timer 2, 490 Hz. INT1: attachInterrupt. | tone() takes timer 2 on a real board. |
| 4 | PD4 | Digital. | - |
| 5 | PD5 | PWM on timer 0, 976 Hz. | Timer 0 also runs millis(). |
| 6 | PD6 | PWM on timer 0, 976 Hz. | Timer 0 also runs millis(). |
| 7 | PD7 | Digital. | - |
| 8 | PB0 | Digital. | - |
| 9 | PB1 | PWM on timer 1, 490 Hz. | The Servo library takes timer 1 on a real board. |
| 10 | PB2 | PWM on timer 1, 490 Hz. SPI SS. | The Servo library takes timer 1 on a real board. |
| 11 | PB3 | PWM on timer 2, 490 Hz. SPI MOSI, also on the ICSP header. | tone() takes timer 2 on a real board. |
| 12 | PB4 | Digital. SPI MISO, also on the ICSP header. | - |
| VIN | - | Power in for the onboard regulator, 7 to 12 V. | Not a GPIO. |
| 5V | - | 5 V out from USB or the regulator. | Not a GPIO. |
| A7 | ADC7 | Analog input only. | No digital read or write and no pull-up. |
| A6 | ADC6 | Analog input only. | No digital read or write and no pull-up. |
| A5 | PC5 | Analog. Digital 19. I2C SCL. | Used by any I2C device. |
| A4 | PC4 | Analog. Digital 18. I2C SDA. | Used by any I2C device. |
| A3 | PC3 | Analog. Digital 17. | - |
| A2 | PC2 | Analog. Digital 16. | - |
| A1 | PC1 | Analog. Digital 15. | - |
| A0 | PC0 | Analog. Digital 14. | - |
| AREF | - | The analog reference input. | Not a GPIO. Never above 5 V. |
| 3V3 | - | A small 3.3 V output for a sensor. | Not for a motor or a servo. |
| 13 | PB5 | Digital. SPI SCK, also on the ICSP header. The L LED, lit when HIGH. | The LED loads the pin, so it is a poor input. |
Power pins and their limits
VIN feeds the onboard 5 V regulator, and Arduino recommends 7 to 12 V there. 5V is the regulated rail, from the USB socket or from the regulator, and you can power the board by putting a clean 5 V on it instead. 3V3 is a small 3.3 V output, fine for a sensor and no use for a motor. The GND holes are one ground.
Each pin is good for about 20 mA, and the ATmega328P’s absolute maximum is 40 mA per pin and 200 mA for the whole chip. In Mokxi the board is always powered from USB, VIN is an input it ignores, and the 5 V rail is an ideal source that cannot sag, so a circuit that would brown a real Nano out runs cleanly here.
PWM pins and their timers
Pins 3, 5, 6, 9, 10 and 11 do PWM with analogWrite, and the silkscreen marks them with a tilde. Each pair shares a timer: 5 and 6 are timer 0 at 976 Hz, 9 and 10 are timer 1 and 3 and 11 are timer 2, both at 490 Hz. Mokxi runs them on the same timers at the same rates.
The timers explain two things that catch people on a real Nano. The Servo library takes timer 1, so analogWrite on 9 and 10 stops working while a servo is attached. And tone() takes timer 2, so a buzzer playing a note stops PWM on 3 and 11.
A6 and A7: analog only
The Nano’s chip is the ATmega328P in its small square package, which brings out two converter channels the Uno’s DIP chip has no pin for. A6 and A7 are ADC channels 6 and 7 and nothing else: analogRead(A7) works, and pinMode, digitalRead, digitalWrite and the internal pull-up do not, on the real chip or in Mokxi. They are a good place for a knob, as in the circuit above, and no place for a button.
Every analog pin reads ten bits, 0 to 1023, against the 5 V rail unless AREF says otherwise. Mokxi’s converter has no noise in it, so a divider reads the same count every time where a real one wobbles by one or two.
Serial, the USB chip, I2C, SPI and the ICSP header
Pins 0 and 1 are the hardware serial port, and on a real Nano they go to the USB-to-serial chip, an FT232RL on an original and a CH340 on most clones. Anything wired to them can stop an upload, so leave them free. Mokxi does not model that chip: Serial reaches the serial monitor directly.
I2C is A4 for SDA and A5 for SCL; there are no separate SDA and SCL holes. SPI is 10, 11, 12 and 13 for SS, MOSI, MISO and SCK. The six-pin ICSP header at the end of the board carries MISO, SCK, MOSI, RESET, 5V and GND, the same SPI signals, for programming the chip directly. Mokxi does not draw the ICSP header as pins.
Questions
Which Arduino Nano pin should I use for a button?
Pin 2 or 3 if you want an interrupt, otherwise any of 4, 7, 8 or 12, with `INPUT_PULLUP` and the button to ground. Not A6 or A7, which cannot read digital, and not 13, whose LED pulls it down.
Which Nano pins are PWM?
Pins 3, 5, 6, 9, 10 and 11, the six with a tilde. 5 and 6 run at 976 Hz and the other four at 490 Hz.
What are the Arduino Nano I2C pins?
A4 is SDA and A5 is SCL. `Wire.begin()` uses them, and they are the same two as on an Uno.
What voltage can I put on the Nano’s VIN pin?
Arduino recommends 7 to 12 V. Below that the regulator cannot make a steady 5 V, and above it the regulator gets hot. A 9 V battery works; USB is easier.
Which pins are the Nano’s SPI pins?
SS is 10, MOSI is 11, MISO is 12 and SCK is 13. The last three are on the ICSP header too.
Which Nano pin should I use for a servo?
Pin 9 is the usual choice. The Servo library drives any digital pin, and on a real Nano it takes timer 1 whichever pin you pick, which is what stops PWM on 9 and 10.
Can I use A6 and A7 as digital pins?
No. They have no digital circuitry behind them on the chip. Read them with `analogRead` and compare the number, if you must, as in `analogRead(A6) > 512`.
Keep going
Where the facts on this page come from
Build this for real
Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.