In this blog, let's look at the Arduino pin configuration of different boards. Before starting any project make sure that we understand the pin configuration of the board. Pin configuration of any board is nothing but it tells what each pin is used for.
Before going through the pin configuration of individual boards let's see some general pins and their definitions which are common to all the boards.
Understanding these definitions will help you in programming any of the below Arduino boards and connecting the external hardware like input( sensors)Â and output devices( LEDs, actuators) to the board. Also, some of these pin definitions are common to other non-Arduino boards like esp, stm32, etc boards as well. So stay tuned, take time and understand these definitions properly so that we can go through the pin configuration of any kind of board instantly.Â
Â
5V:Â
This pin outputs 5V to external components like resistors, LEDs, etc.Â
It provides a regulated 5V power supply.Â
Note: Board should be supplied power from the USB connector (5V) or DC power jack ( 7-12V) or Vin pin of the board (7-12V). If you give the power supply to the board through this 5V or 3.3V pin it will bypass the voltage regulator and can damage the Arduino board.
Â
3.3V:Â
This pin on the board outputs 3.3V which can be power supply external components.
GND:Â
This can be used to make the common ground for external circuits and Arduino boards.
Vin:Â
A voltage input pin is used to provide an external power supply ( 7-12V) to the board.
Reset:Â
To reset the microcontroller i.e. it starts the execution of the program from the beginning again. It is similar to unplugging and then plugging back the USB. Make it low to reset the MCU.
Â
read more :Â What is Arduino UNO
Analog:Â
These pins are used to read analog input from the sensors and they are 0-5V compatible.
They can act like digital pins too in Arduino boards.
Digital:Â
These pins can provide digital input and output.
External interrupt:Â
These pins are used to generate external interrupts.Â
Example:Â
attachInterrupt(DigitalPinToInterrupt(pin),ISR,mode);
pin: Arduino interrupt pin number
ISR (Interrupt Service routine
Whenever the interrupt is raised MCU stops its Normal execution and jumps to ISR.
Note: This function should not have any parameters and its return type is void.
The mode defines when the interrupt should be triggered. It can take 4 values:
1. LOW to trigger the interrupt when the pin is lowÂ
2. CHANGE to trigger the interrupt whenever the interrupt pin changes its value
3. RISING to trigger the interrupt whenever the interrupt pin goes from low to high
4. FALLING to trigger the interrupt whenever the interrupt pin goes from high to low.
Due board allows HIGH mode too which triggers the interrupt whenever the pin is high.]
This instruction configures the particular pin as an external interrupt pin. When an interrupt occurs which depends on the mode MCU jumps to ISR.
Â
read more :Â How NRF24l01 Arduino Nano Works
Â
PWM(Pulse Width Modulation):Â
These pins are used to generate an analog signal from a digital signal by varying the width of the digital pulse. These pins are usually marked by a ~ sign on the Arduino board for identification.
Serial /UART :Â
Used to communicate between Arduino and computer or external device.
To do communication via UART it uses two pins in its communication protocol/
Tx: To transmit data and Rx: To receive data.
Â
I2C :Â
I2C(Inter-Integrated Circuit) pins are also used for communicating between board and external devices.Â
It uses two pinsÂ
SDA( Serial Data): to send the data.
SCL ( Serial Clock): for synchronization between the devices at a predefined baud rate.
SPI :Â
These pins are used to do SPI ( Serial Peripheral Interface ) communication.
It uses 4 pins:
MISO( Master in Slave out): To send data from slave to master.
MOSI ( Master out Slave in): To send data from master to slave.
SCK ( Serial clock): To synchronize communication.
CS(chip select) or SS ( Slave select) : To select the slave for communicationÂ
Â
read more :Â What is Arduino Nano
Â
Pin-connected to onboard led:Â Â
All boards have a pin connected to an inbuilt LED, which helps troubleshoot if the board is working fine.
Â
NC:
Not connected internally.
Pins used beyond simple projects:
Â
Aref:Â
It is used to provide an analog reference voltage to ADC from an external power supply.
Example: If we want to measure voltages with a max range of 3.3V ( eg. 3.3V Lora module) we would feed a constant 3.3V into the Aref pin from a voltage regulator.
Â
ICSP pins:Â
Helpful when your USB port of the Arduino is broken. These pins are used to code and boot an Arduino from an external source. These pins act like an AVR programmer and are used to boot or upload firmware to the Arduino.
For more information on pins refer datasheet of the respective microcontroller used in the board.
Â
Note: 5V, 3.3, Reset, Vin, and Aref are labeled on the board.
Arduino Uno (R3)
The most popular board among Arduino boards is Arduino Uno. A lot of electronic hobbyists prefer this board to its ideal size, cost, and features it supports.
The below image gives the pin configuration for this board. You can also see how different pins are connected to the internal MCU pins.
Â
Â
Image Source: electronicshub.org
Highlighted below are some of the important and commonly used MCU pin connections to the board. Keeping this in handy will help during your projects for making connections to external hardware.
Â
read more :Â Difference Between Arduino and Raspberry PiÂ
Â
External interrupt
[2] -Â 2, 3
[number in the bracket indicates the number of pins/modules available on the board]
Analog pins [6]: A0-A5 pins.
Â
Digital Pins
[14]: 0-13 pins.
PWM [6]: 3,5,6,9,10,11 (490 Hz except 5 and 6 which run on 980 Hz)
Â
Serial
[1] : 0 (RX) 1 (TX)
Â
I2C
A4 (SDA) , A5 (SCL)
Â
SPI
10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).
DC Current per I/O pin: 20mA
DC current for 3.3V pin: 50mA
Arduino Mega (R3)
There will be times when you will run out of pins on Arduino Uno while doing large projects. Then you will have to shift to Arduino mega. It has got a bunch of peripherals and GPIO pins.
The below image gives the Pin configuration for Arduino Mega
Â
Â
Following is the list of frequently used connections of the MCU peripherals to the boardâs pins for Mega:
Â
read more :Â Arduino VS NodeMCU
Â
External interrupt
[6] : Digital pin 2,3,18,19,20,21.( pins 20 and 21
Are not available to use for interrupts while they are used for I2C communication.)
Â
Analog
[16] : A0-A15
Â
Digital
[54] : 0-53
Â
PWM
[15] : 2-13, 44-46. (490 Hz except 4 and 13 which use 980 Hz)
Â
Serial
[4] : 0 (RX) 1 (TX); 19 (RX1) 18 (TX1); 17 (RX2) 16 (TX2)
I2C
[1]: 20 (SDA) 21 (SCL)
Â
SPI
[1]: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).
DC per I/O pin 20mA
DC current for 3.3V 50mA
Arduino NanoÂ
Each board has got unique qualities. As the name suggests its size is nano meaning very small and it can directly fit on a breadboard making connections very easy and fast for testing + supporting USB connections!
Â
read more :Â Which Arduino Board to Buy
Â
The below image gives the Pin configuration for Arduino Nano.
Â
Â
Following is the list of frequently used connections of the MCU peripherals to the boardâs pins for Nano:
Â
External interrupt
[2] : 2, 3
Â
Analog
[8]: A0-A7.
Â
Digital
[22]: D0-D13, A0-A7.
Â
PWM
[6]:Â 3,5,6,9,10,11 (490 Hz except 5 and 6 which run on 980 Hz)
Â
Serial
[1]: 0 (RX) and 1 (TX).
I2C
[1]: A4 (SDA), A5 (SCL).Â
Â
SPI
[1]: 10(SS), 11(MOSI), 12 (MISO), 13 (SCK).
Â
DC Current per I/O: 40mA
Arduino Leonardo
This board combines USB support ( which Arduino Uno and Mega don't have ) and a power jack for the power supply. ( which nano doesn't have).
The below image gives the Pin configuration for Arduino Leonardo.
Â
Â
Following is the list of frequently used connection of the MCU peripherals to the boardâs pins for Leonardo:
Â
External interrupt
[4]Â : 0, 1, 2, 3, 7
Â
Analog
[12] : A0-15, A6-A11 (4,6,8,9,10,12)
Â
Digital
[20] : 0-13, SCL, SDA and A0-A5.
Â
PWM
[7] : 3,5,6,9,10,11,13. (490 Hz except 3 and 11. They use 980Hz)
Â
Serial
[1] : 0 (RX) and 1 (TX).
I2C
[1] : SDA and SCL.
Â
SPI
[1] :Â
These pins are on the ICSP header. SPI pins on this board are not connected to any of the digital I/O.
Current per IO 40mA
Current for 3.3V pin 50mA
Â
read more :Â Arduino Uno Pin Diagram: A Complete Guide
Arduino Due
The main difference between Arduino mega and Due is that Arduino due processor uses a 3.3V voltage level which reduces the power consumption of the MCU. So if you make a robot that uses too many peripherals and you want the robotâs battery to last longer then you would go for this board. Moreover, it also comes with a JTAG interface for testing.
The below image gives the Pin configuration for Arduino Due
Â
Â
Following is the list of frequently used connections of the MCU peripherals to the boardâs pins for Due:
External interrupt
All digital pins
Â
Analog input
[12] : A0-A11
Â
Analog output
[2]: DAC0 and DAC1.
Â
Digital I/O
[54] : 0-53
Â
PWM
[12] : 2-13 (1000Hz)
Â
Serial
[4] : 0 (RX0) 1 (TX0) 14 (TX3) 15 (RX3) 16 (TX2) 17 (RX2) 18 (TX1) 19 (RX1).
I2C/TWI
[2] : 20 (SDA) 21 (SCL), SCL1, SDA1
Â
SPI
[2]: Has two SPI buses but the Arduino library just supports one. Refer to the image and you could see the SPI âheader.â( in the image labeled as SPI for SAM3X8E).
Total allowable DC output current on all I/O lines 130mA
Current for 3.3V pin 800mA
Current for 5V pin 800mA
Â
JTAG header:
Used for in-system debugging to test interconnections/traces between different peripherals of the PCB while the program is running on the MCU.
Instead of using the traditional probing method i.e. taking a multimeter and testing the PCB for fault, we can use JTAG to detect this. It reduces the test time of embedded products.
A BSDL(Boundary-scan description language) file is used for the application of boundary-scan testing using JTAG. It represents how the boundary scan TAP pins, TAP instructions, device pins, and boundary register pins and cells are related.
Arduino Due board runs at 3.3V compared to the other counterparts which run at 5V.
Â
read more :Â Compatible Arduino Boards: Everything You Need to Know
Lilypad Arduino
LilyPad boards are made to be sewn together using conductive threads to build soft,sewable, interactive e-textile (electronic textile) projects.
LilyPad doesn't have a USB to UART converter so you will need a converter like FTDI to program LilyPad.
Â
Â
The below image gives the Pin configuration for Arduino LilyPad.
Â
Â
Following is the list of frequently used connections of the MCU peripherals to the boardâs pins for Arduino LilyPad:
Â
External interrupt
Analog
[6]: A0-A5
Â
Digital
[14] : 0-13
Â
PWM
[5] : 5,6,9,10 and 11.
PWM pins are not marked with a ~ sign.
Â
Serial
[1] : 0 (RX) and 1 (TX)
Â
I2C
[1] : A4 (SDA) and A5 (SCL)
Â
SPI
[1] : 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK).
DC current per IO 40mA.
You can provide a max of 5.5V to LilyPad Arduino.
Â
read more :Â Interfacing ACS712 with Arduino
Arduino Micro
Compared to nano this board comes with slightly more peripherals than nano to meet your project needs.
The below image gives the Pin configuration for Arduino Micro.
Following is the list of frequently used connections of the MCU peripherals to the boardâs pins for Micro:
Â
External interrupt
[4] : 0,1,2,3,7.
Â
Analog
[12] : A0-A5,4,6,8,9,10,12
(Note: some pins overlap with digital pin)
Â
Digital
[20] : 0-19
Â
PWM
[7] :Â 3,5,6,9,10,11 and 13.
Â
Serial
[1] : 0 (RX) and 1 (TX)
Â
I2C
[1] : 2 (SDA) and 3 (SCL)
Â
SPI
[1] : MISO, MOSI, SS, and SCK.
Â
Current per I/O pin:
20mA
Current for 3.3V: 50mA
Vin - 6-9V
Arduino Pro Mini
This board is cheaper than micro but requires an external FTDI programmer. Also, it consumes less power than micro
The below image gives the Pin configuration for the Arduino Pro mini.
Â
Â
Following is the list of frequently used connections of the MCU peripherals to the boardâs pins for Pro Mini:
Â
External interrupt
[2]: pin 2 and pin 3.
Â
Analog
[6]: Pins A0 to A5.
Â
Digital
[14] : 0-13.
Â
PWM
[6] : Pin nos. 3,5,6,9,10 and 11.
Â
Serial
[1] : Pin 0 (RX) and Pin 1 (TX).
I2C
[1] : Pin nos. A4 (SDA) and A5 (SCL).
Â
SPI
[1] : Pin nos. 10(SS), 11(MOSI), 12 (MISO), 13 (SCK).
LED: Pin 13
DC current per IO : 40 mA
Â
read more :Â IR Sensor Interfacing with Arduino
Conclusion
In this blog post, we have learned that understanding the pin configurations of various Arduino boards can greatly enhance your ability to create innovative and unique projects. Whether you're using the versatile ARDUINO UNO (R3), the powerful ARDUINO MEGA (R3), or any of the other boards such as ARDUINO NANO, ARDUINO LEONARDO, ARDUINO DUE, LILYPAD ARDUINO, ARDUINO MICRO and ARDUINO PRO MINI, knowing how to properly connect your sensors and components can make all the difference. So dive in and start exploring the endless possibilities of Arduino today! And remember, with the right knowledge and creativity, you can bring any idea to life.
Â
If you appreciate our work don't forget to share this post and leave your opinion in the comment box.
Â
Please do check out other blog posts about Interfacing ACS712 with Arduino , Arduino Interfacing with Ultrasonic Sensor , LED Interfacing with Arduino , Interfacing GSM Module with Arduino , Interfacing MAX30100 Pulse Oximeter with Arduino , IR Sensor Interfacing with Arduino , How to connect ZMPT101B to Arduino and  How to use Buzzer with Arduino.
Â
Make sure you check out our wide range of products and collections (we offer some exciting deals!)