> For the complete documentation index, see [llms.txt](https://monasheng.gitbook.io/zerotohero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monasheng.gitbook.io/zerotohero/arduino-zero-to-hero/core-skills/input-output-pins.md).

# Input/Output Pins

{% embed url="<https://youtu.be/laFiysEPMdw>" %}

{% hint style="info" %}
:man\_mage: **Important:** Arduino boards supply a variety of hardware input/output (AKA *I/O*) pins for interacting with the real world.&#x20;

These pins are essentially metal conductors that provide a way for you to connect the miniature computer on-board the Arduino to an electrical circuit.
{% endhint %}

## Pin Headers

Pins are accessible through *pin headers* - plastic housings that hold a metal conductor vertical and evenly spaced, normally at an $$0.1\text{"}$$ ($$2.54;\text{mm}$$) pitch.&#x20;

Headers come in *male* and *female* varieties, and these are designed to mate with eachother.

<div data-full-width="false"><figure><img src="/files/SyVbYg1R0pZhd8zzweSQ" alt=""><figcaption><p>Pin headers have 'connection points', which are used to interface with headers of opposite gender, and 'solder points', which are used to interface with a printed circuit board or breadboard.</p></figcaption></figure></div>

Arduino boards use *female* header pins on board, meaning that *male* header pins on mating, adjacent PCBs (sometimes called 'Shields'), or 'jumper wires' can be plugged directly into them to interact with a circuit.

<figure><img src="/files/yCyczWJAqp3pCR1YXMqG" alt=""><figcaption><p>The Arduino Mega has female pin headers on-board. If the spacing is right, you can plug printed circuit boards (sometimes called 'shields') straight onto these. You can also use 'jumper wires' to make connections to breadboards, sensors, servo motors, etc.</p></figcaption></figure>

Some I/O pins can only be used for certain functions - for instance, [Digital Pins](/zerotohero/arduino-zero-to-hero/core-skills/input-output-pins/digital-pins.md) are used for authoring or measuring binary (on/off) signals, while [Analog Pins](/zerotohero/arduino-zero-to-hero/core-skills/input-output-pins/analog-pins.md) are a bit more versatile, and able to interact with signals that vary between these states.

Furthermore, some pins within these categories have additional functions (e.g. can also be used for advanced communication protocols, or to interact with the [Serial Monitor](/zerotohero/arduino-zero-to-hero/core-skills/serial-monitor.md)). You can usually determine which pins can be used for which purpose from the *pinout datasheet* for your MCU.

## Arduino Mega Pinout Datasheet

{% file src="/files/lqtVamJ8lJNqYXs8C4Ta" %}
