Sunday 19 July 2020

Introduction to Arduino

                                                         Introduction to Arduino

The Arduino is an open-source electronics platform. The open source nature of Arduino has been the main attractive reason. Since it is an Open Source project, all the files related to hardware and software is available for personal or commercial use. The software files which includes all the source code library are also open sourced.  It consists of both a physical programmable circuit board and a software. It is very easy  to do electronics project using Arduino. Arduino boards are widely used in robotics, embedded systems, and electronic projects where automation is an essential part of the system.All Arduino boards have one thing in common which is a microcontroller. A microcontroller is basically a really small computer. The Arduino software is easy-to-use for beginners, yet flexible enough for advanced users. It runs on Mac, Windows, and Linux. Arduino board designs use a variety of microprocessors and controllers. The Arduino project provides an integrated development environment (IDE) that runs on your computer, used to write and upload computer code to the physical board. The microcontrollers can be programmed using the C and C++ programming languages. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware in order to load new code onto the board -- you can simply use a USB cable. The boards are equipped with sets of digital and analog input/output (I/O) pins. Unlike other controllers you don’t need to arrange extra peripherals and devices that makes your project economical in nature and free from a lot of technical expertise. When nature and functionality of the task go complex,Micro SD card can be added in the boards to make them store more information.

 

 

 Arduino  UNO

 

 

 

The Arduino Uno is a microcontroller board based on the ATmega328 . It contains everything needed to support the microcontroller. It has 14 digital input/output pins, 6 analog inputs(A0 to A5), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.Among this 14 I/O pins 6 can be used as PWM pins(pins 3,5,6,9,10, 11) these pins are configured to provided 8-bit output PWM. This Arduino board includes an inbuilt LED and that is allied to pin-13 which is named as digital pin 13.This LED can be operated based on the high and low values of the pin. The RST pin of this board can be used to restart the program from the first line of it's sketch. A reset button is not a power supply button and is controlled by microcontroller. Note that this reset button cannot controlled or changed by the program that we burn on bootloader..  AREF pin is also there,the term AREF stands for Analog Reference Voltage which is a reference voltage for analog inputs. Reset pin is added on the board that resets the board. It is very helpful when running program goes too complex and hangs up the board. LOW value to the reset pin will reset the controller. IOREF pin is very useful for providing voltage reference to the board. A shield is used to read the voltage across this pin which then select the proper power source. It can simply be connected to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The range of supplied input voltage to the board ranges from 7volts to 20volts. Only 5 V is required to turn the board on, which can be achieved directly using USB port or external adopter, which can be regulated and limit to 5 V or 3.3 V based on the requirement of the project. These pins come with standard operating ratings ranging between 20mA to 40mA. Internal pull-up resistors are used in the board that limits the current exceeding from the given operating conditions. However, too much increase in current makes these resisters useless and damages the device. The voltage provided by the power jack can be accessed through this pin. However, the output voltage through this pin to the board will be automatically set up to 5V. Four pins 10(SS), 11(MOSI), 12(MISO), 13(SCK) provide SPI communication with the help of SPI library. TWI  (Two-wire Interface)communication is accessed through Wire Library. A4 and A5 pins are used for this purpose. Serial communication is carried out through two pins called Pin 0 (Rx) and Pin 1 (Tx).Rx pin is used to receive data while Tx pin is used to transmit data. If LEDs placed on the Rx and Tx pins will flash, they indicate the transmission of data.Pin 2 and 3 are used for providing external interrupts. An interrupt is called by providing LOW or changing value. 13KB of flash memory is used to store the number of instructions in the form of code.

There are many versions of Uno boards available, however, Arduino Nano V3 and Arduino Uno are the most official versions that come with Atmega328 8-bit AVR Atmel microcontroller where RAM memory is 32KB.The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter. The Arduino Uno has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega8U2 on the board channels this serial communication over USB and appears as a virtual com port to software on the computer. The '8U2 firmware uses the standard USB COM drivers, and no external driver is needed.The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-toserial chip and USB connection to the computer (but 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 ATmega328 also support I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus. SPI communication is also there.The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to upload new code to it without the use of an external hardware programmer.

 

         Microcontroller                                   ATmega328

         Operating Voltage                              5V

         Input Voltage (recommended)           7-12V

         Input Voltage (limits)                         6-20V

         Digital I/O Pins                                   14

         PWM pins                                           6(3,5,6,9,10,11pins)

         Analog Input Pins                               6

         DC Current per I/O Pin                      40 mA

         DC Current for 3.3V Pin                    50 mA

         Flash Memory                                     32 KB of which 0.5 KB 

                                                                        (used by bootloader)

         SRAM                                                 2 KB

         EEPROM                                            1 KB

         Clock Speed                                        16 MHz

         The length of this board                       68.6 mm

         The width of this board                       53.3mm

 

 

 Arduino MEGA

 

The Arduino Mega is similar to the UNO’s big brother.The Arduino Mega 2560 is an open-source microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 15 can be used as PWM outputs), There are 16-analog pins included on the board which is marked as A0-A15. It is very important to know that all the analog pins on this board can be utilized like digital I/O pins. Every analog pin is accessible with the 10-bit resolution which can gauge from GND to 5 volts. But, the higher value can be altered using AREF pin as well as the function of analog Reference.4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. Vin Pin supplies input voltage to the board ranges from 7volts to 20volts. The voltage provided by the power jack can be accessed through this pin. However, the output voltage through this pin to the board will be automatically set up to 5V.

