<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ControllersTech]]></title><description><![CDATA[Step-by-step microcontroller and embedded systems tutorials with working code and project files. Learn by building real projects.]]></description><link>https://controllerstech.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ade2b713b5c8595a8c1c7c7/fcab1ef9-3dd3-44b0-b45b-b889f931a9f3.png</url><title>ControllersTech</title><link>https://controllerstech.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 02 Nov 2026 03:58:19 GMT</lastBuildDate><atom:link href="https://controllerstech.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Arduino Nano Pinout Guide]]></title><description><![CDATA[See what every Arduino Nano pin does, including power, digital, PWM, analog A0-A7, UART, I2C, SPI and interrupt pins, with a diagram and tables.]]></description><link>https://controllerstech.hashnode.dev/arduino-nano-pinout-guide</link><guid isPermaLink="true">https://controllerstech.hashnode.dev/arduino-nano-pinout-guide</guid><category><![CDATA[arduino]]></category><category><![CDATA[arduino nano]]></category><category><![CDATA[arduino-pin]]></category><dc:creator><![CDATA[Arun Rawat]]></dc:creator><pubDate>Thu, 29 Oct 2026 13:28:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ade2b713b5c8595a8c1c7c7/839704ff-1b06-4318-a6a7-31c077872be2.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p><em>Originally published at</em> <a href="https://controllerstech.com/arduino-nano-pinout/"><em>controllerstech.com</em></a></p>
<p>The Arduino Nano uses the same ATmega328P chip as the Arduino UNO, but it comes in a board that is less than half the size and plugs directly into a breadboard. The pins sit close together on two narrow rows, and a few of them behave differently from the UNO, which makes it easy to wire a project incorrectly. The Nano has eight analog inputs instead of six, and two of them cannot be used as digital pins.</p>
<p>This guide covers all 30 pins of the Arduino Nano in the order you will use them. For each group, it explains what the pins do, how to use them in a sketch and which electrical limits apply. Wherever the Nano differs from the UNO, the difference is pointed out. A full reference table is included at the end.</p>
<p>The Nano shares most of its behavior with the UNO, so the <a href="https://controllerstech.com/arduino-uno-pinout/">Arduino UNO pinout guide</a> is a useful companion for the details that are identical. Once you know the pins, the <a href="https://controllerstech.com/arduino/core-tutorials/">Arduino Core Tutorials</a> show how to use GPIO, ADC, UART, I2C, SPI, PWM and interrupts in code.</p>
<p>This guide covers the classic Arduino Nano with the ATmega328P, including the common clones. The Nano Every and the Nano 33 boards use different microcontrollers and have different pin functions, so their pinouts do not match this page.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_2.webp" alt="Complete Arduino Nano pinout diagram with all 30 pins labeled and color coded" style="display:block;margin:0 auto" />

<h2>Arduino Nano Specifications</h2>
<p>The Arduino Nano is a compact board built around the ATmega328P microcontroller, which is the same chip that the Arduino UNO uses. The board measures 45 mm by 18 mm, and its two rows of header pins fit directly into a breadboard. Power and programming come through the USB port on one end, and the board has no DC jack.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_1.webp" alt="Arduino Nano top view with the ATmega328P, USB connector, reset button and onboard LEDs labeled" style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>Specification</th>
<th>Detail</th>
</tr>
</thead>
<tbody><tr>
<td>Microcontroller</td>
<td>ATmega328P</td>
</tr>
<tr>
<td>Clock speed</td>
<td>16 MHz</td>
</tr>
<tr>
<td>Flash memory</td>
<td>32 KB (0.5 KB or 2 KB used by the bootloader, depending on its version)</td>
</tr>
<tr>
<td>SRAM</td>
<td>2 KB</td>
</tr>
<tr>
<td>EEPROM</td>
<td>1 KB</td>
</tr>
<tr>
<td>Operating voltage</td>
<td>5 V</td>
</tr>
<tr>
<td>Input voltage (VIN)</td>
<td>7 V to 12 V recommended, 6 V to 20 V limits</td>
</tr>
<tr>
<td>Digital I/O pins</td>
<td>14 (D0 to D13)</td>
</tr>
<tr>
<td>Analog input pins</td>
<td>8 (A0 to A7)</td>
</tr>
<tr>
<td>PWM pins</td>
<td>6 (D3, D5, D6, D9, D10, D11)</td>
</tr>
<tr>
<td>Maximum current per I/O pin</td>
<td>40 mA absolute maximum, 20 mA recommended</td>
</tr>
<tr>
<td>Board size</td>
<td>45 mm × 18 mm</td>
</tr>
<tr>
<td>USB connector</td>
<td>Mini-B on the original board, Micro-USB or USB-C on many clones</td>
</tr>
</tbody></table>
<p>The extra analog pins A6 and A7 are the main difference from the UNO, and the analog section below explains how they work.</p>
<h2>Arduino Nano Pinout Diagram</h2>
<p>The diagram below shows all 30 pins of the Nano. Keep it open in a second tab while you read the sections that follow, because each section uses the same labels.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_2.webp" alt="Arduino Nano pinout diagram with all 30 pins labeled and color-coded by function" style="display:block;margin:0 auto" />

<p>The pins fall into four groups, and the guide follows the same order.</p>
<ul>
<li>The power pins supply the board and external parts.</li>
<li>The digital I/O pins read and write HIGH and LOW signals.</li>
<li>The analog pins measure voltages from 0 V to 5 V.</li>
<li>The communication pins carry UART, I2C and SPI data.</li>
</ul>
<h2>Arduino Nano Power Pins</h2>
<p>The power pins sit along the edges of the board. They let you supply the Nano from an external source and also let you power small sensors and modules from the board.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_3.webp" alt="Arduino Nano power pins close-up showing VIN, 5V, 3.3V, GND and RESET" style="display:block;margin:0 auto" />

<h3>VIN Pin</h3>
<p>The VIN pin accepts an external supply when you are not using USB. The board tolerates 6 V to 20 V, and the recommended range is 7 V to 12 V. The input passes through a linear voltage regulator, which turns the extra voltage into heat, so a high VIN makes the regulator hot. A 9 V battery or a 7.5 V adapter is a good choice.</p>
<h3>5V Pin</h3>
<p>The 5V pin carries the regulated 5 V rail. You can use it to power sensors and modules that need 5 V. When the board runs from USB, the available current is limited to about 500 mA by the USB port. When it runs from VIN, the limit depends on the regulator and on how much heat it can dissipate. Motors and other high-current loads need their own supply.</p>
<h3>3.3V Pin</h3>
<p>On the original Nano, the 3.3V pin is supplied by the USB-to-serial chip (FT232RL), and it can provide about 50 mA. That is enough for small sensors and modules, but not for anything larger. Many clones use a different USB chip, so the current on this pin can differ, and some clones provide no 3.3 V output at all. Check the specification of your board before you depend on it.</p>
<h3>GND Pins</h3>
<p>The Nano has two GND pins, one on each header row, and they are connected together inside the board. Every external module must share its ground with the Nano, because signals are measured against that common reference.</p>
<h3>RESET Pin</h3>
<p>Pulling the RESET pin LOW restarts the microcontroller, in the same way as the reset button. Other circuits use this pin when they need to restart the Nano from outside.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_4.webp" alt="Arduino Nano with the USB port and VIN pin marked as the two ways to power the board" style="display:block;margin:0 auto" />

