An Arduino® is a brand of programmable microcontroller that is often used by hobbyists to interact with other devices. In projects such as robotics and home automation, Arduino® boards are commonly linked to sensors, buttons and motors. Arduino® pins allow users to easily connect a variety of devices and components to the microcontroller. There are three main types of Arduino® pins: digital pins, analog pins and power pins.
Digital pins can be used as both input and output pins on most Arduino® microcontrollers. This means that a single pin can both send and receive digital data. Digital Arduino® pins can be only "high" or "low." When a digital pin is high, a constant voltage is present. When the pin is low, this voltage is gone. Switching a light emitting diode (LED) on and off is one common instance of a digital output, and checking the status of a button is an example of a digital input.
In addition to providing simple inputs and outputs, the digital Arduino® pins of many boards can also be used for pulse-width modulation (PWM). Pulse-width modulation is used to simulate a varying analog output using digital pins. For instance, if a motor is connected to a digital output pin, it would rotate when the pin was brought high and stop when the pin was made low. With PWM, the digital output pin is toggled faster or slower to change the speed of the motor. Pulse-width modulation causes the digital Arduino® pins to switch high and low so quickly that the connection behaves like an analog output, and the resulting voltage through this pin can be precisely controlled.
Arduino® microcontrollers also feature analog input pins. Like digital input pins, these are used to read the state of a connected device, such as a sensor. Although digital pins can only tell if a connection is high or low, analog input Arduino® pins are able to read the exact voltage value. This is useful for interfacing with analog sensors that have a wide range of possible values. For example, analog thermometer sensors often send a voltage reading that corresponds to the temperature. Using an analog input pin, an Arduino® can read the value directly.
The final type of Arduino® pin is the power pin. Most Arduino® microcontrollers have several power pins that receive and output a variety of voltages. One of the most important is the "voltage in" (VIN) power pin. This pin is used to provide constant voltage to power the board from an external power supply or battery. Five-volt (5V) power pins allow components and sensors to receive regulated five-volt power directly from the microcontroller. Finally, ground (GND) power pins can be used to electrically ground devices that are connected to an Arduino®.