Arduino Uno Pinout

Arduino Uno is the most common-used board. Let's see its pinout and how to use it.

Hardware Required

1×Arduino UNO or Genuino UNO
1×USB 2.0 cable type A/B
1×(Optional) 9V Power Adapter for Arduino
1×(Recommended) Screw Terminal Block Shield for Arduino Uno
1×(Optional) Transparent Acrylic Enclosure For Arduino Uno
Please note: These are Amazon affiliate links. If you buy the components through these links, We will get a commission at no extra cost to you. We appreciate it.

Arduino Uno Pinout

Arduino Uno pinout

An Arduino Uno board has:

  • 6 x Analog input pins. They can also be used as digital input/output pins
  • 20 x digital input pins (14 x dedicated digital input + 6 x Analog input pins which can be used as digital input pins)
  • 20 x digital output pins (14 x dedicated digital output + 6 x Analog input pins which can be used as digital output pins)
  • 6 x PWM pins
  • 1 x UART port
  • 2 x I2C port (the same I2C bus)
  • 1 x SPI port
  • 1 x Reset pin
  • 1 x 5v pin
  • 1 x 3.3v pin
  • 3 x GND pin

※ NOTE THAT:

For the pins are named with the prefix of 'D' (e.g. pin D1, D2 ...), It call be called without prefix of 'D', (e.g. pin 1, 2 ...)

Each pin can be used with diferent functionalities. However, at a time, each pin can be used only with one functionalitity.

Let's see how to use them

How To Use

Analog Input Pins

Applicable Pins: A0, A1, A2, A3, A4, A5

Each of analog input pins can be used as:

  • Analog input pin (default)
  • Digital input pin
  • Digital output pin

Related functions

Example Code

// example of how to use analog input pin void setup() { pinMode(A0, INPUT); // setup analog pin } void loop() { int reading = analogRead(A0); }

Because the pin is INPUT by default, you do not need to set up it.

// example of how to use analog input pin void setup() { } void loop() { int reading = analogRead(A0); }

※ NOTE THAT:

  • The pin A4 and A5 can be used for I2C communication. When they are used for I2C, do not use them as analog input.
  • All analog pins can be used as digital input/output pins. See the next part for how to use it.

Digital Input Pins

Applicable Pins:

  • A0, A1, A2, A3, A4, A5
  • D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13

※ NOTE THAT:

  • Pin A0, A1, A2, A3, A4, A5 have other names: , D14, D15, D16, D17, D18, D19, respectively.

Related functions

Example Code

void setup() { pinMode(8, INPUT_PULLUP); // sets the digital pin D8 as input } void loop() { int val = digitalRead(8); // read the input pin }

It is the same for pin A0 to A5:

void setup() { pinMode(A2, INPUT_PULLUP); // sets the digital pin A2 as input } void loop() { int val = digitalRead(A2); // read the input pin }

Digital Output Pins

Applicable Pins:

  • A0, A1, A2, A3, A4, A5
  • D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13

Related functions

Example Code

void setup() { pinMode(7, OUTPUT); // sets the digital pin D7 as output } void loop() { digitalWrite(7, HIGH); // control the output pin to HIGH delay(1000); // pause 1 sec digitalWrite(7, LOW); // control the output pin to LOW delay(1000); // pause 1 sec }

It is the same for pin A0 to A5:

void setup() { pinMode(A3, OUTPUT); // sets the digital pin A3 as output } void loop() { digitalWrite(A3, HIGH); // control the output pin to HIGH delay(1000); // pause 1 sec digitalWrite(A3, LOW); // control the output pin to LOW delay(1000); // pause 1 sec }

PWM pins

Applicable Pins: D3, D5, D6, D9, D10, D11

Related functions

Example Code

void setup() { pinMode(5, OUTPUT); // sets the pin D5 output } void loop() { analogWrite(5, 100); // analogWrite values from 0 to 255 }

UART Port

Applicable Pins: D0 (RX), D1 (TX)

See Arduino - Serial

I2C Port

Applicable Pin:

  • A4 (SDA), A5 (SCL)
  • D18 (SDA), D19 (SCL)

※ NOTE THAT:

  • Pin A4 is internally connected to pin D18
  • Pin A5 is internally connected to pin D19

Multipe I2C devices can share the same I2C bus. That is because the I2C devices are addressed by a value in data frame

SPI Port

Applicable Pin: MOSI(D11), MISO(D12), SCK(D13), SS(D10)

Please note that the SS pin is default to D10 and it can be changed

Reset Pin

If this pin is connected to GND, Arduino is reset.

See also: How to reset Arduino by programming

5v Pin, 3.3v Pin, GND Pin

See also: How to use more GND/VCC pins on Arduino

Buy Arduino

1 × Arduino UNO Buy on Amazon
1 × Arduino MEGA Buy on Amazon

The Best Arduino Starter Kit

※ OUR MESSAGES