Serial Communication is possible for that the serial pins of this board like TXD and RXD are used to transmit & receive the serial data. Tx indicates the transmission of information whereas the RX indicates receive data. The serial pins of this board have four combinations. For serial 0, it includes Tx (1) and Rx (0), for serial 1, it includes Tx(18) & Rx(19), for serial 2 it includes Tx(16) & Rx(17), and finally for serial 3, it includes Tx(14) & Rx(15).The external interrupts can be formed by using 6-pins like interrupt 0(0), interrupt 1(3), interrupt 2(21), interrupt 3(20), interrupt 4(19), interrupt 5(18). These pins produce interrupts by a number of ways i.e. Providing  LOW value, rising or falling edge or changing the value to the interrupt pins. An inbuilt led is there in pin 13. The I2C communication can be supported by two pins namely 20 & 21 where 20-pin signifies Serial Data Line (SDA) which is used for holding the data & 21-pin signifies Serial Clock Line (SCL ) mostly utilized for offering data synchronization among the devices.SPI Communication is also possible ,the term SPI is a serial peripheral interface which is used to transmit the data among the controller & other components. Four pins like MISO (50), MOSI (51), SCK (52), and SS (53) are utilized for the communication of SPI. The dimension of Arduino Mega 2560 board mainly includes the length as well as widths like 101.6mm or 4 inch X 53.34 mm or 2.1 inches.

 

 

         Microcontroller                                  ATmega2560

         Operating Voltage                               5V

         Input Voltage (recommended)            7-12V

         Input Voltage (limits)                          6-20V

         Digital I/O Pins                                   54

         PWM pins                                           15

         Analog Input Pins                               16

         DC Current per I/O Pin                      40 mA

         DC Current for 3.3V Pin                    50 mA

         Flash Memory                                    256 KB of which 8KB used by bootloader

         SRAM                                                 8 KB

         EEPROM                                            4 KB

         Clock Speed                                        16 MHz

         The USB host chip used                     MAX3421E

         The length of this board                       4 inch

         The width of this board                       2.1 inches.

         The weight of this board                      36 g

 

 

Arduino NANO

   

 

 

The Arduino Nano is a small, complete, and breadboard-friendly board based on the ATmega328 (Arduino Nano 3.x), an8 bit AVR family microcontroller or ATmega168 (Arduino Nano 2.x). This board is quite similar to other Arduino boards available in the market, but the small size makes this board stand out from others. It has 22 input/output pins in total. It contains 14 digital pins out of which 6 pins (3,5,6,9,10,11 )are used for generating 8 bit PWM output.. There are 8 analog pins on the board marked as A0 – A7 pins. These pins are used to measure the analog voltage ranging between 0 to 5V with a total resolution of 10bits.Each of these Digital & Analog Pins are assigned with multiple functions but their main function is to be configured as input or output. It contain 2 Reset Pins & 6 Power. Reset pin is added on the board that resets the board. It is very helpful when running program goes too complex and hangs up the board. LOW value to the reset pin will reset the controller. Pin 13 is used to turn on the built-in LED. Like uno and mega board AREF pin is used as a reference voltage for the input voltage. . It comes with an operating voltage of 5V, however, the input voltage can vary from 7 to 12V. 5V is a regulated power supply voltage of the board that is used to power the controller and other components placed on the board. 3.3V is the minimum voltage generated by the voltage regulator on the board. Arduino Nano comes with a crystal oscillator of frequency 16 MHz. It is used to produce a clock of precise frequency using constant voltage. To connect the Arduino Nano to your computer, this board doesn’t use standard USB for connection with a computer, instead, it comes with Mini USB support. This also provides power to the board, as indicated by the blue LED (which is on the bottom of the Arduino Nano 2.x and the top of the Arduino Nano 3.0). The Arduino Nano can be powered via the Mini-B USB connection, 6-20V unregulated external power supply (pin 30), or 5V regulated external power supply (pin 27). The power source is automatically selected to the highest voltage source. So you can connect battery positive to Vin pin and negative to Ground pin directly.

Tx pins are used for serial communication where Tx represents the transmission of data while Rx represents the data receiver. Four pins 10(SS),11(MOSI),12(MISO),13(SCK) are used for SPI (Serial Peripheral Interface). SPI is an interface bus and mainly used to transfer data between microcontrollers and other peripherals like sensors, registers, and SD card. Pin 2 and 3 are used as external interrupts which are used in case of emergency when we need to stop the main program and call important instructions at that point. The main program resumes once interrupt instruction is called and executed.I2C communication is developed using A4 and A5 pins where A4 represents the serial data line (SDA) which carries the data and A5 represents the serial clock line (SCL) which is a clock signal, generated by the master device, used for data synchronization between the devices on an I2C bus.

 

       Microcontroller                                ATmega328P(Arduino Nano 3.x)

         Operating Voltage                             5V

         Input Voltage(Recommended)          7-12V

         Analog Input Pins                             6 (A0 – A5)

         Digital I/O Pins                                 14

        PWM pins                                          6 (pins3,5,6,9,10,11)

         DC Current on I/O Pins                     40 mA

         DC Current on 3.3V Pin                    50 mA

         Flash Memory                                    3KB (2KBisused for Bootloader)

         SRAM                                                 2 KB

         EEPROM                                          1 KB

         Frequency (Clock Speed)                 16 MHz

         Communication                                 IIC, SPI, USART

          Dimension                                        43.18 mm×18.54 mm

.