<h3>Power Pin Rules</h3>
<ul>
<li>Keep VIN between 7 V and 12 V for reliable operation.</li>
<li>The Nano selects between USB and VIN automatically, but you should avoid feeding a separate 5 V supply into the 5V pin while USB is connected.</li>
<li>Do not draw more than about 50 mA from the 3.3V pin.</li>
<li>Connect the ground of every external circuit to a GND pin of the Nano.</li>
</ul>
<h2>Arduino Nano Digital Pins</h2>
<p>The Nano has 14 digital pins, labeled D0 to D13. You set each pin as an input or an output with <code>pinMode()</code>, and you control it with <code>digitalWrite()</code> and <code>digitalRead()</code>. The <a href="https://controllerstech.com/arduino-digitalwrite-and-digitalread-tutorial/">digitalRead() and digitalWrite() tutorial</a> explains both functions with examples.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_5.webp" alt="Arduino Nano digital pins D0 to D13 highlighted on both header rows" style="display:block;margin:0 auto" />

<h3>How Digital Pins Work</h3>
<p>In output mode, a HIGH pin drives 5 V and a LOW pin drives 0 V. In input mode, the ATmega328P reads a voltage above about 3 V as HIGH and a voltage below about 1.5 V as LOW. A voltage between those two levels gives an unreliable result, so an input should never be left floating. A pull-up or pull-down resistor, or the internal pull-up enabled with <code>INPUT_PULLUP</code>, keeps the pin at a defined level.</p>
<p>The absolute maximum current of a pin is 40 mA, but 20 mA is a safer working value. The total current through all I/O pins together should stay below 200 mA.</p>
<p>Single-wire sensors such as the <a href="https://controllerstech.com/interface-dht11-dht22-with-arduino/">DHT11 and DHT22</a> and the <a href="https://controllerstech.com/ds18b20-arduino-tutorial-single-multiple-sensors-oled/">DS18B20</a> need only one digital pin, and the <a href="https://controllerstech.com/pir-sensor-arduino-tutorial/">PIR motion sensor</a> and the <a href="https://controllerstech.com/ws2812-arduino-tutorial-neopixel-ring/">WS2812 LED ring</a> work the same way.</p>
<h3>Pin 13 and the Built-in LED</h3>
<p>Pin D13 connects to the onboard LED, so it is the easiest pin for a first test without any wiring. The LED and its series resistor load the pin, which makes D13 less reliable as an input than the other pins.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_6.webp" alt="Arduino Nano with digital pin D13 and the onboard LED highlighted" style="display:block;margin:0 auto" />

<h3>Digital Pin Rules</h3>
<ul>
<li>Call <code>pinMode()</code> for a pin before you use it.</li>
<li>Add a resistor of 220 Ω to 330 Ω in series with every LED.</li>
<li>Disconnect anything from D0 and D1 before you upload a sketch.</li>
<li>Use a transistor, MOSFET or relay module for motors and other heavy loads.</li>
</ul>
<h2>Arduino Nano PWM Pins</h2>
<p>Six digital pins can produce PWM (pulse width modulation) signals, and the board marks them with a tilde (~). These pins are D3, D5, D6, D9, D10 and D11, and they are the same pins as on the UNO. The <code>analogWrite()</code> function accepts a value from 0 to 255 and sets the share of time that the pin stays HIGH. The <a href="https://controllerstech.com/arduino-pwm-analogwrite-tutorial/">Arduino PWM and analogWrite() tutorial</a> covers duty cycle and frequency control in more detail.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_7.webp" alt="Arduino Nano PWM pins D3, D5, D6, D9, D10 and D11 highlighted on the digital header" style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>PWM pin</th>
<th>Timer</th>
<th>Default frequency</th>
</tr>
</thead>
<tbody><tr>
<td>D3</td>
<td>Timer2</td>
<td>about 490 Hz</td>
</tr>
<tr>
<td>D5</td>
<td>Timer0</td>
<td>about 980 Hz</td>
</tr>
<tr>
<td>D6</td>
<td>Timer0</td>
<td>about 980 Hz</td>
</tr>
<tr>
<td>D9</td>
<td>Timer1</td>
<td>about 490 Hz</td>
</tr>
<tr>
<td>D10</td>
<td>Timer1</td>
<td>about 490 Hz</td>
</tr>
<tr>
<td>D11</td>
<td>Timer2</td>
<td>about 490 Hz</td>
</tr>
</tbody></table>
<p>PWM becomes active only after you call <code>analogWrite()</code> on a pin, so these pins work as ordinary digital pins otherwise. Pins that share a timer also share its settings. The <code>tone()</code> function uses Timer2, which disables PWM on D3 and D11 while a tone is playing, and the <a href="https://controllerstech.com/arduino-passive-buzzer-tutorial/">passive buzzer tutorial</a> shows an example.</p>
<h2>Arduino Nano Interrupt Pins</h2>
<p>An interrupt lets the microcontroller pause its normal program and run a short function as soon as a pin changes state. The Nano handles interrupts in the same way as the UNO, with two dedicated external interrupt pins and pin change interrupts on most other pins.</p>
<h3>External Interrupts on D2 and D3</h3>
<p>INT0 is on digital pin D2, and INT1 is on digital pin D3. You attach a handler with <code>attachInterrupt()</code>, and each pin has its own interrupt vector, which gives a direct response without extra checking in your code. The trigger can be RISING, FALLING, CHANGE or LOW. The <a href="https://controllerstech.com/arduino-external-interrupts-tutorial/">Arduino external interrupts tutorial</a> includes working examples and debounce handling.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_8.webp" alt="Arduino Nano pins D2 and D3 highlighted as the external interrupt pins INT0 and INT1" style="display:block;margin:0 auto" />

<h3>Pin Change Interrupts</h3>
<p>All digital pins and the analog pins A0 to A5 support pin change interrupts (PCINT). The pins are grouped by port, and each port shares one interrupt vector, so your handler has to read the pins to find out which one changed. The pins A6 and A7 are analog-only and do not support pin change interrupts.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_13.webp" alt="Arduino Nano pinout with the pin change interrupt capable pins highlighted on the digital and analog headers" style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>Feature</th>
<th>External interrupts (INT0, INT1)</th>
<th>Pin change interrupts (PCINT)</th>
</tr>
</thead>
<tbody><tr>
<td>Available pins</td>
<td>D2 and D3 only</td>
<td>D0 to D13 and A0 to A5</td>
</tr>
<tr>
<td>Separate handler per pin</td>
<td>Yes</td>
<td>No, one handler per port</td>
</tr>
<tr>
<td>Trigger modes</td>
<td>RISING, FALLING, CHANGE, LOW</td>
<td>CHANGE only</td>
</tr>
<tr>
<td>Ease of use</td>
<td>Simple</td>
<td>Requires manual pin checks</td>
</tr>
</tbody></table>
<p>Use D2 and D3 whenever they are free, and use pin change interrupts when you need more sources.</p>
<h2>Arduino Nano Analog Pins</h2>
<p>The Nano has eight analog input pins, labeled A0 to A7, while the UNO has six. All of them connect to the 10-bit ADC (analog-to-digital converter), so <code>analogRead()</code> returns a value from 0 to 1023.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_9.webp" alt="Arduino Nano analog input header showing the eight pins A0 to A7" style="display:block;margin:0 auto" />

