Arduino UNO
Overview
    Arduino Uno is a microcontroller board based on 8-bit ATmega328P
    microcontroller. Along with ATmega328P, it consists other components such
    as crystal oscillator, serial communication, voltage regulator, etc. to support
    the microcontroller. Arduino Uno has 14 digital input/output pins (out of
    which 6 can be used as PWM outputs), 6 analog input pins, a USB
    connection, A Power barrel jack, an ICSP header and a reset button.
    The Arduino Uno is an open-source microcontroller board that is based on the
    Microchip ATmega328P (for Arduino UNO R3) or Microchip ATmega4809 (for
    Arduino UNO WIFI R2) micro-controller by Atmel and was the first USB
    powered board developed by Arduino.
    Both Atmega328 and ATmega4809 have a built-in bootloader, which makes it
    very convenient to flash the board with our code. Like all Arduino boards, we
    can program the software running on the board using a language derived from
    C and C++. The easiest development environment is the Arduino IDE.
    How to use Arduino Board
    The 14 digital input/output pins can be used as input or output pins by using
    pinMode(), digitalRead() and digitalWrite() functions in arduino programming.
    Each pin operate at 5V and can provide or receive a maximum of 40mA
    current, and has an internal pull-up resistor of 20-50 KOhms which are
    disconnected by default. Out of these 14 pins, some pins have specific
    functions as listed below:
   Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and
    transmit TTL serial data. They are connected with the corresponding
    ATmega328P USB to TTL serial chip.
   External Interrupt Pins 2 and 3: These pins can be configured to trigger
    an interrupt on a low value, a rising or falling edge, or a change in value.
   PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by
    using analogWrite() function.
   SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are
    used for SPI communication.
   In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13
    is HIGH – LED is on and when pin 13 is LOW, its off.
    Along with 14 Digital pins, there are 6 analog input pins, each of which
    provide 10 bits of resolution, i.e. 1024 different values. They measure from 0
    to 5 volts but this limit can be increased by using AREF pin with analog
    Reference() function.
   Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using
    Wire library.
    Arduino Uno has a couple of other pins as explained below:
   AREF: Used to provide reference voltage for analog               inputs   with
    analogReference() function.
   Reset Pin: Making this pin LOW, resets the microcontroller.
    Communication
    Arduino can be used to communicate with a computer, another Arduino
    board or other microcontrollers. The ATmega328P microcontroller provides
    UART TTL (5V) serial communication which can be done using digital pin 0
    (Rx) and digital pin 1 (Tx). An ATmega16U2 on the board channels this serial
    communication over USB and appears as a virtual com port to software on
    the computer. The ATmega16U2 firmware uses the standard USB COM
    drivers, and no external driver is needed. However, on Windows, a .inf file is
    required. The Arduino software includes a serial monitor which allows simple
    textual data to be sent to and from the Arduino board. There are two RX and
    TX LEDs on the arduino board which will flash when data is being transmitted
    via the USB-to-serial chip and USB connection to the computer (not for serial
    communication on pins 0 and 1). A SoftwareSerial library allows for serial
    communication on any of the Uno's digital pins. The ATmega328P also
         supports I2C (TWI) and SPI communication. The Arduino software includes a
         Wire library to simplify use of the I2C bus.
         Pin Description
Pin              Pin Name                Details
Category
Power            Vin, 3.3V, 5V, GND      Vin: Input voltage to Arduino when using an external
                                         power source.
                                         5V:   Regulated    power      supply   used   to   power
                                         microcontroller and other components on the board.
                                         3.3V: 3.3V supply generated by on-board voltage
                                         regulator. Maximum current draw is 50mA.
                                         GND: ground pins.
Reset            Reset                   Resets the microcontroller. If this pin is supplied with
                                         5 V, the board will reset automatically
Analog Pins      A0 – A5                 Used to provide analog input in the range of 0-5V
Input/Output Digital Pins 0 - 13         Can be used as input or output pins.
Pins
Serial           0(Rx), 1(Tx)            Used to receive and transmit TTL serial data.
External         2, 3                    To trigger an interrupt.
Interrupts
PWM              3, 5, 6, 9, 11          Provides 8-bit PWM output.
SPI              10 (SS), 11 (MOSI), 12 Used for SPI communication.
                 (MISO) and 13 (SCK)
