Interfacing and Controlling LEDs using Arduino UNO
Project: 2
- Aug'20
What is the project about?
The term Arduino was always trending on my campus. Workshops were conducted on it regularly. But I stayed away from them all because of a general disregard I had for workshops. They just weren't my cup of tea (quick flashback of the only workshop I ever attended). But well, I got tired of 'tea' last month. That is when I stumbled upon a course on Internet of Things by Prof Ian Harris on Coursera. Refrigerators which would order and stack up on my favourite food, and optical lenses that would save my friend from the embarrassment of forgetting names. But how could these be done? Using Arduino of course.
Understanding the Working
What is an Arduino?
In the most simple terms, an Arduino is a tool that helps in performing simple and complex electronic tasks. It can measure real-world parameters by controlling connected equipment and perform tasks depending on the result obtained.
An Arduino is an open-source electronics circuitry which is versatile and has endless possibilities of use. What it means to be open-source is that it can be freely and lawfully modified and redistributed by individuals or companies for commercial as well as personal use. Arduino comprises both hardware and software. The most significant hardware component is a micro-controller which can be programmed appropriately to accomplish an innumerable variety of tasks.
Owing to its versatility and flexibility, it has a wide range of applications ranging from controlling an LED to reading complex data in real-time. The Arduino can be used as the brain behind almost any electronics project (ranging from robots to honest fortune-telling machines). Quite a few versions of Arduino boards exist and they are constantly improved. The most popular among them with beginners is Arduino UNO. It is the cheapest Arduino and add-ons to integrate features like WiFi, Bluetooth, and LED display are readily available for it.
An Arduino board by itself is capable of connecting with a computer via a special USB cable known as type B to type A. But popular phone charger cables are type A to micro-sim or type A to type C, so you might need to purchase this cable separately unless you have a printer or something similar which typically uses this cable. Other boards need separate hardware components to establish the connection. Arduino Uno does not need external hardware for this purpose because of a USB interface chip built into it. It also comes pre-programmed with a boot-loader that enables uploading new code into the microcontroller again without the need for external hardware.
Arduino codes are written in C / C++, generally in its recommended software called Arduino IDE which is also open-sourced. This code configures the hardware and is uploaded on to the micro-controller using the in-built boot-loader.
Let us comprehend the working of an Arduino Uno with a simple example. Say the objective is to blink an LED. The first step is to write a suitable code in the IDE software in C programming. Due to its wide community base, Arduino has well-developed library functions that make most tasks easier. The code is then uploaded onto the board and stays in its micro-controller memory in a part called Flash memory which we will discuss in detail later. The hardware will then perform the blinking task in its own built-in LED or in an external LED as specified in the code.
The hardware of Arduino UNO
1. Atmega328P microprocessor by leading manufacturer Atmel
It is the primary chip and the brain of the Arduino. It has a flash memory of 32 KB. It is where the uploaded code is stored in the Arduino. The size is indeed small but it is sufficient in case of small codes. It has a run time memory or SRAM of 2 KB. It stores variable values during execution of the code. It also has an EEPROM memory of another 1 KB. EEPROM memory is non-volatile meaning that it will not get erased when the Arduino is restarted. It acts as an operating system and performs all controls since Arduino lacks a fully developed user interface.

2.USB Interface Chip
A secondary micro-controller, either Atmega8 or Atmega16 acts as an interface between a computer and the Arduino board. It makes the process of uploading code into the board much easier by converting the data into a serial format for the primary micro-controller to be able to process it.
3.Pins
An Arduino UNO has 6 Analog input pins which are typically the output of a sensor, 14 digital input/ output pins which can be configured appropriately in the code, 6 of which are capable of providing Pulse Width Modulated(PWM) output, several ground pins and VCC pins and an analogue reference pin. The Arduino does not have a proper analogue output pin because it does not have a built-in digital to analogue converter, but the PWM pins can be substituted for them with reasonable accuracy.

4.Power port
The Arduino UNO can be powered from a desktop/laptop via a USB cable or from a battery using a cable that terminates in a barrel jack.

5.USB connector (type B)
The Arduino receives and transmits data with the connected device via this port. It also receives power from the connected device via this cable.
The Arduino receives and transmits data with the connected device via this port. It also receives power from the connected device via this cable.

6.Transmit and receive LEDs (Tx and Rx LEDs)
These blink to indicate transmission and reception of data respectively.
7.Reset switch
This switch is used to restart any code that is loaded onto the Arduino by temporarily connecting the reset pin to ground and thereby providing a zero to the active-low reset pin. It is quite useful when testing the Arduino multiple times with different inputs.

8.Crystal Oscillator
An oscillator is a device that moves in a fixed pattern repeatedly, similar to the pendulum of a clock. A crystal oscillator moves much faster than a typical clock and provides a clock signal to the primary micro-controller whose frequency is precisely 16MHz.

9. LED Power Indicator
It is a built-in LED which indicates the power state of the Arduino.

10.Voltage Regulator
The built-in voltage regulator generates a stable and constant 5V power that is required by the micro-controller and other necessary components on the board. They take in voltage input and regulate it by stepping it down and gives stable DC output by radiating the excess voltage as heat. It also protects the circuit from damages due to excess current and voltage to an extend.
Components Required
- Arduino UNO
- Breadboard
- 3 LEDs
- 3 100 Ω resistors
- USB type A to B cable
Circuit on Breadboard
Circuit Schematic
Images of whole Hardware unit
Before Powering On
Simulation
Working
Introduction
Comments
Post a Comment