<h3>How Analog Input Works</h3>
<p>The ADC compares the input voltage with a reference voltage and returns a proportional number.</p>
<pre><code class="language-text">ADC value = (input voltage / reference voltage) × 1023
</code></pre>
<p>The default reference is 5 V, so each step represents about 4.9 mV. This is enough for most sensors, such as temperature, light and potentiometer inputs. The <a href="https://controllerstech.com/arduino-analogread-adc-tutorial/">Arduino ADC and analogRead() tutorial</a> covers sampling, averaging and conversion to real units, and the <a href="https://controllerstech.com/gp2y0a41sk0f-arduino-tutorial/">GP2Y0A41SK0F distance sensor tutorial</a> is an example of a sensor with an analog output.</p>
<h3>A6 and A7 Are Analog-Only Pins</h3>
<p>The pins A6 and A7 can be used only with <code>analogRead()</code>. They have no digital input or output function, so <code>pinMode()</code>, <code>digitalWrite()</code> and <code>digitalRead()</code> do not work on them. They also have no internal pull-up resistors. This is a common source of confusion for people who move from the UNO, because the UNO does not have these two pins at all.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_10.webp" alt="Arduino Nano pins A6 and A7 highlighted as analog-only inputs without digital I/O" style="display:block;margin:0 auto" />

<h3>AREF Pin</h3>
<p>The AREF pin lets you supply your own reference voltage to the ADC. If you apply 2.5 V to AREF and select the external reference in your code, the ADC range becomes 0 V to 2.5 V, and the same 1024 steps cover a smaller range, which gives finer resolution for small signals. The input voltage must stay below the reference voltage. Call <code>analogReference(EXTERNAL)</code> before you apply a voltage to AREF, because an internal reference is also connected to that pin, and an external source without this call can damage the chip.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_11.webp" alt="Arduino Nano AREF pin highlighted with a note about the analog reference voltage" style="display:block;margin:0 auto" />

<h3>Using A0 to A5 as Digital Pins</h3>
<p>The pins A0 to A5 also work as ordinary digital pins. Use <code>pinMode(A0, OUTPUT)</code> or <code>pinMode(A0, INPUT)</code>, and they behave like any other digital pin. This does not apply to A6 and A7.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_12.webp" alt="Arduino Nano analog pins A0 to A5 highlighted as pins that can also be used for digital I/O" style="display:block;margin:0 auto" />

<h3>Analog Pin Rules</h3>
<ul>
<li>A6 and A7 are analog-only, and A0 to A5 can also be digital pins.</li>
<li>Never apply more than 5 V to any analog pin.</li>
<li>A floating analog input gives random readings, so connect it to a signal source or to a defined level.</li>
<li>A lower AREF voltage improves resolution but reduces the usable input range.</li>
</ul>
<h2>Arduino Nano UART Pins</h2>
<p>The Nano has one hardware UART, and it uses digital pin D0 as RX (receive) and digital pin D1 as TX (transmit). The same lines connect to the USB-to-serial chip, which carries the Serial Monitor traffic between the board and your computer.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_14.webp" alt="Arduino Nano pins D0 (RX) and D1 (TX) highlighted for UART serial communication" style="display:block;margin:0 auto" />

<p>The original Nano uses an FT232RL chip for this task, and many clones use a CH340 chip instead. The CH340 works well, but Windows and macOS may need a driver that you install manually. Disconnect any wires from D0 and D1 before you upload a sketch, because the upload uses the same lines and a connected module can make the upload fail. The <a href="https://controllerstech.com/arduino-uart-tutorial/">Arduino UART tutorial</a> explains how to send and receive data.</p>
<h3>SoftwareSerial for a Second Serial Port</h3>
<p>The <code>SoftwareSerial</code> library creates an extra serial port on any two digital pins, which helps when a GPS or Bluetooth module needs a port while the hardware UART is busy with debug output. The library handles the timing in software, so it works reliably at 9600 baud and becomes less dependable at higher speeds.</p>
<h2>Arduino Nano I2C Pins</h2>
<p>I2C (Inter-Integrated Circuit) connects several devices to the same two wires, and each device has its own address. On the Nano, SDA (data) is on analog pin A4, and SCL (clock) is on analog pin A5. The <code>Wire</code> library handles the protocol, and the <a href="https://controllerstech.com/arduino-i2c-tutorial-master-slave-scanner/">Arduino I2C tutorial</a> shows how to scan the bus and troubleshoot it.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_15.webp" alt="Arduino Nano analog pins A4 (SDA) and A5 (SCL) highlighted for I2C communication" style="display:block;margin:0 auto" />

<p>Common I2C devices for the Nano include the <a href="https://controllerstech.com/arduino-ssd1306-oled-display-tutorial/">SSD1306 OLED display</a>, the <a href="https://controllerstech.com/ds3231-arduino-tutorial/">DS3231 real-time clock</a>, the <a href="https://controllerstech.com/mpu6050-arduino-tutorial/">MPU-6050 motion sensor</a>, the <a href="https://controllerstech.com/i2c-lcd1602-arduino-tutorial/">I2C LCD1602 display</a> and the <a href="https://controllerstech.com/arduino-bme280-tutorial/">BME280 sensor</a>. When the I2C bus is in use, A4 and A5 are no longer available as analog inputs, so plan the pins at the start of the project.</p>
<h2>Arduino Nano SPI Pins</h2>
<p>SPI (Serial Peripheral Interface) is the fastest of the three serial interfaces, and it uses four lines.</p>
<ul>
<li>MOSI (master out, slave in) is on pin D11.</li>
<li>MISO (master in, slave out) is on pin D12.</li>
<li>SCK (serial clock) is on pin D13.</li>
<li>SS (slave select) is on pin D10.</li>
</ul>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_16.webp" alt="Arduino Nano SPI pins D10 (SS), D11 (MOSI), D12 (MISO) and D13 (SCK) highlighted" style="display:block;margin:0 auto" />

<p>SPI suits devices that move a lot of data, such as the <a href="https://controllerstech.com/st7735-with-arduino-display-images-and-graphics/">ST7735 TFT display</a>, the <a href="https://controllerstech.com/interface-sd-card-with-arduino-using-spi/">SD card module</a>, the <a href="https://controllerstech.com/arduino-w25q-flash-memory/">W25Q flash memory chip</a> and nRF24L01 radio modules. Each device needs its own chip-select pin. Pin D10 must stay an output while the Nano acts as an SPI master, even when you do not use it as the slave select line. If D10 is set as an input and goes LOW, the ATmega328P switches to SPI slave mode, and the sketch stops working correctly.</p>
<h3>ICSP Header</h3>
<p>The Nano has a 6-pin ICSP header that exposes MOSI, MISO, SCK, RESET, VCC and GND. An external programmer uses this header to write the bootloader to the chip. Most users never need it unless they replace the chip or erase the bootloader by accident.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_17.webp" alt="Arduino Nano ICSP header close-up with the MOSI, MISO, SCK, RESET, VCC and GND pins labeled" style="display:block;margin:0 auto" />

