tutorial
What Is Arduino?
Arduino is a prototype platform (open-source) based on easy-to-use hardware and software. It consists of a circuit board, which can be programmed (referred to as a microcontroller) and ready-made software called Arduino IDE (Integrated Development Environment), which is used to write and upload the computer code to the physical board.
The key features are −
1. Arduino boards are able to read analog or digital input signals from different sensors and turn it into an output such as activating a motor, turning LED on/off, connect to the cloud and many other actions.
2. You can control your board functions by sending a set of instructions to the microcontroller on the board via Arduino IDE (referred to as uploading software).
3. Unlike most previous programmable circuit boards, Arduino does not need an extra piece of hardware (called a programmer) in order to load a new code onto the board. You can simply use a USB cable.
4. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program.
5. Finally, Arduino provides a standard form factor that breaks the functions of the micro-controller into a more accessible package.
Board Types
Various kinds of Arduino boards are available depending on different microcontrollers used. However, all Arduino boards have one thing in common: they are programmed through the Arduino IDE.
The differences are based on the number of inputs and outputs (the number of sensors, LEDs, and buttons you can use on a single board), speed, operating voltage, form factor etc. Some boards are designed to be embedded and have no programming interface (hardware), which you would need to buy separately. Some can run directly from a 3.7V battery, others need at least 5V.
Here is a list of different Arduino boards available.
Arduino boards based on ATMEGA328 microcontroller
Board Name
|
Operating Volt
|
Clock Speed
|
Digital i/o
|
Analog Inputs
|
PWM
|
UART
|
Programming Interface
|
Arduino Uno R3
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
USB via ATMega16U2
|
Arduino Uno R3 SMD
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
USB via ATMega16U2
|
Red Board
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
USB via FTDI
|
Arduino Pro 3.3v/8 MHz
|
3.3V
|
8MHz
|
14
|
6
|
6
|
1
|
FTDI-Compatible Header
|
Arduino Pro 5V/16MHz
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
FTDI-Compatible Header
|
Arduino mini 05
|
5V
|
16MHz
|
14
|
8
|
6
|
1
|
FTDI-Compatible Header
|
Arduino Pro mini 3.3v/8mhz
|
3.3V
|
8MHz
|
14
|
8
|
6
|
1
|
FTDI-Compatible Header
|
Arduino Pro mini 5v/16mhz
|
5V
|
16MHz
|
14
|
8
|
6
|
1
|
FTDI-Compatible Header
|
Arduino Ethernet
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
FTDI-Compatible Header
|
Arduino Fio
|
3.3V
|
8MHz
|
14
|
8
|
6
|
1
|
FTDI-Compatible Header
|
LilyPad Arduino 328 main board
|
3.3V
|
8MHz
|
14
|
6
|
6
|
1
|
FTDI-Compatible Header
|
LilyPad Arduino simple board
|
3.3V
|
8MHz
|
9
|
4
|
5
|
0
|
FTDI-Compatible Header
|
Arduino boards based on ATMEGA32u4 microcontroller
Board Name
|
Operating Volt
|
Clock Speed
|
Digital i/o
|
Analog Inputs
|
PWM
|
UART
|
Programming Interface
|
Arduino Leonardo
|
5V
|
16MHz
|
20
|
12
|
7
|
1
|
Native USB
|
Pro micro 5V/16MHz
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
Native USB
|
Pro micro 3.3V/8MHz
|
5V
|
16MHz
|
14
|
6
|
6
|
1
|
Native USB
|
LilyPad Arduino USB
|
3.3V
|
8MHz
|
14
|
6
|
6
|
1
|
Native USB
|
Arduino boards based on ATMEGA2560 microcontroller
Board Name
|
Operating Volt
|
Clock Speed
|
Digital i/o
|
Analog Inputs
|
PWM
|
UART
|
Programming Interface
|
Arduino Mega 2560 R3
|
5V
|
16MHz
|
54
|
16
|
14
|
4
|
USB via ATMega16U2B
|
Mega Pro 3.3V
|
3.3V
|
8MHz
|
54
|
16
|
14
|
4
|
FTDI-Compatible Header
|
Mega Pro 5V
|
5V
|
16MHz
|
54
|
16
|
14
|
4
|
FTDI-Compatible Header
|
Mega Pro Mini 3.3V
|
3.3V
|
8MHz
|
54
|
16
|
14
|
4
|
FTDI-Compatible Header
|
Arduino boards based on AT91SAM3X8E microcontroller
Board Name
|
Operating Volt
|
Clock Speed
|
Digital i/o
|
Analog Inputs
|
PWM
|
UART
|
Programming Interface
|
Arduino Mega 2560 R3
|
3.3V
|
84MHz
|
54
|
12
|
12
|
4
|
USB native
|
Arduino Uno
One of the most popular Arduino boards out there is the Arduino Uno. While it was not actually the first board to be released, it remains to be the most actively used and most widely documented on the market. Because of its extreme popularity, the Arduino Uno has a ton of project tutorials and forums around the web that can help you get started or out of a jam. We’re big fans of the Uno because of it’s great features and ease of use.
Board Breakdown
Here are the components that make up an Arduino board and what each of their functions is.
1. Reset Button – This will restart any code that is loaded to the Arduino board
2. AREF – Stands for “Analog Reference” and is used to set an external reference voltage
3. Ground Pin – There are a few ground pins on the Arduino and they all work the same
4. Digital Input/Output – Pins 0-13 can be used for digital input or output
5. PWM – The pins marked with the (~) symbol can simulate an analog output
6. USB Connection – Used for powering up your Arduino and uploading sketches
7. TX/RX – Transmit and receive data indication LEDs
8. ATmega Microcontroller – This is the brains and is where the programs are stored
9. Power LED Indicator – This LED lights up anytime the board is plugged in a power source
10. Voltage Regulator – This controls the amount of voltage going into the Arduino board
11. DC Power Barrel Jack – This is used for powering your Arduino with a power supply
12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects
13. 5V Pin – This pin supplies 5 volts of power to your projects
14. Ground Pins – There are a few ground pins on the Arduino and they all work the same
15. Analog Pins – These pins can read the signal from an analog sensor and convert it to digital
Arduino - Program Structure
In this chapter, we will study in depth, the Arduino program structure and we will learn more new terminologies used in the Arduino world. The Arduino software is open-source. The source code for the Java environment is released under the GPL and the C/C++ microcontroller libraries are under the LGPL.
Sketch − The first new terminology is the Arduino program called “sketch”.
Structure
Arduino programs can be divided into three main parts: Structure, Values(variables and constants), and Functions. In this tutorial, we will learn about the Arduino software program, step by step, and how we can write the program without any syntax or compilation error.
Let us start with the Structure. Software structure consists of two main functions −
2. Loop( ) function
Void setup ( ) {
}
1. PURPOSE − 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.
2. INPUT − -
3. OUTPUT − -
4. RETURN − -
Void Loop ( ) {
}
1. PURPOSE − 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.
2. INPUT − -
3. OUTPUT − -
4. RETURN − -
Arduino Power Supply
The Arduino Uno needs a power source in order for it to operate and can be powered in a variety of ways. You can do what most people do and connect the board directly to your computer via a USB cable. If you want your project to be mobile, consider using a 9V battery pack to give it juice. The last method would be to use a 9V AC power supply.
Arduino Breadboard
Another
very important item when working with Arduino is a solderless breadboard.
This device allows you to prototype your Arduino project without having
to permanently solder the circuit together. Using a breadboard allows you
to create temporary prototypes and experiment with different circuit designs.
Inside the holes (tie points) of the plastic housing, are metal clips
which are connected to each other by strips of conductive material.
On a side
note, the breadboard is not powered on its own and needs power brought to it
from the Arduino board using jumper wires. These wires are also used to
form the circuit by connecting resistors, switches and other components
together.
No comments:
Post a Comment