Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
ARDUINO COURSE GUIDE
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
What is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - 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. You can tell your board what to do by sending a
set of instructions to the microcontroller on the board. To do so you use the Arduino
programming language (based on Wiring), and the Arduino Software (IDE), based
on Processing.
Why to use Arduino?
It is an open-source project, software/hardware is extremely accessible and
very flexible to be customized and extended
It is flexible, offers a variety of digital and analog inputs, SPI and serial interface
and digital and PWM outputs
It is easy to use, connects to computer via USB and communicates using
standard serial protocol, runs in standalone mode and as interface connected to
PC/Macintosh computers
It is inexpensive, around 400 Rs. per board and comes with free authoring
software.
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
Microcontroller:
A microcontroller can be considered as an integrated computer on a chip or a self-
contained system with a processor, memory and peripherals and can be used as an
embedded system. It is referred to as the brain or heart of the Arduino development
board which is based on different AVR Microcontrollers by Atmel.
Types of Arduino Board and their Microcontroller:
Arduino Board Processor Memory Digital I/O Analogue 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
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
1. Arduino Uno:
The Uno is a huge option for your initial Arduino. Arduino Uno is a
microcontroller board based on the ATmega328P. It consists of 14-digital I/O
pins, where 6-pins can be used as PWM, 6-analog inputs, a reset button, a
power jack, a USB connection and more. It includes everything required to
hold up the microcontroller; simply attach it to a PC with the help of a USB
cable and give the supply to get started with a AC-to-DC adapter or battery.
2. Arduino Mega:
The Arduino Mega is a type of Microcontroller and it is based on the
ATmega2560. It consists of 54 digital input/output pins and from the total pins
14 pins are used for the PWM output, 16 pins are used for the analog inputs,
4 pins are used for the hardware serial port of the UART. There are pins like
crystal oscillator of 16 MHz, USB connection, RESET pin, ICSP header, and
a power jack.
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
3. Red Board Arduino Board:
The Red Board arduino board can be programmed using a Mini-B USB cable
using the Arduino IDE. It will work on Windows 8 without having to modify
your security settings. It is more constant due to the USB or FTDI chip we
used and also it is entirely flat on the back. Creating it is very simple to utilize
in the project design. Just plug the board, select the menu option to choose
an Arduino UNO and you are ready to upload the program. You can control
the RedBoard over USB cable using the barrel jack.
4. LillyPad Arduino Board:
The LilyPad Arduino 328 Main Board is an Arduino-programmed microcontroller
designed to be easily integrated into e-textiles and wearable projects. It offers the
same functionality you find in other Arduino boards, in a lightweight, round
package designed to minimize snagging and profile, with wide tabs that can be
sewn down and connected with conductive thread. The LilyPad Arduino consists
of an ATmega328 with the Arduino bootloader and a minimum number of
external components to keep it as small (and as simple) as possible.
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
Arduino Shields:
Arduino shields are modular circuit boards that piggyback onto your Arduino to instill it
with extra functionality. Want to connect your Arduino to the Internet and post to
Twitter? There's a shield for that. Want to make your Arduino an autonomous rover?
There are shields for that. From motor to LCD Screen controlling, there is a shield for
that, all of which make your Arduino more than just a development board with a blinking
LED. Shields are designed to sit on top of an Arduino, extending the functionality of the
popular microprocessor platform.
Some Examples:
Wireless Shields
The GSM Shield
The Ethernet Shield
The Proto Shields
The Arduino Uno Board:
The Arduino Uno Board is generally found in two types:
1. Dip – the ATmega 328p microcontroller can be replaced/fetched out.
2. SMD (surface mount device) –the ATmega 328p cannot be replaced or fetched oud
and is placed as smd component.
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
Power (USB / Barrel Jack)
Every Arduino board needs a way to be connected to a power source. The Arduino UNO can be
powered from a USB cable coming from your computer or a wall power supply that is terminated in a
barrel jack. In the picture above the USB connection is labeled (1) and the barrel jack is labeled (2).
Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF)
The pins on your Arduino are the places where you connect wires to construct a circuit (probably in
conjuction with a breadboard and some wire. They usually have black plastic ‘headers’ that allow
you to just plug a wire right into the board. The Arduino has several different kinds of pins, each of
which is labeled on the board and used for different functions.
GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can
be used to ground your circuit.
5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin
supplies 3.3 volts of power. Most of the simple components used with the Arduino run
happily off of 5 or 3.3 volts.
Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are
Analog In pins. These pins can read the signal from an analog sensor (like a temperature
sensor) and convert it into a digital value that we can read.
Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO).
These pins can be used for both digital input (like telling if a button is pushed) and digital
output (like powering an LED).
PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10,
and 11 on the UNO). These pins act as normal digital pins, but can also be used for
something called Pulse-Width Modulation (PWM) and are use to simulate analog output (like
fading an LED in and out).
AREF (9): Stands for Analog Reference. Most of the time you can leave this pin alone. It is
sometimes used to set an external reference voltage (between 0 and 5 Volts) as the upper
limit for the analog input pins.
Reset Button
Arduino has a reset button which can be seen at the marking (10). Pushing it will
temporarily connect the reset pin to ground and restart any code that is loaded on the
Arduino. This can be very useful if your code doesn’t repeat, but you want to test it
multiple times.
Power LED Indicator
Just beneath and to the right of the word “UNO” on your circuit board, there’s a tiny LED
next to the word ‘ON’ (11). This LED should light up whenever you plug your Arduino
into a power source. If this light doesn’t turn on, there’s a good chance something is
wrong. Time to re-check your circuit!
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
TX RX LEDs
TX is short for transmit, RX is short for receive. These markings appear quite a bit in
electronics to indicate the pins responsible for serial communication. In our case, there
are two places on the Arduino UNO where TX and RX appear -- once by digital pins 0
and 1, and a second time next to the TX and RX indicator LEDs (12). These LEDs will
give us some nice visual indications whenever our Arduino is receiving or transmitting
data (like when we’re loading a new program onto the board).
Main IC
The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think of it as
the brains of our Arduino. The main IC on the Arduino is slightly different from board
type to board type, but is usually from the ATmega line of IC’s from the ATMEL
company. This can be important, as you may need to know the IC type (along with your
board type) before loading up a new program from the Arduino software. This
information can usually be found in writing on the top side of the IC. If you want to know
more about the difference between various IC's, reading the datasheets is often a good
idea.
Voltage Regulator
The voltage regulator (14) is not actually something you can (or should) interact with on
the Arduino. But it is potentially useful to know that it is there and what it’s for. The
voltage regulator does exactly what it says -- it controls the amount of voltage that is let
into the Arduino board. Think of it as a kind of gatekeeper; it will turn away an extra
voltage that might harm the circuit. Of course, it has its limits, so don’t hook up your
Arduino to anything greater than 20 volts.
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
Arduino Uno Technical Specifications:
Microcontroller ATmega328P – 8 bit AVR family microcontroller
Operating Voltage 5V
Recommended Input Voltage 7-12V
Input Voltage Limits 6-20V
Analog Input Pins 6 (A0 – A5)
Digital I/O Pins 14 (Out of which 6 provide PWM output)
DC Current on I/O Pins 40 mA
DC Current on 3.3V Pin 50 mA
Flash Memory 32 KB (0.5 KB is used for Bootloader)
SRAM 2 KB
EEPROM 1 KB
Frequency (Clock Speed) 16 MHz
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
ARDUINO IDE:
The Arduino integrated development environment (IDE) is a cross-platform application
that is written in the programming language Java. It is used to write and upload
programs to Arduino compatible boards, but also, with the help of 3rd party cores, other
vendor development boards.
The Arduino compiler/IDE accepts C and C++ as-is. In fact, many of the libraries are
written in C++. Much of the underlying system is not object oriented, but it could be.
Thus, "The arduino language" is C++ or C.
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
HOW TO MAKE YOU OWN ARDUINO:
A lot of people start learning about microcontrollers with an Arduino but then want to
build their own projects without having to sacrifice their dev board. Or maybe they
want to make their own Arduino variant, that is compatible with the IDE. If that is the
case, you can also make your own standalone Arduino board and use necessary
modules to make it compatible with Arduino IDE.
As the main brain of Arduino board is a microcontroller (Atmega 328p for Arduino
Uno), one can directly buy the microcontroller which will cost you around 200 Rs.
and some more components to make your project working with Arduino IDE without
the actual Arduino development board.
BASIC COMPONENTS FOR A STANDALONE ARDUINO:
a 16 MHz crystal
a 10k resistor and a 220 Ohm resistor
two 22 pF (ceramic) capacitors
voltage regulator (7805)
two 0.1uF Capacitor
a pushbutton
an LED
a barrel jack
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
CIRCUIT DIAGRAM:
PROGRAMMING:
A common problem is how to burn the bootloader onto the fresh AVR chip. Since
AVRs come blank, they need to be set up to be Arduino IDE compatible but to do
that you need an AVR programmer.
From Arduino Board:
You can upload programs to it using the USB-to-serial convertor (FTDI chip) on an
Arduino board. To do, you remove the microcontroller from the Arduino board so the
FTDI chip can talk to the microcontroller on the breadboard instead. The diagram at
right shows how to connect the RX and TX lines from the Arduino board to
the ATmega on the breadboard. To program the microcontroller, select "Arduino
Duemilanove or Nano w/ ATmega328" from the the Tools > Board menu
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]
Module# 01 Prepared by:
Introduction to Arduino M. Wasiq Pervez
thingsRoam Academy Contact: +92-308-1222240 [Link]
Email: academy@[Link]