Contents
Overview
The Arduino Nano is a compact, fully-featured, breadboard-friendly board based on the ATmega328 (Arduino Nano 3.x). It offers nearly the same functionality as the Arduino Duemilanove but in a different form factor. The Nano does not include a DC power jack and uses a Mini-B USB cable instead of the standard type.
Related Boards
If you’re looking for a Nano board with similar capabilities plus additional features, consider these options:
- Arduino Nano 33 BLE
- Arduino Nano 33 BLE SENSE
- Arduino 33 IoT
- Arduino Micro
Discover ideas for your projects with the Nano board on our tutorial platform, Project Hub.
Visit the “Getting Started with Arduino Nano” section for comprehensive information on configuring your board, using the Arduino Software (IDE), and beginning your journey with coding and electronics.
The “Tutorials” section offers examples from libraries, built-in sketches, and other valuable resources to enhance your understanding of Arduino hardware and software.
FAQs
Power
The Arduino Nano can be powered via the Mini-B USB connection, a 6-20V unregulated external power supply (pin 30), or a 5V regulated external power supply (pin 27). The power source is automatically selected to the highest voltage source.
Memory
The ATmega328 has 32 KB of flash memory, with 2 KB used for the bootloader. It also includes 2 KB of SRAM and 1 KB of EEPROM.
Input and Output
Each of the 14 digital pins on the Nano can function as an input or output, using the pinMode(), digitalWrite(), and digitalRead() functions. These pins operate at 5 volts and can provide or receive a maximum of 40 mA. They also feature an internal pull-up resistor (disconnected by default) of 20-50 kOhms. Additionally, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used for receiving (RX) and transmitting (TX) TTL serial data. These pins connect to the corresponding pins of the FTDI USB-to-TTL Serial chip.
External Interrupts: 2 and 3. Can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. Refer to the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). Support SPI communication, which is provided by the underlying hardware but is not currently included in the Arduino language.
LED: 13. A built-in LED connected to digital pin 13. When the pin is HIGH, the LED is on; when the pin is LOW, it is off.
The Nano has 8 analog inputs, each providing 10 bits of resolution (i.e., 1024 different values). By default, they measure from ground to 5 volts, though it is possible to change the upper end of their range using the analogReference() function. Note that analog pins 6 and 7 cannot be used as digital pins. Some pins also have specialized functionality:
I2C: A4 (SDA) and A5 (SCL). Support I2C (TWI) communication using the Wire library (documentation available on the Wiring website).
There are a couple of additional pins on the board:
AREF: Reference voltage for the analog inputs, used with analogReference().
Reset: Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields that block the one on the board.
Communication
The Arduino Nano offers various communication options for interfacing with a computer, another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, accessible on digital pins 0 (RX) and 1 (TX). An FTDI FT232RL chip on the board facilitates this serial communication over USB, with FTDI drivers (included with the Arduino software) creating a virtual COM port for computer software. The Arduino software includes a serial monitor for sending and receiving simple textual data to and from the Arduino board. The RX and TX LEDs on the board flash when data is transmitted via the FTDI chip and USB connection to the computer, but not for serial communication on pins 0 and 1. The SoftwareSerial library enables serial communication on any of the Nano’s digital pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify the use of the I2C bus. For SPI communication details, refer to the ATmega328 datasheet.
Programming
The Arduino Nano can be programmed using the Arduino software (download). Select “Arduino Duemilanove or Nano w/ ATmega328” from the Tools > Board menu, depending on the microcontroller on your board. The ATmega328 on the Arduino Nano comes preloaded with a bootloader, allowing you to upload new code without needing an external hardware programmer. It uses the original STK500 protocol for communication. Alternatively, you can bypass the bootloader and program the microcontroller via the ICSP (In-Circuit Serial Programming) header using Arduino ISP or a similar tool.
Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the Arduino Nano is designed to be reset by software running on a connected computer. One of the hardware flow control lines (DTR) of the FT232RL is connected to the reset line of the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino software leverages this feature, allowing you to upload code by simply pressing the upload button in the Arduino environment. This enables a shorter bootloader timeout, as the lowering of DTR can be well-coordinated with the start of the upload.
This setup has additional implications. When the Nano is connected to a computer running Mac OS X or Linux, it resets each time a connection is made to it from software (via USB). For the following half-second or so, the bootloader is running on the Nano. While it is programmed to ignore malformed data (i.e., anything besides an upload of new code), it will intercept the first few bytes of data sent to the board after a connection is opened. If a sketch running on the board receives one-time configuration or other data when it first starts, ensure that the software with which it communicates waits a second after opening the connection and before sending this data.