1/26
Rahul Dubey
2/26
What is Arduino?What is Arduino?
"Arduino is a tool for making computers
that can sense and control more of the
physical world than your desktop
computer. It's an open-source physical
computing platform based on a simple
microcontroller board, and a
development environment for writing
software for the board."
http://www.arduino.cc
/en/Guide/Introduction
xx
3/26
What is Arduino?What is Arduino? Contd..Contd..
Its….
Open source Hardware and Software
prototyping platform
Which….
Uses sensors- to capture data:
e.g.motion, temperature, light, sound, RFID
Controls things- hooked up to it:
Like- motors, lights, LCD, coffee machines,
dishwashers, doors, etc.
4/26
Why Arduino?Why Arduino?
• Current scenario:-
:
• Inexpensive:
• Cross-platform :(IDE available for
Windows, OSX and Linux)
• Simple, clear programming
environment (C like syntax, a lot of pre-
built libraries)
• Open source and extensible software
and hardware as well…
5/26
Short Introduction
To
Arduino Board
(Hardware)
08/30/1708/30/17
6/2608/30/1708/30/17
7/26
Analog I/O pins-6Analog I/O pins-6
Digital I/O pins:Digital I/O pins:
MicrocontrollMicrocontroll
erer
USB to SerialUSB to Serial
Conv.Conv.
FTDIFTDI
FT232-ICFT232-IC
PowerPower
Connector
8/2608/30/1708/30/17
9/2608/30/1708/30/17
0.5 KB used by0.5 KB used by
bootloaderbootloader
10/26
Arduino Schematic
Arduino Uno board Schematic
11/26
How Is Arduino Used?How Is Arduino Used?
• First of all a circuit will be designed using various
sensors on a breadboard, wires and other peripherals
(LCD, servo, etc.)
• Once the circuit is designed the Arduino IDE is used
to write programs or sketches for the circuit.
• The program is compiled in the IDE and then
uploaded to the Arduino microcontroller. .
08/30/1708/30/17
12/2608/30/1708/30/17
13/26
Short Introduction
To
Arduino IDE
Integrated Development Environment
(Software)
08/30/1708/30/17
14/2608/30/1708/30/17
Input AreaInput Area
Status BarStatus Bar
Program NotificationProgram Notification
15/26
Arduino IDEArduino IDE
Arduno IDE comes with AVR g++ compiler.
Arduino hardware is programmed using a
Wiring-based language (syntax and libraries),
similar to C++ with some simplifications
and modifications.
 It includes a code editor with features such as
syntax highlighting, brace matching, and
automatic indentation, and is also capable of
compiling and uploading programs to the board
with a single click. There is typically no need to
edit makefiles or run programs on a command-
line interface.
08/30/1708/30/17
16/26
Arduino IDE is compitible with Window,
Linux and MAC computer.
STANDARD LIBRERIES:
EEPROM , Ethernet, Firmata ,LiquidCrystal,
Servo , SPI, SoftwareSerial, Stepper, Wire .
CONTRIBUTED LIBRERIES:
Metro, Mstimer2, LedControl, LedDisplay
… etc
08/30/1708/30/17
17/26
Coding guidelines
Arduino coding guidelines
18/26
Arduino “Pins”Arduino “Pins”
• Arduino has digital [0-13] and analog pins
[A0-A5] used with different peripherals and
sensors.
• Each pin has a mode that can be changed from
input mode to output mode.
• Pins are used to read and write data.
08/30/1708/30/17
19/26
Basic LED Blink SketchBasic LED Blink Sketch
• Required: Arduino and Arduino IDE, add
an LED to kick things up, jumbo LED for
another notch!
• Demonstrates the basics for all Arduino
sketches:
setup/loop/pinMode/digitalWrite
• This code comes with the Arduino IDE:
File -> Examples -> Basics -> Blink
08/30/1708/30/17
20/2608/30/1708/30/17
21/26
Conventional code vis-à-vis Arduino
sketch
int main (void)
{
init();
setup();
for (;;)
loop ();
return 0;
}
22/2608/30/1708/30/17
23/26
Timer
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
SIGNAL(SIG_OVERFLOW1) {
PORTB = ~ PORTB;
}
void main() {
DDRB=0xFF;
TIMSK= (1<<TOIE1);
TCCR1A=0x00; // timer1 in normal mode operation
TCCR1B=0X05; // pre scaling by 1024
TCNT1L=0x00;
TCNT1H=0X00;
sei();
while (1);
}
08/30/1708/30/17
24/26
TimerTimer
Wednesday, April 04, 2012Wednesday, April 04, 2012
25/26
Arduino library and functions
Arduino library
Using functions in Arduino environment
26/26
Some case studies of Arduino
based projects
27/26
Arduino based interfaces
Sparkfun Inventors guide for interfacing

arduino-1