Es Arduino 3
Es Arduino 3
Architecture of Arduino
development board
http://www.arduino.cc/ 1
What do you need to start working
with Arduino?
1. Arduino board
2. USB cable
to be downloaded from
(http://arduino.cc/en/Main/Software)
2
The Arduino is a programmable hardware board that runs
an 8-bit /16 Mhz microcontroller with a special bootloader
that allows users to upload programs to the icrocontroller.
It has digital input pins for input from switches and
output to Actuators (LEDS or electrical motors)
It also has analog pins to accept inputs from voltage-
based sensors.
Arduino can be used to develop stand-alone interactive
objects or can be connected to software on your computer
3
What is Arduino?/ Open Source
Open Source Hardware
The Arduino system is open source - all hardware (made by Arduino
distributors) has the schematics and PCB layouts available online.
5
Arduino Terminology
.
Esplora
Game controller
Includes joystick, four buttons, linear
potentiometer (slider), microphone, light sensor,
temperature sensor, three-axis accelerometer.
Not the standard set of IO pins.
Uno
The pins are in three groups:
6 analog pins
14 digital pins
power
Shields
Shields connect to the I/O board to extend it's functionality.
GPS Shield
Power Driver Shield
15
More Shields…
Communication shields - XBee, Ethernet, and Wifi
XBee Shield
GPS Module
Bluetooth Module
Flex Sensor
18
Sensors
Photoresistor, infared, force sensitive resistor, Hall
effect, Piezo, tilt sensor..
19
Arduino Board Overview
USB chip
Digital input/output pins
Reset button
Microcontroller
chip
Power connector
Power Analog
pins Input
pins
20
Arduino Components
21
Nano
22
Nano
23
Arduino Board Schematic
24
Components of the Arduino
• ATMega168/328
• 16MHz crystal/filtering
capacitors
• Onboard power
regulators
• FTDI USB <-> Serial
Chip
• Hardware
25
Necessary parts for any
circuit
• ATMega168/328
• The ‘brains’ of the
Arduino
• Program is loaded
onto the chip
• Runs main loop until
power is removed
• That’s it! All other
parts are optional!
26
Optional parts: Timing
• 16Mhz Crystal
• The ‘heartbeat’ of the
ATMega chip
• Speed of crystal
determines chip speed
• Possible to
over/underclock
depending on
application
• ATMega series has
onboard oscillator; less
precise
27
Power Supply
• 5 Volt and 3.3 Volt
Regulators
• Filtering capacitors
• Automatic switching
between external and
USB Power
• Leave it out if you
have a filtered 5 Volt
power supply
28
FTDI USB Chip
• Allows your Arduino
to communicate with
your computer over a
simple USB link
• Only necessary for
communicating with
USB
29
Hardware
• Circuit Board
• Headers
• USB port
• Sockets
30
Digital Input/Output
• Digital IO is binary
1
valued—it’s either on or
off, 1 or 0 0
• Internally, all
microprocessors are
digital, why?
Digital or Analog?
• Digital – may take two values only: ON or OFF (1 or 0)
• Analog – has many (infinite) values
digitalRead(pin)
digitalWrite(pin, value)
• pinMode(0,OUTPUT);
• Turn on the LED
• digitalWrite(0,HIGH) ;
• Turn off the LED
• digitalWrite(0,LOW);
Pins as Inputs and Pull-up Resistors - 1
• Using a switch as a sensor
• Ex. Seat belt sensor ATmega328
•
pin 3
What should the data direction (PD3)
be for Arduino pin 3 (PD3)?
• pinMode(3, INPUT);
• What will the voltage be on PD3
when the switch is closed?
• What will the voltage be on PD3
when the switch is open?
• Indeterminate!
Pins as Inputs and Pull-up Resistors - 2
• Switch as a sensor, cont.
• Make the voltage on the pin
determinate by turning on the pull-up ATmega328
resistor for PD3 VTG= +5V
• pinMode(3,INPUT_PULLUP);
•
ATmega328
Switch as a sensor, cont. VTG= +5V
• Assuming PD3 is an
input:
• digitalWrite(3,LOW); turns the
“pull-up” resistor off
Pins as Inputs and Pull-up Resistors - 4
ATmega328
VTG= +5V
• Vin. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power
source). You can supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin.
• 5V. The regulated power supply used to power the microcontroller and other
components on the board. This can come either from Vin via an on-board
regulator, or be supplied by USB or another regulated 5V supply.
• 3V3. A 3.3 volt supply generated by the on-board FTDI chip. Maximum current
draw is 50 mA.
• GND. Ground pins.
USB connector
Power connector