Arduino is an open source hardware-software development board that is used to design and build devices that interact with the real world. Arduino actually refers to a company which manufactures a specific implementation of these boards.
You can tell your Arduino boards what to do by sending the set of instructions to the microcontroller on the board using Arduino programming language (wiring based) and the Arduino Software (IDE) based on processing. These are able to read inputs such as light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online.
Why use Arduino?
The Arduino software is-easy-to use for beginners, yet flexible enough for advanced users. It can run on Mac, Windows, and on Linux. Anyone - children, hobbyists, artists, programmers - can start tinkering just following the step by step instructions of a kit, or sharing ideas online with other members of the Arduino community. There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handy board, and many others offer similar functionality. Some of its advantages over other systems are:
You can also build an Arduino for yourself or for selling. Although it is allowed to build and sell cloned Arduino boards, it’s not allowed to use the name Arduino and the corresponding logo.
Arduino Boards
What is an Arduino board made up of?
Although its design varies from one version to another but it mainly consists of:
Power connector
which work is to provide power to the device itself, and provides a low voltage which can be used in powering low voltage requiring devices. It can be connected to an AC adapter or a small battery.
Microcontroller
the primary chip, which allows you to program the Arduino in order for it to be able to execute commands and make decisions based on various input. With every type of Arduino, the exact chip being used differs but they are generally Atmel controllers, usually a ATmega8, ATmega168, ATmega328, ATmega1280, or ATmega2560. The biggest difference between these is the different amounts of onboard memory.
Serial connector
which on most newer boards now are implemented through a standard USB port. This connector allows the communication to the board from the computer, also to load new programs onto the device. Many times, these USB ports are used to give power to the board.
Pins
used to establish a connection with various components that are to be used with the Arduino:
Popular Arduino Board
Arduino UNO


Arduino Nano


Specifications
Microcontroller | Atmega328 |
---|---|
Operating Voltage | 7-12 V recommended, 6-20 V limits |
Digital I/O pins | 14 (of which 6 PWM) |
Analog input pins | 8 |
DC current per I/O pin | 40 mA |
DC current for 3.3V pin | 50 mA |
Flash memory | 32 KB |
FTDI USB to TTL serial | FTDI FT232RL |
UART | 1 |
Pin No. | Name | Type | Description |
---|---|---|---|
1-2, 5-16 | D0 - D13 | I/O | Digital input/output port 0-13 |
3, 28 | RESET | INPUT | Reset (Active Low) |
4, 29 | GND | PWR | Supply ground |
17 | 3V3 | OUTPUT | +3.3 V Output (from FTDI) |
18 | AREF | INPUT | ADC Reference |
19-26 | A7 - A0 | INPUT | Analog Input Channel 0 - 7 |
27 | +5V | Output/Input | +5V output (from onboard regulator) or +5V output(input from external power supply) |
30 | VIN | PWR | Supply voltage |
Arduino Mega


IDE used for Arduino programming – Sketch
https://www.arduino.cc/en/main/software
Structure of Arduino program
Arduino programs can be divided in three main parts: Structure, Values (variables and constants), and Functions
Structure - Software structure consist of two main functions
void setup() {
}void loop() {
}
Purpose of using setup() function
The setup() function is called when a sketch starts. Use it to initialize the variables, pin modes, start using libraries, etc. The setup function will only run once, after each power up or reset of the Arduino board.
Purpose of using loop() function
After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.
What is delay and use of delay function?
delay function is used to suspend execution of a program for a particular time .
How to write our own delay function for 1 sec delay?
Note: Keep both the files in same directory
delay.h
void delay_ms(unsigned int ms)
{
unsigned char i;
for(;ms>0;ms--)
{
for(i=250;i>0;i--);
for(i=247;i>0;i--);
}
}
delay.c
#include<reg51.h>
#include"delay.h"
main()
{
delay_ms(1);
while(1);
}