Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 37 ยท Boards and IDE

Pinout and Power Pins

Read the Arduino Uno pinout: digital pins 0-13, analog A0-A5, PWM, serial, SPI and I2C pins, power pins 5V, 3.3V, VIN and GND, and the current limits of each.

The rows of sockets along the edge of a board are its pins. Every project involves choosing pins and respecting their limits, so a clear mental map of the Uno's pinout pays off. This lesson tours the headers, explains which pins have special jobs, and gives you the current limits to keep in mind.

The digital header

Pins labelled 0 to 13 are digital pins. Each can be set as input or output, but several have extra duties:

Pin Extra function Notes
0 (RX), 1 (TX) Hardware serial Shared with USB. Avoid them if you use the Serial Monitor.
2, 3 External interrupts (INT0, INT1) Used to react instantly to a signal
3, 5, 6, 9, 10, 11 PWM (analogWrite) Marked with a ~ on the board
10, 11, 12, 13 SPI (SS, MOSI, MISO, SCK) Used by SD cards, displays and radios
13 On-board LED Anything on pin 13 competes with that LED

The analog header

Pins A0 to A5 feed the analog-to-digital converter (Reading Analog Inputs). They are also usable as digital pins 14 to 19, and two of them have bus duties: A4 (SDA) and A5 (SCL) are the I2C bus used by many sensors and displays.

The power header

Pin Purpose
5V Regulated 5 V output (and input if you power the board here)
3.3V Regulated 3.3 V output, about 50 mA maximum
VIN Unregulated supply: connect 7 to 12 V here, or read what the barrel jack provides
GND Ground (several pins, all connected together)
IOREF Tells shields the logic voltage
RESET Pull low to restart the program
AREF Reference voltage for analog readings

The board can be powered through USB (5 V), the barrel jack (7 to 12 V recommended, regulated to 5 V on the board) or the 5V pin directly. Feeding more than 5.5 V into the 5V pin bypasses the regulator and can destroy the chip.

flowchart LR
    U["USB 5 V"] --> R["Board 5 V rail"]
    J["Barrel jack 7-12 V"] --> V["Voltage regulator"] --> R
    P["5V pin input"] --> R
    R --> C["ATmega328P"]
    R --> O["5V and 3.3V output pins"]

Figure: three ways to power the board; all end up on the 5 V rail.

Current limits

Respect these numbers, or the chip heats up and fails:

  • 20 mA is the recommended maximum for one I/O pin, 40 mA the absolute maximum.
  • The whole chip can source or sink about 200 mA in total across all pins.
  • The 5V pin can supply what your power source allows: from USB about 500 mA total for the board and everything attached; from the barrel jack, a few hundred mA before the regulator overheats.
C Stand-in: check a wiring plan against pin limits

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

Anything over 20 mA needs a transistor, MOSFET or driver chip, which controls a bigger current from a separate supply while the pin only supplies the small control current.

Pin numbering in code

In a sketch, 13 means digital pin 13, and A0 is a constant that equals 14 on an Uno. LED_BUILTIN is portable across boards. Beyond the classic boards, the numbers printed on the board are not always the chip's own numbers; the core translates between them using a table. The next stand-in models such a table, which is the same idea the core uses (its real table lives in the board's pins_arduino.h):

C Stand-in: a pin-to-port lookup table

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

You will use this relationship directly in Bit Manipulation and Direct Port Access.

Practical tips

  • Keep pins 0 and 1 free while the Serial Monitor is in use.
  • Reserve pins 2 and 3 for interrupt-driven inputs.
  • Use the ~ PWM pins for dimming and motor speed.
  • Draw your pin assignments on paper before wiring: it prevents conflicts, especially with shields.
  • Label the 5V and GND rails on your breadboard to avoid a reversed supply.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which pins on an Uno support analogWrite (PWM)?

    The pins marked with a tilde are connected to hardware timers that generate PWM.
  2. 2. Which two pins carry the I2C bus on an Uno?

    A4 is SDA and A5 is SCL on the Uno R3.
  3. 3. What is the recommended maximum current for a single I/O pin?

    20 mA is the recommended limit; 40 mA is the absolute maximum.
  4. 4. What happens if you feed 12 V into the 5V pin?

    The 5V pin connects after the regulator; use VIN or the barrel jack for higher voltages.

Summary

  • Digital pins 0 to 13 and analog pins A0 to A5 (also digital 14 to 19) carry extra functions: serial, PWM, SPI, I2C, interrupts.
  • The Uno can be powered from USB, the barrel jack or the 5V pin; only the first two are regulated.
  • One pin should supply 20 mA at most and the whole chip about 200 mA; use drivers for bigger loads.
  • Plan pin assignments up front to avoid conflicts.

Next: Compiling and Uploading: The Bootloader