Inbuilt LED      13                      To turn on the inbuilt LED.
TWI              A4 (SDA), A5 (SCA)      Used for TWI communication.
AREF             AREF                    To provide reference voltage for input voltage.
    Arduino Uno Technical Specifications
    Microcontroller                     ATmega328P – 8 bit AVR family microcontroller
    Operating Voltage                   5V
    Recommended Input Voltage           7-12V
    Input Voltage Limits                6-20V
    Analog Input Pins                   6 (A0 – A5)
    Digital I/O Pins                    14 (Out of which 6 provide PWM output)
    DC Current on I/O Pins              40 mA
    DC Current on 3.3V Pin              50 mA
    Flash Memory                        32 KB (0.5 KB is used for Bootloader)
    SRAM                                2 KB
    EEPROM                              1 KB
    Frequency (Clock Speed)             16 MHz
   Length:6 mm
   Width:4 mm
   Weight: 25 g
    Voltage Regulator-The voltage regulator converts the input voltage to 5V.
    The primary use of a voltage regulator is to control the voltage level in
    the Arduino board. Even if there are any fluctuations in the input supply
    voltage of the regulator, the output voltage remains constant and near 5 volts.
    Crystal Oscillator– The Crystal oscillator has a frequency of 16MHz, which
    provides the clock signal to the microcontroller. It provides the basic timing
    and control to the board.
    RESET Button–It is used to reset the board. It’s recommended to press this
    button every time we flash the code to the board.
    Barrel Jack – The Barrel jack or DC Power Jack is used to power the Arduino
    board using an external power supply. The barrel jack is usually connected to
    an adapter. The board can be powered by an adapter that ranges between 5-
    20 volts but the manufacturer recommends keeping it between 7-12 volts.
    Note: Above 12 volts, the board may overheat and below 7 volts, the voltage
    might not be sufficient to power the board.
    USB B-port–The USB Interface is used to plug in the USB cable. This port can
    be used to power the device from the 5V supply. It allows us to connect the
    board to the computer. The program is uploaded to the board serially from the
    computer through the USB cable.
    Vin–It is the modulated DC supply voltage, which is used to regulate the IC’s
    used in the connection. It is also called the primary voltage for IC’s present on
    the Arduino board. The Vcc voltage value can be negative or positive to the
    GND pin.
    SPI stands for Serial Peripheral Interface. It is used by microcontrollers to communicate with
    one or more peripheral devices quickly.
   SCK-It stands for Serial Clock. These are the clock pulses, that is used to
    synchronize the transfer of data.
   MISO-It stands for Master Input/ Slave Output. This data line in the MISO
    pin is used to receive the data from the Slave.
   MOSI-It stands for Master Output/ Slave Input. This line is used for sending
    data to the peripherals.
   SS-It stands for Slave Select. This line is used by the master. It acts as the
    enable line. When a device’s Slave Select pin value is LOW, it can
    communicate with the master. When it’s value HIGH, it ignores the master.
    This allows us to have multiple SPI peripheral devices sharing the same
    MISO, MOSI, and CLK lines.
    Arduino Uno Pinout – Analog Pins:
          The Arduino Uno consists of 6 analog pins, which use ADC (Analog to
           Digital converter). These pins can serve as analog inputs but can also
           function as digital inputs or digital outputs. These pins accept inputs in
       the form of Analog signals and return values that range between 0 and
       1023 (because the Arduino Uno has a 10-bit Analog to Digital
       converter or 210 resolution).
      An Analog to digital converter works in three stages: sampling,
       quantization, and digitization. Because the Arduino operates on a 0–5
       volts range, the step size of the device is
       5/1023=0.00488volts or 4.88mV.
      Thus, we can interpret a 4.88 mV input voltage to any of the analog pins
       as 1, 9.77 mV as 2, and so on until 5 V as 1023. Anything below 4.88
       mV is considered 0 and above 4.99 V as 1023.
Arduino Uno Pinout – Digital Pins:
On the Arduino UNO board, pins 0-13 are digital input/output pins.
The Arduino digital pins can read only two states: when there is a voltage
signal and when there is no signal. This kind of input is usually called digital
(or binary) and these states are referred to as HIGH and LOW or 1 and 0.
LED (13): On the board, there is a built-in LED connected to digital pin 13.
When this pin is HIGH or 1, the LED is switched on, when the pin is LOW or 0,
it’s switched off.
PWM pins:
If you look closely, you will find the ‘~’ symbol on digital pin 3,5,6,9,10, and 11.
These pins have an additional feature called PWM. Hence these pins are
called PWM pins.
PWM stands for “Pulse Width Modulation”. It means, that an analog value is
being modulated on a digital signal. Suppose you want a DC motor to run at a
certain analog voltage between 0 and 5 V. This is not possible because the
Arduino board is MOSFET-based.