Rahul Dubey
1/26
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
x
2/26
What is Arduino?
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.
3/26
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
4/26
Short Introduction
To
Arduino Board
(Hardware)
02/23/15
5/26
02/23/15
6/26
USB to Serial
Conv.
FTDI
FT232-IC
Power
Connector
Digital I/O
pins:
Microcontroll
er
Analog I/O pins-6
7/26
02/23/15
8/26
0.5 KB used by
bootloader
02/23/15
9/26
Arduino Schematic
Arduino
Uno board Schematic
10/26
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. .
02/23/15
11/26
02/23/15
12/26
Short Introduction
To
Arduino IDE
Integrated Development
Environment
(Software)
02/23/15
13/26
Input Area
Status Bar
Program Notification
02/23/15
14/26
Arduino 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.
02/23/15
15/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
02/23/15
16/26
Coding guidelines
Arduino
coding guidelines
17/26
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.
02/23/15
18/26
Basic 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
02/23/15
19/26
02/23/15
20/26
Conventional code vis--vis
Arduino sketch
int main (void)
{
init();
setup();
for (;;)
loop ();
return 0;
}
21/26
02/23/15
22/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);
}
02/23/15
23/26
Timer
Wednesday, April 04, 2012
24/26
Arduino library and
functions
Arduino
library
Using functions in Arduino
environment
25/26
Some case studies of
Arduino based projects
26/26
Arduino based interfaces
Sparkfun
Inventors guide for interfacing
27/26