Arduino Uno is known as an open-source development board as it allows you to use this board to interact with real-world things by uploading programs on this board. There are many other microcontrollers like PIC microcontrollers, ST microcontrollers, Texas microcontrollers but Arduino is used mostly as it is inexpensive and can be used in various forms. It is based on ATMEL ATmega328p microcontroller.
It can interact with anything that is controlled by electricity in any way. It can also interact with motors, sensors, and electromagnets. In short, we can make devices that react and respond to the world by using this board. In short, we can say that Arduino is the brain of thousands of projects.
Different types of ARDUINO UNO Boards
Arduino makes a different type of development boards and each having different capabilities. Like Arduino Mega, Arduino UNO, Arduino Nano, Lily Pad Arduino, and much more because as advance our projects are, Arduino keeps on updating its development board to keep teachers, students and other interested people updated as these boards are being used in scientific research as well as many other advanced fields of robotics and many other fields. These boards are commonly used as they are inexpensive, cross-platform (IDE software which is used to make a code for these development boards can run on Linux, OSX and Windows operating system while some boards are limited only to windows), extensible and open-source hardware and software.
ARDUINO Uno Introduction
Arduino UNO is one of the famous microcontroller boards of the Arduino family and is developed by Arduino.cc. Basically Arduino.cc is an open-source platform and is mainly based upon AVR microcontroller Atmega328. It is one of the most economical boards of Arduino family and is widely used because of its small number of input-output pins and reduced size as compared to Arduino mega which is the big brother of Arduino UNO. In this article, we are going to briefly discuss Arduino UNO. We will discuss its specifications, pin configuration, dimensions, shields compatibility, software for coding, applications and projects in which this board is used.
Arduino Uno Pinout Diagram
Pinout diagram shows that each pin has multiple functions such as PWM, interrupts, general-purpose input-output and analog channel. But we can use only one function of each pin at a time. It consists of a total of 14 GPIO pins. Not all pins have a PWM feature.
Pin Configuration Description and their use
In this section, we will see the function of each pin. How can we initialize these pins for a specific feature?
As mentioned in the last section, Arduino Uno has fourteen digital I/O pins. We can use all these pins either as digital input pins or digital output pins. These pins have only 2 states i.e. high or low or in simple words either 5 V or 0 V no in-between values. These pins are mostly used to sense the digital voltage level presence when the switch is open or closed). For example, when the switch connected with Arduino Uno digital input is open, it will sense zero voltage level. If the switch is closed, it will sense 5 volts.
- To initialize any pin as an input or output, we use pinMode(pin_number, mode) function. For example, using this function like this ‘pinMode(13, OUTPUT)’ will initialize the pin number 13 as a digital output pin.
- Similarly this ‘pinMode(13, INPUT)’ will initialize the pin as a digital input pin.
- digitalWrite(pin_number, state) function makes the digital output pin active high or low depending state parameter. This parameter can be either HIGH or LOW.
- digitalRead() function read the state of a digital input pin and returns either logic high or low according to the voltage level on the input pin.
For further information, you can check these examples:
Analog Channel Pins
Arduino Uno offers six analog channels. The header on the left side of the board has all these analog pins together. This diagram shows the Pinout location of the analog pins.
Starting from A0 to A5 and they come up with a resolution of 10 bits. They provide the flexibility of connecting any external analog device with these pins. These pins can read analog voltage from 0 V to 5 V. But they can be configured to lower range by using the AREF pin or analogReference () function available in Arduino IDE. But the maximum voltage we can read directly with these analog channels is 5 volts. However, we can use step down voltage circuits to measure higher voltage.
ADC (analog to digital converter) is used to sample these pins. These pins take an analog signal and by using ADC convertor they convert this analog signal to digital number between 0 – 1023.
Analog channel Examples
To use analog channels, we use this function
int analogoutput = analogRead(int pin_number);
analogRead() function reads the analog voltage from a pin number specified as an argument to this function. We save the output value in an integer type variable.
If you want to explore further about these pins, you can check these tutorials and projects:
- How to use AnalogRead in Arduino with example
- Analog voltage reading using Arduino UNO R3
- ac voltage measurement using Arduino: ac voltage detector
Arduino PWM Pins
Development Board has 14 GPIO pin. But, only six of them have a pulse width modulation feature. Pin number, 5, 6, 9, 10, and 11 provide PWM output. All of them have an 8-bit resolution.
It is just like an analog output function. PWM controls LEDs, motors and other actuators. The analogWrite(pin_number, duty_cycle) function provides PWM output with a specified duty cycle. The duty cycle can vary between 0-100% or 0-255. For example, analogWrite(5, 127) function generates a PWM on pin number 5 with a duty cycle of 50%. To explore further, check this example tutorial:
- USB port
- TX and RX pins (for serial communication)
- SPI (serial peripheral interface)
- External adaptor to deliver power to this board by external power supply up to 12 volts (board will make use of its voltage regulator and will make this voltage up to 5 V or 3.3 V as per our requirements)
- Reset Pin: Used to reset our whole board and takes it to the initial stage of the running program. For instance our board gets hang in the middle of our running program then we can make use of this pin and this pin will clear everything up and starts program from beginning
- ICSP connector (Used to bypass USB port and interfacing our board directly as serial device. This port is essential to reboot load our chip if it gets corrupted and we are not able to talk to our computer)
MEMORY of ARDUINO UNO
- Flash Memory: 13KB (used to store a number of instructions in code form)
- SRAM of 2 KB
- 1 KB EPROM
KEY FEATURES of ARDUINO UNO
- 16 MHz crystal oscillator
- Operating voltage is 5 V and it can be achieved by using a USB port or by using an external adaptor.
- An external micro SD card is supported
- This board comes with a built-in feature of voltage regulation i.e. when the device is connected to other external devices it keeps voltage under control thus preventing the board from damage.
- Easy USB interface i.e. simply plug your external device with this port and your device is ready to use. This interface is also used to register your board as a virtual serial port on your computer and the advantage is that this type of serial communication setup is extremely easy and convenient.
- 16 MHz clock makes it fast enough for most of the applications.
- Onboard LED for easy and fast debugging of our code
- Micro SD cards can be used if the functionality or nature of our project goes complex to make our board store more information.
ARDUINO UNO PROGRAMMING
- Like other development boards of Arduino family, this also uses Arduino IDE software to make sketches (Arduino programs are called sketches)
- Sketches that are developed on Arduino IDE can be transferred directly by connecting our computer via USB port.
- IDE is compatible with Linux, MAC or Windows operating system
- Programming languages C and C++ are used
- Thousands of preloaded sketches are easily available which we can use in order to get Arduino to do something according to our requirements.
Read this complete guide: Getting started with Arduino Programming
CODING of ARDUINO UNO
Important things to remember when you are going to write code:
- The sketch is an Arduino program
- All code in Arduino sketch is going to process from top to bottom
- These sketches are usually broken in 10 parts:
- It starts with a header that explains what we are going to do in our sketch
- Global variables are defined
- Constant names are assigned to different Arduino pins
- Initial variables are set and configured
- After initial variables setting, it begins with a setup routine in which we set initial conditions of variables if needed
- Run preliminary code that we want to run only once and at this point serial communication is initiated for running serial monitor
- From the setup function, we jump to loop routine and keep in mind that it is the main routine of sketch
- The loop routine will be executed over and over as long as our sketch continues to run.
- After loop routine, many user-defined functions are listed and these functions work only when they are called in setup or loop function
- Execution of these user-defined functions depends on whether they are called in setup function or loop function. Whenever a user-defined function is called it goes to that function execute it and then comes back to the exact next line of sketch from which that function was called.
- Only 2 parts of the sketch are mandatory i.e. loop and setup function
SHIELDS COMPATIBILITY of ARDUINO UNO
In order to make our Arduino UNO perform a special function, we will use shields (an expensive adaptor plugged over top of the board). A countless number of Arduino shields are available. The selection of shields depends on the requirement and functionality of our project. Before buying any shield, make sure that the operating voltage of that shield doesn’t exceed the voltage of our board otherwise it will destroy our board. So after making sure of its operating voltage we can use any one of the shields available in the market. Some of the important shields which are widely used are listed below:
- Ethernet Shield
- Wireless Shield
- Motor Shield
APPLICATIONS of ARDUINO UNO
As discussed earlier, the most economical and inexpensive board is Arduino UNO. So a wide number of applications are supported by this board. Some important applications that are developed using Arduino UNO are listed below
- Embedded system
- Motion control rig
- DC motor control ( using H-bridge )
- Ardupilot ( drone hardware and software )
- Defense and security defense
- Parking lot counter
- Home and industrial automation
- Game Duino ( for creating retro 2D games )
- Water quality testing
- Data loggers ( used in scientific research )
- Xoscillo ( open-source oscilloscope )
- Count down timer for traffic lights
That brings today’s report to an end. If you have any questions regarding this then you can ask your queries in the comment section below.