What it is?
Arduino is a combination of hardware and software. Hardware here is in the form of physical programmable circuit board and software is in the form of an IDE (Integrated Development Environment). This Arduino IDE can be installed on your computer by downloading the .exe file which is the freely available on the internet for downloading as an Arduino is an open-source platform. The most recent advanced basic model is Arduino UNO, it is a best choice for beginners too and so it is referred here for explaining the things about Arduino.
How it looks?
It appeared like, a kind of electrical component which includes some input/output pins, power connection ports, USB ports, printed circuits( or on-board circuits), chips (i.e. ICs) etc. all embedded in a single platform.
- Power USB: The Arduino board can be powered in two ways. One is by using the USB cable from your computer. In this way, you need to connect the USB cable to the USB port.
- Alternate Power Jack: The other way of powering the Arduino boards is powering it directly from the AC mains power supply by connecting it to the alternate power Jack.
- Arduino Reset: Reset means start your program from the beginning. The resetting of Arduino (UNO) board can be done using two facilities available on the Arduino board. You can reset your Arduino board using connect an external reset button to the Arduino RESET pin or pushing Reset button.
- Main microcontroller: As like brain for your body microcontroller for the board. Each Arduino board has its own microcontroller. The main IC on the Arduino is different for different boards. The microcontrollers are usually of the ATMEL Company. For the Arduino Uno Atmega328p is the microcontroller.
- LED indicator: LED should light up when you plug your Arduino into a power source to indicate that your board is powered up correctly. If this light does not turn on, then there is something wrong with the connection.
- 3.3V Pin: Supply 3.3 output volt
- 5V Pin: Supply 5 output volt
- Ground: There are many ground (GND, 3 in Arduino UNO board) pins on the Arduino board, any of which can be used to ground your circuit.
- External input voltage (Vin): you can also power the Arduino board from an external power source, like AC mains power supply using this pin i.e. Vin.
- Analog pins: The Arduino UNO board has 6 analog pins used as input named as A0 through A5. Using these pins you can read the signal from a sensor which gives analog values, like the humidity sensor or temperature sensor.
- Digital pins: The Arduino UNO board has 14 digital I/O pins. These pins can be configured to work as input digital pins to read logic values (0 or 1) or as digital output pins to operate components like LEDs, relays, etc. The pins labelled “~” can be used to generate PWM.
- Reference voltage pin (AREF): AREF stands for Analog Reference. It is sometimes, used to set an external reference voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.
Arduino has many features some are listed here.
- This gives an easy interface with the USB like, a serial device
- It is an open source platform ,has extensible software and hardware
- The operating voltage is 5V
- The recommended input voltage within the range 7V-12V
- The input voltage ranges from 6V to 20V
- 14 digital i/o pins and 6 Analog i/o pins
- DC Current for each i/o pin is 40 mA
- DC Current for 3.3V Pin is 50 mA
- Flash Memory is 32 KB
- (Static RAM) SRAM is 2 KB
- EEPROM is 1 KB
- Clk Speed is 16 MHz
- Printed circuit board
- Inbuilt ADC conversion
- Simple programming environment
Pros and cons
- Ready to Use: The Arduino has ready to use structure. As Arduino comes in a complete package form which includes whatever the connections needed to use it. You don’t have to worry about the programmer connections all you need to do is to just plug the Arduino board into USB port of your computer that’s it.
- Examples of codes: You can find a library of examples present inside the Arduino IDE. Using these you can learn lot many things without anyone’s support.
- Large community: Your doubts can get cleared using the huge information network for the Arduino available on the internet.There are many forums for the purpose. Many Engineers, hobbyists and professionals are making their projects through Arduino. You can easily find help about everything. Moreover the Arduino website itself explains each and every functions of Arduino. If you just install the libraries or boards, you can get many examples for interfacing with the respective component.
- Structure: Yes, the structure of Arduino is its disadvantage as well. During building a project you have to make its size as small as possible. But with the big structures of Arduino we have to stick with big sized PCB’s.
- Cost: The most important factor which you cannot deny is cost. If you need one package then the cost difference and it will rise when you have to use many packages.
- Easy to use: It becomes difficult for you to make the complex intelligent circuits in future. The easy to use hardware/software of Arduino unable a person to learn the basics of many things likes Serial communication, ADC, I2C etc.
There are many versions in Arduino boards. Among those most used series are listed here with some features.
|Arduino Board||Processor||Memory||Digital I/O||Analog I/O|
|Arduino Uno||16Mhz ATmega328||2KB SRAM, 32KB flash||14||6 input, 0 output|
|Arduino Due||84MHz AT91SAM3X8E||96KB SRAM, 512KB flash||54||12 input, 2 output|
|Arduino Mega||16MHz ATmega2560||8KB SRAM, 256KB flash||54||16 input, 0 output|
|Arduino Leonardo||16MHz ATmega32u4||2.5KB SRAM, 32KB flash||20||12 input, 0 output|
|Arduino Nano||16 MHz ATmega328||1/2KB SRAM, 16/32KB flash||6||8 input,0 output|
|Arduino Lilypad||ATmega168V or ATmega328V||1KB SRAM, 16KB flash||14||6 input,0|
|48 MHz ATSAMD21G18A||32KB SRAM, 256KB flash||12||6 input,1 output|
|Arduino Pro||16 MHz ATmega168 or ATmega328||1/2KB SRAM, 16/32KB flash||6||6 input, 0 output|
Which is used?
The IDE is used to work with the concept of Ardunio. And that IDE is named as Arduino IDE. This includes all the supporting features to operate the Arduino hardware board. This has supporting library files and examples that will ease your burden to use the hardwares.
Installing and operating it
Before installing it you need to have the following needs.
- A computer
- An USB cable
- An Arduino microcontroller
Then follow the steps below to install the software into your computer.
- You will find different versions of the software which is suitable to the operating systems. You find which operating system your system has and download the corresponding file from the Arduino forum from the link here.After downloading the file unzip it.
- Connect the Arduino board to your computer using the USB cable. The power led should glow
- After downloading and unzipping the software, you get the folder, inside the folder, you can find many files, among those the one which has infinity symbol and application icon is the actual one to start the IDE. Double click on it to start the Arduino IDE.
- Once you double click on it you get an pop up window which says
- Create a new project.
- Open an existing project example.
To create a new project, select File → New, to open an existing project example, select File → Example → Basics → Blink. You can select any other example from the list. Here I selected blink which turns LED on and off.
If you selected new file then write your code in new file as below.
- To avoid any error while uploading your program to the board, you must select the correct Arduino board name, which matches with the board connected to your computer.Go to Tools → Board and select your board
Here I have selected the Arduino uno as I said before I am referring Arduino uno in this blog. You can select as per your boards.
- Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This identifies the connectivity of the board to your computer.
- After all these setups compile your code by clicking on the symbol. If the compile is successful, the message “Done compiling” will appear in the status bar. Then after compiling completed, upload your program to the board by clicking on symbol. These symbols appear on the toolbar which is at the top of the editing panel where you write the program.
- Wait for few seconds; you will see LEDs on the board, flashing. If the upload is successful, the message “Done uploading” will appear in the status bar. And then you can see your program’s output.
Arduino programs are written in the Arduino Integrated Development Environment (IDE). Arduino IDE is a special software running on your system that allows you to write sketches (synonym for program in Arduino language) for different Arduino boards.
The Arduino programming language is based on a very simple hardware programming language called processing, which is similar to the C language. For the writing the code the requirement you need to have is the knowledge of C language because the programming language used in Arduino is embedded C, so for coding and controlling any hardware through this software you need to know the C language as the rules, syntax, elements are all used as you use in C language only.
After the sketch is written in the Arduino IDE, it should be uploaded on the Arduino board for execution. The program structure is quite different here which is explained as below.
The structure of Arduino program is pretty simple.Arduino programs have a minimum of 2 blocks,
Preparation & Execution
Each block has a set of statements enclosed in curly braces:
void setup( )
void loop ( )
Here, setup ( ) is the preparation block and loop ( ) is an execution block.
The setup function is the first to execute when the program is executed, and this function is called only once. The setup function is used to initialize the pin modes and start serial communication. This function has to be included even if there are no statements to execute.
void setup ( )
pinMode (pin, OUTPUT); // set the ‘pin’ as output
pinMode (pin, INPUT); // set the ‘pin’ as output
After the setup ( ) function is executed, the execution block runs next. The execution block hosts statements like reading inputs, triggering outputs, checking conditions etc..
In the above example loop ( ) function is a part of execution block. As the name suggests, the loop ( ) function executes the set of statements (enclosed in curly braces) repeatedly.
Void loop ( )
digitalWrite (pin,HIGH); // turns ON the component connected to ‘pin’
delay (1000); // wait for 1 sec
digitalWrite (pin-number, LOW); // turns OFF the component connected to ‘pin-number’
delay (1000); //wait for 1sec
Note: Arduino always measures the time duration in millisecond. use delay in milliseconds.