<h2>Arduino Nano Timer and Input Capture Pins</h2>
<p>A few pins connect directly to the hardware timers inside the ATmega328P, and they are the same as on the UNO.</p>
<h3>Timer Clock Input Pins T0 and T1</h3>
<p>Pin D4 is the T0 input, and pin D5 is the T1 input. A timer that uses an external clock counts the pulses on its pin instead of the internal 16 MHz clock. This feature is used for frequency counters and for counting pulses from an encoder.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_18.webp" alt="Arduino Nano pins D4 T0 and D5 T1 highlighted as external clock inputs for Timer0 and Timer1" style="display:block;margin:0 auto" />

<h3>Input Capture Pin ICP1</h3>
<p>Pin D8 is the input capture pin (ICP1) of Timer1. When an edge appears on the pin, the hardware copies the current Timer1 value into a register without any help from the CPU. This gives a precise time stamp for events, which is useful for measuring pulse widths and for reading an ultrasonic sensor such as the <a href="https://controllerstech.com/hc-sr04-arduino-tutorial-distance-serial-lcd/">HC-SR04</a> more accurately than <code>pulseIn()</code> allows.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_19.webp" alt="Arduino Nano pin D8 highlighted as the ICP1 input capture pin of Timer1" style="display:block;margin:0 auto" />

<h2>Arduino Nano vs Arduino UNO</h2>
<p>Many people come to the Nano after they have worked with the UNO, so the table below lists the differences that matter when you plan a circuit. The microcontroller and the digital pin functions are the same, and the changes are mostly in the size, the analog pins and the USB hardware.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_1.webp" alt="Arduino Nano and Arduino UNO boards side by side showing size difference" style="display:block;margin:0 auto" />

<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_1.webp" alt="Arduino Nano and Arduino UNO boards side by side showing size difference" style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>Feature</th>
<th>Arduino UNO</th>
<th>Arduino Nano</th>
</tr>
</thead>
<tbody><tr>
<td>Microcontroller</td>
<td>ATmega328P</td>
<td>ATmega328P</td>
</tr>
<tr>
<td>Size</td>
<td>68.6 mm × 53.4 mm</td>
<td>45 mm × 18 mm</td>
</tr>
<tr>
<td>Digital I/O pins</td>
<td>14</td>
<td>14</td>
</tr>
<tr>
<td>PWM pins</td>
<td>6</td>
<td>6</td>
</tr>
<tr>
<td>Analog input pins</td>
<td>6 (A0 to A5)</td>
<td>8 (A0 to A7)</td>
</tr>
<tr>
<td>A6 and A7</td>
<td>Not available</td>
<td>Analog input only</td>
</tr>
<tr>
<td>USB connector</td>
<td>Type-B</td>
<td>Mini-B, Micro-USB or USB-C, depending on the board</td>
</tr>
<tr>
<td>DC power jack</td>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td>Breadboard friendly</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>3.3V pin source</td>
<td>Onboard 3.3 V regulator</td>
<td>FT232RL chip on the original board, 50 mA</td>
</tr>
<tr>
<td>ICSP header</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody></table>
<p>The core hardware is identical, and a sketch for one board usually runs on the other without changes. The <a href="https://controllerstech.com/arduino-uno-pinout/">Arduino UNO pinout guide</a> lists the UNO side of this comparison in full.</p>
<h2>Arduino Nano Pinout Table</h2>
<p>The tables below list every pin of the Nano with its port on the ATmega328P, its PWM capability and its alternate functions.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/nano_pinout_2.webp" alt="Arduino Nano complete pinout reference chart with all pin groups color-coded" style="display:block;margin:0 auto" />

<h3>Digital Pins</h3>
<table>
<thead>
<tr>
<th>Arduino pin</th>
<th>ATmega328P port</th>
<th>PWM</th>
<th>Alternate function</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>D0</td>
<td>PD0</td>
<td>No</td>
<td>RX</td>
<td>UART receive</td>
</tr>
<tr>
<td>D1</td>
<td>PD1</td>
<td>No</td>
<td>TX</td>
<td>UART transmit</td>
</tr>
<tr>
<td>D2</td>
<td>PD2</td>
<td>No</td>
<td>INT0</td>
<td>External interrupt 0</td>
</tr>
<tr>
<td>D3</td>
<td>PD3</td>
<td>Yes</td>
<td>INT1</td>
<td>External interrupt 1</td>
</tr>
<tr>
<td>D4</td>
<td>PD4</td>
<td>No</td>
<td>T0</td>
<td>Timer0 external clock</td>
</tr>
<tr>
<td>D5</td>
<td>PD5</td>
<td>Yes</td>
<td>T1</td>
<td>Timer1 external clock</td>
</tr>
<tr>
<td>D6</td>
<td>PD6</td>
<td>Yes</td>
<td>None</td>
<td>PWM output</td>
</tr>
<tr>
<td>D7</td>
<td>PD7</td>
<td>No</td>
<td>None</td>
<td>General-purpose digital I/O</td>
</tr>
<tr>
<td>D8</td>
<td>PB0</td>
<td>No</td>
<td>ICP1</td>
<td>Input capture unit</td>
</tr>
<tr>
<td>D9</td>
<td>PB1</td>
<td>Yes</td>
<td>None</td>
<td>PWM output</td>
</tr>
<tr>
<td>D10</td>
<td>PB2</td>
<td>Yes</td>
<td>SS</td>
<td>SPI slave select</td>
</tr>
<tr>
<td>D11</td>
<td>PB3</td>
<td>Yes</td>
<td>MOSI</td>
<td>SPI master out, slave in</td>
</tr>
<tr>
<td>D12</td>
<td>PB4</td>
<td>No</td>
<td>MISO</td>
<td>SPI master in, slave out</td>
</tr>
<tr>
<td>D13</td>
<td>PB5</td>
<td>No</td>
<td>SCK, LED</td>
<td>SPI clock and onboard LED</td>
</tr>
</tbody></table>
<h3>Analog Pins</h3>
<table>
<thead>
<tr>
<th>Arduino pin</th>
<th>ATmega328P port</th>
<th>Digital I/O</th>
<th>Alternate function</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>A0</td>
<td>PC0</td>
<td>Yes</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A1</td>
<td>PC1</td>
<td>Yes</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A2</td>
<td>PC2</td>
<td>Yes</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A3</td>
<td>PC3</td>
<td>Yes</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A4</td>
<td>PC4</td>
<td>Yes</td>
<td>SDA</td>
<td>I2C data, analog input or digital I/O</td>
</tr>
<tr>
<td>A5</td>
<td>PC5</td>
<td>Yes</td>
<td>SCL</td>
<td>I2C clock, analog input or digital I/O</td>
</tr>
<tr>
<td>A6</td>
<td>ADC6</td>
<td>No</td>
<td>None</td>
<td>Analog input only</td>
</tr>
<tr>
<td>A7</td>
<td>ADC7</td>
<td>No</td>
<td>None</td>
<td>Analog input only</td>
</tr>
<tr>
<td>AREF</td>
<td>None</td>
<td>No</td>
<td>AREF</td>
<td>External analog reference input</td>
</tr>
</tbody></table>
<h3>Power Pins</h3>
<table>
<thead>
<tr>
<th>Pin</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>VIN</td>
<td>External supply input, 7 V to 12 V recommended</td>
</tr>
<tr>
<td>5V</td>
<td>Regulated 5 V rail</td>
</tr>
<tr>
<td>3.3V</td>
<td>Regulated 3.3 V output, about 50 mA from the FT232RL on the original board</td>
</tr>
<tr>
<td>GND</td>
<td>Ground, two pins connected internally</td>
</tr>
<tr>
<td>RESET</td>
<td>Pull LOW to restart the microcontroller</td>
</tr>
</tbody></table>
<h2>Conclusion</h2>
<p>The Arduino Nano packs a lot into a very small package. Same ATmega328P chip as the UNO, same digital and communication pins, same PWM — but smaller, breadboard-friendly, and with two extra analog-only pins.</p>
<p>Once you understand the pinout — especially the A6/A7 limitation and the importance of keeping D10 as output for SPI — working with the Nano becomes very straightforward.</p>
<p>If you are moving over from the UNO, most of your knowledge carries over directly. The Nano is a natural next step, and it opens the door to building much more compact and portable projects.</p>
<hr />
<p><em>Originally published at</em> <a href="https://controllerstech.com/arduino-nano-pinout/"><em>controllerstech.com</em></a></p>
]]></content:encoded></item><item><title><![CDATA[Arduino UNO Pinout Guide]]></title><description><![CDATA[The Arduino UNO has 14 digital pins, 6 analog pins and a power header, and many of them serve more than one purpose. A pin that works as a plain input in…]]></description><link>https://controllerstech.hashnode.dev/arduino-uno-pinout-guide</link><guid isPermaLink="true">https://controllerstech.hashnode.dev/arduino-uno-pinout-guide</guid><dc:creator><![CDATA[Arun Rawat]]></dc:creator><pubDate>Sun, 25 Oct 2026 17:14:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ade2b713b5c8595a8c1c7c7/6cfbfcb1-cb0d-453c-9450-2bb2f0aa74ae.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Arduino UNO has 14 digital pins, 6 analog pins and a power header, and many of them serve more than one purpose. A pin that works as a plain input in one sketch can also act as a PWM output, a serial line or an interrupt source in another sketch. Knowing which function belongs to which pin helps you avoid wiring mistakes before they cost you an evening of debugging.</p>
<p>This guide covers every pin on the Arduino UNO in the order you will meet them on the board. For each group of pins, we explain what the pins do, how to use them in a sketch, and which electrical limits you need to respect. A diagram at the start and a full reference table at the end are included, so you can use the page both for learning and for quick lookups later.</p>
<p>If you also own a smaller board, the <a href="https://controllerstech.com/arduino-nano-pinout/">Arduino Nano pinout guide</a> shows how closely it matches the UNO. When you are ready to write code for these pins, the <a href="https://controllerstech.com/arduino/core-tutorials/">Arduino Core Tutorials</a> cover GPIO, ADC, UART, I2C, SPI, PWM and interrupts with working examples.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_18.webp" alt="Arduino UNO complete pinout reference chart with all pin groups color-coded" style="display:block;margin:0 auto" />

