In short: The Arduino Uno exposes 14 digital pins (D0-D13, six of them PWM-capable), 6 analog inputs (A0-A5) and a handful of power pins, all wired straight to the 28-pin ATmega328P, with UART on D0/D1, SPI on D10-D13 and I2C on A4/A5 sharing the same physical pins as ordinary GPIO.
Why the pin map matters
Every beginner tutorial says "connect the sensor to pin 7", but interviewers in embedded roles ask a different question: which physical leg of the microcontroller is that, which port register controls it, and what else does it share a pad with? The Uno is a perfect teaching board because there is no hidden pin multiplexer fabric. Each header socket is a direct trace to an ATmega328P pin, and each pin has up to three jobs: general-purpose I/O, a timer or ADC function, and a serial-bus function. Once you understand how those roles collide, you can debug wiring conflicts in minutes instead of hours. If you want the silicon behind the pins first, read our Arduino Uno block diagram walkthrough.
The 14 digital pins and the port naming behind them
The AVR core groups its I/O into 8-bit ports: PORTB (PB0-PB7), PORTC (PC0-PC6) and PORTD (PD0-PD7). The Arduino core simply renumbers them. D0-D7 map to PD0-PD7, and D8-D13 map to PB0-PB5. PB6 and PB7 are consumed by the 16 MHz crystal, which is why there is no D14 and D15 from PORTB.
Key fact: pinMode(13, OUTPUT) ends up setting bit 5 of the DDRB register. Writing PORTB |= (1<<5) is the same as digitalWrite(13, HIGH) but runs in 2 clock cycles (125 ns at 16 MHz) instead of roughly 50 cycles for the library call.
Analog pins A0-A5: ADC first, GPIO second
The six analog inputs are PC0-PC5, feeding a single 10-bit successive-approximation ADC through a multiplexer. With the default 5 V reference, one count is 5/1024 = 4.88 mV, so analogRead() returns 0-1023. A conversion takes 13 ADC clocks; at the default 125 kHz ADC clock (prescaler 128) that is about 104 microseconds, giving roughly 9.6 kS/s. Because there is one ADC and a mux, channels are sampled one at a time, never simultaneously.
Two practical traps. First, after switching the mux channel the sample-and-hold capacitor needs time to settle, so source impedance above about 10 kOhm gives readings that bleed in from the previous channel. Second, A0-A5 can be used as digital pins numbered D14-D19, which is the usual escape when you run out of D-pins.
PWM: how six pins fake an analog output
The Uno has no DAC. The pins marked with a tilde (D3, D5, D6, D9, D10, D11) are driven by hardware timers: Timer0 owns D5 and D6, Timer1 owns D9 and D10, Timer2 owns D3 and D11. analogWrite(pin, 0-255) sets the compare register, so the average voltage is duty x 5 V. A value of 64 gives a 25 percent duty and an average of 1.25 V into an RC filter.
Default frequencies are about 490 Hz on D3, D9, D10, D11 and about 980 Hz on D5, D6. Timer0 also drives millis() and delay(), so changing its prescaler silently breaks every timing function in your sketch. Timer1 is 16-bit and the right choice for servo or high-resolution work.
Power pins and current limits
| Pin | Function | Limit to remember |
|---|---|---|
| VIN | Raw input to the regulator (or its output when powered by the barrel jack) | 7-12 V recommended, 6-20 V absolute |
| 5V | Regulated rail from the on-board LDO or USB | About 500 mA total on USB, more on the jack |
| 3.3V | Separate small regulator | 50 mA max |
| IOREF | Tells shields the logic level (5 V) | Reference only |
| AREF | External ADC reference input | Never drive it while using analogReference(DEFAULT) via a low-impedance source |
| RESET | Active-low reset | Pull to GND to restart |
Key fact: each I/O pin is rated 20 mA continuous (40 mA absolute maximum), and the whole chip tops out at 200 mA through VCC and GND. A single LED needs a resistor: (5 V - 2 V) / 10 mA = 300 Ohm, so 330 Ohm is the standard choice. Driving a motor straight from a pin is how people destroy a port.
Special-function pins: UART, SPI and I2C
UART (D0/D1). The hardware serial port, shared with the USB-to-serial chip. Anything wired to D0/D1 competes with the USB link, so uploads fail when a module holds RX low. At 9600 baud, 8N1, one byte takes 10 bit-times, about 1.04 ms. SPI (D10-D13). Four wires: SS, MOSI, MISO, SCK. The Uno is the master and can clock up to 8 MHz (F_CPU/2), so one byte moves in 1 microsecond, far faster than UART. D13 doubles as SCK and the on-board LED, so SPI devices make that LED flicker. I2C (A4/A5). Two open-drain lines, SDA and SCL, needing pull-up resistors (the ATmega's internal 20-50 kOhm ones are too weak for fast mode; use 4.7 kOhm external). Standard mode is 100 kHz, fast mode 400 kHz, and each device has a 7-bit address, so one bus can hold up to 112 usable devices.
Pin conflicts and good practice
- Using Serial.begin() takes over D0 and D1 as digital pins.
- Calling Wire.begin() takes over A4 and A5, so a sketch cannot read both an analog sensor on A4 and an I2C device.
- Using SPI means D10 must remain an output even if the Uno is the master, otherwise the hardware may drop to slave mode.
- Only D2 and D3 support external interrupts (INT0/INT1); any pin supports pin-change interrupts through PCINT, but with coarser grouping.
- Enable the internal pull-up with pinMode(pin, INPUT_PULLUP) for buttons; it is about 20-50 kOhm and saves an external resistor.
The same discipline of reading the pin-to-function table before drawing a schematic carries into ASIC and FPGA work, where Cadence Allegro or Siemens Xpedition pinout reviews catch exactly these multiplexing clashes. If you want guided practice, our interfacing guide applies this map to real sensors, and the hands-on labs at ChipXpert VLSI training take the same ideas into silicon.
Ready to go from pin tables to working firmware? Explore the embedded track in our CourseTron courses and build projects on the Uno step by step.
FAQ
How many digital and analog pins does the Arduino Uno have?
14 digital pins (D0-D13), of which 6 support PWM, and 6 analog inputs (A0-A5). The analog pins can also act as digital pins D14-D19.
Which Uno pins are used for I2C, SPI and UART?
I2C uses A4 (SDA) and A5 (SCL). SPI uses D10 (SS), D11 (MOSI), D12 (MISO) and D13 (SCK). UART uses D0 (RX) and D1 (TX).
How much current can an Uno pin supply?
20 mA is the recommended continuous current per I/O pin, with 40 mA as the absolute maximum, and 200 mA total for the chip. Use a transistor or driver for anything larger, such as relays or motors.
Is the Uno PWM a true analog output?
No. It is a digital square wave whose duty cycle sets the average voltage. Add an RC low-pass filter if you need a smooth DC level.