Arduino Uno Pinout | Arduino FAQs
Maybe your like
- TUTORIALS
- HARDWARE & TOOLS
- REFERENCES
- FAQs
- ABOUT US
Arduino Uno is the most common-used board. Let's see its pinout and how to use it.
Hardware Required
| 1 | × | Official Arduino Uno |
| 1 | × | Alternatively, DIYables STEM V3, Fully Compatible with Arduino Uno R3 |
| 1 | × | USB 2.0 cable type A/B (for USB-A PC) |
| 1 | × | USB 2.0 cable type C/B (for USB-C PC) |
| 1 | × | Recommended: Screw Terminal Block Shield for Arduino Uno |
| 1 | × | Recommended: Breadboard Shield for Arduino Uno |
| 1 | × | Recommended: Enclosure for Arduino Uno |
| 1 | × | Recommended: Prototyping Base Plate & Breadboard Kit for Arduino UNO |
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
- pinMode()
- analogRead()
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
- pinMode()
- digitalRead()
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
- pinMode()
- digitalWrite()
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
- pinMode()
- analogWrite()
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
- See the best Arduino kit for beginner
See Also
- How to control speed of servo motor
- error: 'variable' was not declared in this scope
- How to use button to start program
- How to print an empty line on Serial Monitor
- How to vertical and horizontal center align text/number on OLED
※ OUR MESSAGES
- We are AVAILABLE for HIRE. See how to hire us to build your project
- If this tutorial is useful for you, please give us motivation to make more tutorials.
Tag » Arduino Led A0
-
Turn On A Led With A0, A1, A2, A3, A4, A5, A6 - Arduino Forum
-
RGB LED On Analog Pins A0, A1, A2 - Arduino Forum
-
Can You Run An LED With Analog Pins? - Frequently-Asked Questions
-
AnalogRead() - Arduino Reference
-
AnalogWrite() - Arduino Reference
-
Analog Input Pins - Arduino
-
Help Controlling 3 LEDs Based On Analog Output - Arduino Forum
-
Usinga A0-A5 Pins For Analog Output Fade - LEDs And Multiplexing
-
AnalogRead() | Cộng đồng Arduino Việt Nam
-
ESP8266 Analog Reading Read ADC A0 Arduino IDE MicroPython Lua
-
3”, Only Be Used For Output Of An Analog Signal In Arduino? - Quora
-
1.5 Using The Map Function For Analog Results With Arduino
-
Học Arduino Bài 2 : Những điều Cơ Bản Về Arduino - MLAB