<h2>Arduino UNO Specifications</h2>
<p>The Arduino UNO is a microcontroller board built around the ATmega328P chip, which runs at 16 MHz. It provides digital input and output, analog input, PWM output and three serial interfaces, which is enough for most small embedded projects. The board is inexpensive and widely supported, so it remains a common first board for people learning embedded programming.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_1.webp" alt="Arduino UNO board top view showing all major components" style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>Specification</th>
<th>Detail</th>
</tr>
</thead>
<tbody><tr>
<td>Microcontroller</td>
<td>ATmega328P</td>
</tr>
<tr>
<td>Clock speed</td>
<td>16 MHz</td>
</tr>
<tr>
<td>Flash memory</td>
<td>32 KB (0.5 KB used by the bootloader)</td>
</tr>
<tr>
<td>SRAM</td>
<td>2 KB</td>
</tr>
<tr>
<td>EEPROM</td>
<td>1 KB</td>
</tr>
<tr>
<td>Operating voltage</td>
<td>5 V</td>
</tr>
<tr>
<td>Input voltage (VIN and DC jack)</td>
<td>7 V to 12 V recommended, 6 V to 20 V limits</td>
</tr>
<tr>
<td>Digital I/O pins</td>
<td>14 (6 support PWM)</td>
</tr>
<tr>
<td>Analog input pins</td>
<td>6</td>
</tr>
<tr>
<td>Maximum current per I/O pin</td>
<td>40 mA absolute maximum, 20 mA recommended</td>
</tr>
<tr>
<td>USB connector</td>
<td>Type-B</td>
</tr>
</tbody></table>
<h2>Arduino UNO Pinout Diagram</h2>
<p>The diagram below shows the complete pinout of the Arduino UNO. It is useful to keep it open in a second tab while you read the sections that follow, because each section refers to pins by the same labels.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_2.webp" alt="Arduino UNO pinout diagram with power, digital, PWM, analog, UART, I2C and SPI pins labeled" style="display:block;margin:0 auto" />

<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_3.webp" alt="ATmega328P chip pinout mapped to the matching Arduino UNO pin numbers" style="display:block;margin:0 auto" />

<p>The pins fall into four main groups, and the rest of this guide follows the same order.</p>
<ul>
<li>The power pins supply the board and any external components that you connect to it.</li>
<li>The digital I/O pins read and write HIGH and LOW signals.</li>
<li>The analog pins measure voltages between 0 V and 5 V.</li>
<li>The communication pins carry UART, I2C and SPI traffic to other devices.</li>
</ul>
<h2>Arduino UNO Power Pins</h2>
<p>The power header sits on the lower left side of the board. These pins let you feed power into the Arduino and also let you draw power for sensors and modules.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_4.webp" alt="Arduino UNO power header close-up showing the IOREF, RESET, 3.3V, 5V, GND and VIN pins" style="display:block;margin:0 auto" />

<h3>VIN Pin</h3>
<p>VIN stands for voltage input, and it accepts an external supply that feeds the onboard regulator. The board tolerates 6 V to 20 V, and the recommended range is 7 V to 12 V. A supply near 7 V to 9 V keeps the regulator cooler, because the regulator turns every extra volt into heat. A battery pack or a wall adapter is the usual source for this pin.</p>
<h3>5V Pin</h3>
<p>The 5V pin carries the regulated 5 V rail of the board. You can use it to power sensors and modules that need 5 V. The total current is limited by the source of the board, which is about 500 mA from USB and less from a high-voltage supply on VIN because of regulator heat.</p>
<h3>3.3V Pin</h3>
<p>The 3.3V pin provides a regulated 3.3 V output for parts that cannot tolerate 5 V, such as some Wi-Fi chips, Bluetooth modules and sensors. This pin can supply only about 50 mA, so it is suitable for small modules and not for anything that draws more current.</p>
<h3>GND Pins</h3>
<p>The UNO has three GND pins, and all of them are connected together inside the board, so you can use any one of them. An external module must share its ground with the Arduino, because the signals between the two devices are measured against that common reference. Without a shared ground, the readings become unreliable.</p>
<h3>RESET Pin</h3>
<p>Pulling the RESET pin LOW restarts the microcontroller in the same way as the reset button on the board. Other circuits use this pin when they need to restart the Arduino from outside, and shields often route their own reset button to it.</p>
<h3>IOREF Pin</h3>
<p>The IOREF pin reports the voltage at which the I/O pins operate, which is 5 V on the UNO. Shields read this pin to find out whether the board uses 5 V or 3.3 V logic, so that they can adjust their own circuits. Most personal projects never need to connect to it.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_5.webp" alt="Arduino UNO with the DC jack, VIN pin and USB port marked as the three ways to supply power" style="display:block;margin:0 auto" />

<h3>Power Pin Rules</h3>
<ul>
<li>Avoid connecting several power sources at once, since USB and an external supply on VIN can conflict with each other.</li>
<li>Keep the VIN voltage between 7 V and 9 V when you want the regulator to stay cool.</li>
<li>Connect the ground of every external circuit to a GND pin of the Arduino.</li>
<li>Do not draw more than 50 mA from the 3.3V pin.</li>
</ul>
<h2>Arduino UNO Digital Pins</h2>
<p>The Arduino UNO has 14 digital pins, labeled D0 to D13. They handle most everyday tasks, such as driving LEDs, reading buttons and switching relay modules. Many single-wire parts also need only one digital pin, including the <a href="https://controllerstech.com/interface-dht11-dht22-with-arduino/">DHT11 and DHT22 sensors</a>, the <a href="https://controllerstech.com/ds18b20-arduino-tutorial-single-multiple-sensors-oled/">DS18B20 temperature sensor</a>, the <a href="https://controllerstech.com/pir-sensor-arduino-tutorial/">PIR motion sensor</a>, the <a href="https://controllerstech.com/ir-sensor-interfacing-arduino/">IR sensor</a> and the <a href="https://controllerstech.com/ws2812-arduino-tutorial-neopixel-ring/">WS2812 LED ring</a>. The functions <code>digitalWrite()</code> and <code>digitalRead()</code> control them, and the <a href="https://controllerstech.com/arduino-digitalwrite-and-digitalread-tutorial/">digitalRead() and digitalWrite() tutorial</a> explains both in detail.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_6.webp" alt="Arduino UNO digital header with pins D0 to D13 highlighted" style="display:block;margin:0 auto" />

<h3>How Digital Pins Work</h3>
<p>Each digital pin works as an input or an output, depending on the mode that you set with <code>pinMode()</code>.</p>
<pre><code class="language-cpp">pinMode(7, OUTPUT);
digitalWrite(7, HIGH);
</code></pre>
<p>In output mode, a HIGH pin drives 5 V and a LOW pin drives 0 V. In input mode, the ATmega328P reads a voltage above about 3 V as HIGH and a voltage below about 1.5 V as LOW. A voltage between those two levels gives an unreliable result, so an input should never be left floating. A pull-up or pull-down resistor, or the internal pull-up enabled with <code>INPUT_PULLUP</code>, keeps the pin at a defined level.</p>
<p>The absolute maximum current of a pin is 40 mA, but this value is a limit and not a design target. A current of 20 mA or less is a safe working value, and the total current through all I/O pins together should stay below 200 mA.</p>
<h3>Pin 13 and the Built-in LED</h3>
<p>Pin 13 connects to the LED labeled L on the board, which is why most blink examples use it. The LED and its series resistor load the pin, so pin 13 behaves less cleanly as an input than the other pins. For that reason, it is better to use a different pin when you need a digital input.</p>
<h3>Digital Pin Rules</h3>
<ul>
<li>Call <code>pinMode()</code> for a pin before you use it.</li>
<li>Add a resistor of 220 Ω to 330 Ω in series with every LED.</li>
<li>Use a transistor, MOSFET or relay module for motors and other heavy loads, because a pin cannot supply that much current.</li>
<li>Avoid pin 13 as an input, because of the onboard LED circuit.</li>
</ul>
<h2>Arduino UNO PWM Pins</h2>
<p>Six of the digital pins can produce PWM (pulse width modulation) signals, and the board marks them with a tilde (~) symbol. These pins are 3, 5, 6, 9, 10 and 11. PWM switches a pin between HIGH and LOW very quickly, and the share of time spent HIGH (the duty cycle) sets the average output level. This is the standard way to dim an LED or control the speed of a small motor through a driver. The <a href="https://controllerstech.com/arduino-passive-buzzer-tutorial/">passive buzzer tutorial</a> shows another use of timer-generated signals on these pins. The <a href="https://controllerstech.com/arduino-pwm-analogwrite-tutorial/">Arduino PWM and analogWrite() tutorial</a> shows complete examples.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_7.webp" alt="Arduino UNO PWM pins 3, 5, 6, 9, 10 and 11 marked with a tilde on the digital header" style="display:block;margin:0 auto" />

<p>The <code>analogWrite()</code> function accepts a value from 0 to 255, where 0 keeps the pin LOW at all times and 255 keeps it HIGH at all times. The resolution is 8 bits, which gives 256 steps.</p>
<table>
<thead>
<tr>
<th>PWM pin</th>
<th>Timer</th>
<th>Default frequency</th>
</tr>
</thead>
<tbody><tr>
<td>3</td>
<td>Timer2</td>
<td>about 490 Hz</td>
</tr>
<tr>
<td>5</td>
<td>Timer0</td>
<td>about 980 Hz</td>
</tr>
<tr>
<td>6</td>
<td>Timer0</td>
<td>about 980 Hz</td>
</tr>
<tr>
<td>9</td>
<td>Timer1</td>
<td>about 490 Hz</td>
</tr>
<tr>
<td>10</td>
<td>Timer1</td>
<td>about 490 Hz</td>
</tr>
<tr>
<td>11</td>
<td>Timer2</td>
<td>about 490 Hz</td>
</tr>
</tbody></table>
<p>The PWM pins also work as ordinary digital pins, because PWM becomes active only when you call <code>analogWrite()</code> on them. Pins that share a timer also share its settings, so a change to one timer affects both of its pins. Timer0 additionally drives <code>millis()</code> and <code>delay()</code>, which means that changes to Timer0 affect the timing functions.</p>
<h2>Arduino UNO Interrupt Pins</h2>
<p>An interrupt lets the microcontroller pause its normal program and run a short function as soon as a pin changes state. This approach is more efficient than checking a pin repeatedly inside <code>loop()</code>, and it is often the only dependable way to catch short pulses.</p>
<h3>External Interrupts on Pins 2 and 3</h3>
<p>The UNO has two dedicated external interrupt pins. INT0 is on digital pin 2, and INT1 is on digital pin 3. You attach a handler with <code>attachInterrupt()</code>, and each pin has its own interrupt vector. The <a href="https://controllerstech.com/arduino-external-interrupts-tutorial/">Arduino external interrupts tutorial</a> walks through the setup. If you plan to combine interrupts with a task scheduler, the guide on <a href="https://controllerstech.com/arduino-freertos-semaphore-interrupt/">using interrupts with FreeRTOS on Arduino</a> covers that case.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_9.webp" alt="Arduino UNO digital pins D2 and D3 highlighted as the external interrupt pins INT0 and INT1" style="display:block;margin:0 auto" />

<p>The interrupt can be set to one of four trigger modes.</p>
<ul>
<li>RISING triggers when the pin goes from LOW to HIGH.</li>
<li>FALLING triggers when the pin goes from HIGH to LOW.</li>
<li>CHANGE triggers on any change of state.</li>
<li>LOW triggers continuously while the pin stays LOW.</li>
</ul>
<h3>Pin Change Interrupts</h3>
<p>Every I/O pin of the UNO can generate a pin change interrupt (PCINT), which makes this feature useful when two interrupt pins are not enough. The pins are grouped by port, and each port shares a single interrupt vector. When the interrupt fires, your code has to read the pins and work out which one changed.</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>External interrupts (INT0, INT1)</th>
<th>Pin change interrupts (PCINT)</th>
</tr>
</thead>
<tbody><tr>
<td>Available pins</td>
<td>D2 and D3 only</td>
<td>All digital and analog pins</td>
</tr>
<tr>
<td>Separate handler per pin</td>
<td>Yes</td>
<td>No, one handler per port</td>
</tr>
<tr>
<td>Trigger modes</td>
<td>RISING, FALLING, CHANGE, LOW</td>
<td>CHANGE only</td>
</tr>
<tr>
<td>Ease of use</td>
<td>Simple</td>
<td>Requires manual pin checks</td>
</tr>
</tbody></table>
<p>Pins 2 and 3 are the better choice whenever they are free, and pin change interrupts are the fallback when you need more sources.</p>
<h2>Arduino UNO Analog Pins</h2>
<p>The UNO has six analog input pins, labeled A0 to A5, on the lower header of the board. They connect to the 10-bit ADC (analog-to-digital converter) of the ATmega328P, and <code>analogRead()</code> returns a value from 0 to 1023.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_10.webp" alt="Arduino UNO analog input header showing pins A0 to A5" style="display:block;margin:0 auto" />

<h3>How Analog Input Works</h3>
<p>The ADC compares the input voltage with a reference voltage and returns a proportional number.</p>
<pre><code class="language-text">ADC value = (input voltage / reference voltage) × 1023
</code></pre>
<p>The default reference is 5 V, so an input of 2.5 V gives a reading of about 511. Each step represents about 4.9 mV, which suits most sensors. The <a href="https://controllerstech.com/gp2y0a41sk0f-arduino-tutorial/">GP2Y0A41SK0F distance sensor tutorial</a> is a good example of a sensor that reports its reading as an analog voltage. The <a href="https://controllerstech.com/arduino-analogread-adc-tutorial/">Arduino ADC and analogRead() tutorial</a> covers sampling, averaging and conversion to real units.</p>
<h3>AREF Pin</h3>
<p>The AREF pin lets you supply your own reference voltage to the ADC. If you apply 2.5 V to AREF and select the external reference in your code, the ADC range becomes 0 V to 2.5 V, and the same 1024 steps cover a smaller range. That gives finer resolution for small signals. The input voltage must stay below the reference voltage, otherwise the reading clips at 1023.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_11.webp" alt="Arduino UNO AREF pin highlighted next to the analog reference voltage input" style="display:block;margin:0 auto" />

<p>Call <code>analogReference(EXTERNAL)</code> before you apply a voltage to AREF, because the board also has an internal reference connected to that pin, and connecting an external source without this call can damage the chip.</p>
<h3>Using Analog Pins as Digital Pins</h3>
<p>Pins A0 to A5 also work as ordinary digital pins when you run out of regular ones. The same functions apply, and the pin names are valid in <code>pinMode()</code>, <code>digitalWrite()</code> and <code>digitalRead()</code>.</p>
<pre><code class="language-cpp">pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);
</code></pre>
<h3>Analog Pin Rules</h3>
<ul>
<li><code>analogRead()</code> maps 0 V to 5 V onto the values 0 to 1023 by default.</li>
<li>An analog pin must never receive more than 5 V.</li>
<li>A lower AREF voltage improves resolution but reduces the usable input range.</li>
<li>A floating analog input produces random readings, so connect it to a signal source or to a defined level.</li>
</ul>
<h2>Arduino UNO UART Pins</h2>
<p>The UNO has one hardware UART (universal asynchronous receiver-transmitter), and it uses digital pin 0 as RX (receive) and digital pin 1 as TX (transmit). The same lines connect to the USB-to-serial chip of the board, so the Serial Monitor on your computer shares them with anything that you wire to these pins.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_12.webp" alt="Arduino UNO digital pins D0 (RX) and D1 (TX) highlighted for UART serial communication" style="display:block;margin:0 auto" />

<p>UART is the standard interface for debug messages and for serial modules such as the HC-05 and HC-06 Bluetooth modules, the SIM800L and SIM900 GSM modules and the NEO-6M GPS module. Disconnect any wires from pins 0 and 1 before you upload a sketch, because the upload process uses the same lines and a connected module can make the upload fail. The <a href="https://controllerstech.com/arduino-uart-tutorial/">Arduino UART tutorial</a> explains how to send and receive data.</p>
<h3>SoftwareSerial for a Second Serial Port</h3>
<p>The <code>SoftwareSerial</code> library creates an additional serial port on any two digital pins. It is a practical solution when a GPS or Bluetooth module needs a port while the hardware UART is busy with debug output. The library handles the timing in software, so it works reliably at 9600 baud and becomes less dependable at higher speeds.</p>
<h2>Arduino UNO I2C Pins</h2>
<p>I2C (Inter-Integrated Circuit) connects several devices to the same two wires. On the UNO, SDA (data) is on analog pin A4, and SCL (clock) is on analog pin A5. Each device on the bus has its own 7-bit address, so the Arduino can talk to one device at a time.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_14.webp" alt="Arduino UNO analog pins A4 (SDA) and A5 (SCL) highlighted for I2C communication" style="display:block;margin:0 auto" />

<p>Common I2C devices include <a href="https://controllerstech.com/arduino-ssd1306-oled-display-tutorial/">SSD1306 OLED displays</a>, <a href="https://controllerstech.com/ds3231-arduino-tutorial/">DS3231 real-time clock modules</a>, <a href="https://controllerstech.com/mpu6050-arduino-tutorial/">MPU-6050 motion sensors</a>, <a href="https://controllerstech.com/i2c-lcd1602-arduino-tutorial/">I2C LCD1602 displays</a> and <a href="https://controllerstech.com/at25c256-with-arduino-using-i2c/">external EEPROM chips</a>. Temperature and humidity sensors such as the <a href="https://controllerstech.com/arduino-bme280-tutorial/">BME280</a> and the <a href="https://controllerstech.com/interface-aht20-with-arduino/">AHT20</a> also use this bus. The <code>Wire</code> library handles the protocol, and the <a href="https://controllerstech.com/arduino-i2c-tutorial-master-slave-scanner/">Arduino I2C tutorial</a> shows how to scan the bus and read from a device. Once the I2C bus is in use, A4 and A5 are no longer available as analog inputs, so it helps to plan this when you assign pins at the start of a project.</p>
<h2>Arduino UNO SPI Pins</h2>
<p>SPI (Serial Peripheral Interface) is the fastest of the three serial interfaces on the board, and it uses four lines.</p>
<ul>
<li>MOSI (master out, slave in) is on pin 11.</li>
<li>MISO (master in, slave out) is on pin 12.</li>
<li>SCK (serial clock) is on pin 13.</li>
<li>SS (slave select) is on pin 10.</li>
</ul>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_15.webp" alt="Arduino UNO SPI pins D10 (SS), D11 (MOSI), D12 (MISO) and D13 (SCK) highlighted" style="display:block;margin:0 auto" />

<p>SPI suits devices that move a lot of data, such as <a href="https://controllerstech.com/st7735-with-arduino-display-images-and-graphics/">ST7735 TFT displays</a>, <a href="https://controllerstech.com/interface-sd-card-with-arduino-using-spi/">SD card modules</a>, <a href="https://controllerstech.com/arduino-w25q-flash-memory/">W25Q flash memory chips</a>, <a href="https://controllerstech.com/ili9341-arduino-touchscreen-tutorial/">ILI9341 touchscreens</a> and nRF24L01 radio modules. The master uses a separate chip-select line for each device, so a project with several SPI devices needs one extra digital pin per device. Pins 10 to 13 are occupied while SPI is active, and pin 13 also drives the onboard LED, which may flicker during transfers.</p>
<h2>Arduino UNO Timer and Input Capture Pins</h2>
<p>Two more groups of pins connect directly to the timers inside the ATmega328P.</p>
<h3>Timer Clock Input Pins T0 and T1</h3>
<p>Pin 4 is the T0 input, and pin 5 is the T1 input. Each one can feed an external clock signal to a hardware timer. By default, the timers count the internal 16 MHz clock, but with an external source they count the pulses on the pin instead. This feature is used for frequency counters, pulse counting from an encoder and similar measurements.</p>
<img src="https://controllerstech.com/?attachment_id=161955" alt="Arduino UNO digital pins D4 (T0) and D5 (T1) highlighted as timer external clock inputs" style="display:block;margin:0 auto" />

<p>For timing in your own sketches, the <a href="https://controllerstech.com/arduino-microsecond-delay/">delayMicroseconds() tutorial</a> shows how to create short and accurate delays.</p>
<h3>Input Capture Pin ICP1</h3>
<p>Pin 8 is the input capture pin (ICP1) of Timer1. When a rising or falling edge appears on the pin, the hardware copies the current Timer1 value into a register without any help from the CPU. This gives a precise time stamp for events, and it is useful for measuring pulse width, motor speed from an encoder and the echo time of an ultrasonic sensor such as the <a href="https://controllerstech.com/hc-sr04-arduino-tutorial-distance-serial-lcd/">HC-SR04</a>. Most ultrasonic libraries use <code>pulseIn()</code>, which blocks the program while it waits, whereas the input capture unit leaves the CPU free for other work.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_17.webp" alt="Arduino UNO pin D8 highlighted as the ICP1 input capture pin of Timer1" style="display:block;margin:0 auto" />

<h2>Arduino UNO Pinout Table</h2>
<p>The tables below list every pin of the UNO with its port on the ATmega328P, its PWM capability and its alternate functions.</p>
<img src="https://controllerstech.com/wp-content/uploads/2026/05/uno_pinout_18.webp" alt="Arduino UNO complete pinout reference chart with all pin groups color-coded" style="display:block;margin:0 auto" />

<h3>Digital Pins</h3>
<table>
<thead>
<tr>
<th>Arduino pin</th>
<th>ATmega328P port</th>
<th>PWM</th>
<th>Alternate function</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>D0</td>
<td>PD0</td>
<td>No</td>
<td>RX</td>
<td>UART receive</td>
</tr>
<tr>
<td>D1</td>
<td>PD1</td>
<td>No</td>
<td>TX</td>
<td>UART transmit</td>
</tr>
<tr>
<td>D2</td>
<td>PD2</td>
<td>No</td>
<td>INT0</td>
<td>External interrupt 0</td>
</tr>
<tr>
<td>D3</td>
<td>PD3</td>
<td>Yes</td>
<td>INT1</td>
<td>External interrupt 1</td>
</tr>
<tr>
<td>D4</td>
<td>PD4</td>
<td>No</td>
<td>T0</td>
<td>Timer0 external clock</td>
</tr>
<tr>
<td>D5</td>
<td>PD5</td>
<td>Yes</td>
<td>T1</td>
<td>Timer1 external clock</td>
</tr>
<tr>
<td>D6</td>
<td>PD6</td>
<td>Yes</td>
<td>None</td>
<td>PWM output</td>
</tr>
<tr>
<td>D7</td>
<td>PD7</td>
<td>No</td>
<td>None</td>
<td>General-purpose digital I/O</td>
</tr>
<tr>
<td>D8</td>
<td>PB0</td>
<td>No</td>
<td>ICP1</td>
<td>Input capture unit</td>
</tr>
<tr>
<td>D9</td>
<td>PB1</td>
<td>Yes</td>
<td>None</td>
<td>PWM output</td>
</tr>
<tr>
<td>D10</td>
<td>PB2</td>
<td>Yes</td>
<td>SS</td>
<td>SPI slave select</td>
</tr>
<tr>
<td>D11</td>
<td>PB3</td>
<td>Yes</td>
<td>MOSI</td>
<td>SPI master out, slave in</td>
</tr>
<tr>
<td>D12</td>
<td>PB4</td>
<td>No</td>
<td>MISO</td>
<td>SPI master in, slave out</td>
</tr>
<tr>
<td>D13</td>
<td>PB5</td>
<td>No</td>
<td>SCK, LED</td>
<td>SPI clock and onboard LED</td>
</tr>
</tbody></table>
<h3>Analog Pins</h3>
<table>
<thead>
<tr>
<th>Arduino pin</th>
<th>ATmega328P port</th>
<th>Alternate function</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>A0</td>
<td>PC0</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A1</td>
<td>PC1</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A2</td>
<td>PC2</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A3</td>
<td>PC3</td>
<td>None</td>
<td>Analog input or digital I/O</td>
</tr>
<tr>
<td>A4</td>
<td>PC4</td>
<td>SDA</td>
<td>I2C data, analog input or digital I/O</td>
</tr>
<tr>
<td>A5</td>
<td>PC5</td>
<td>SCL</td>
<td>I2C clock, analog input or digital I/O</td>
</tr>
<tr>
<td>AREF</td>
<td>None</td>
<td>AREF</td>
<td>External analog reference input</td>
</tr>
</tbody></table>
<h3>Power Pins</h3>
<table>
<thead>
<tr>
<th>Pin</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>VIN</td>
<td>External supply input, 7 V to 12 V recommended</td>
</tr>
<tr>
<td>5V</td>
<td>Regulated 5 V rail</td>
</tr>
<tr>
<td>3.3V</td>
<td>Regulated 3.3 V output, 50 mA maximum</td>
</tr>
<tr>
<td>GND</td>
<td>Ground, three pins connected internally</td>
</tr>
<tr>
<td>RESET</td>
<td>Pull LOW to restart the microcontroller</td>
</tr>
<tr>
<td>IOREF</td>
<td>I/O voltage reference for shields, 5 V on the UNO</td>
</tr>
</tbody></table>
<hr />
<p><em>This article was originally published at</em> <a href="https://controllerstech.com/arduino-uno-pinout/"><em>controllerstech.com</em></a><em>. Follow</em> <a href="https://www.youtube.com/@controllerstech"><em>ControllersTech on YouTube</em></a> <em>for more embedded tutorials.</em></p>
]]></content:encoded></item></channel></rss>