kick Start
Contents
Pre-amble Exposure
01
02 Applied
Arduino Kick Start 03
[email protected]
What is an Arduino ?
Microcontroller
Microprocessor
Microcontroller or Microprocessor
What is the difference
A Microprocessor is an IC which has only the Central
Processing Unit (CPU) inside them.
They only have processing powers.
Don’t have ROM, RAM and other peripheral on the
chip.
A system designer has to add them externally to
make them functional.
Arduino Kick Start [email protected]
Microcontroller or Microprocessor
What is the difference
A microcontroller is an entire computer manufactured
on a single chip.
It is a device that includes microprocessor, memory
and input/output devices on a single chip.
designed to perform specific tasks
Arduino Kick Start [email protected]
Microcontroller vs Microprocessor
One Chips
Microcontroller Many Different Chips
CPU Timer/Counter Timer/Counter Clock USART
Memory Memory Memory I/O Interface
I/O Interface USART
Timer/Counter Other Peripheral
Other Peripherals
Arduino Kick Start [email protected]
Microcontroller vs Microprocessor
One Chips Microprocessor
Microcontroller CPU
CPU
Memory
Arduino Kick Start Memory
[email protected]
Microcontroller vs Microprocessor
Parameters Microcontroller Microprocessor
cost Cheap Expensive
Speed Slow (In MHz range) Fast (InGHz Range)
Purpose Special General
Dependency Single Chip has almost all Need extra components to
component be able to interact
Resources Limited Unlimited
Arduino Kick Start [email protected]
Meet Arduino Uno
Arduino Kick Start [email protected]
Getting Started
• Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE)
(not needed in lab)
2. Connect the board to your computer via the USB
cable
3. If needed, install the drivers (not needed in lab)
4. Launch the Arduino IDE
5. Select your board
6. Select your serial port
7. Open the blink example
8. Upload the program
Arduino Kick Start [email protected]
https://www.arduino.cc/
Arduino Kick Start [email protected]
Arduino Kick Start Click software and
select window
installer
Window installer
[email protected]
Arduino Kick Start Just download
[email protected]
Arduino IDE
See: http://arduino.cc/en/Guide/Environment for more information
Arduino Kick Start [email protected]
Functions in IDE [email protected]
Basic functions of IDE
Void setup ()
Void loop ()
Sub functions
Digital write ()
Analog write ()
Delay ()
Special functions
Interrupt functions
Serial output functions
Customised Libraries and their functions.
Eg: #include <LED.h> #include <serial.h>
Arduino Kick Start
Select Serial Port and Board
Arduino Kick Start [email protected]
Digital Input / Digital output
(PWM on pins 3, 5, 6, 9, 10, 11)
USB Arduino
connection Uno
7-12 volt Revision
input power 3
(9v is Power Analog input /
common) pins Digital input or
Arduino Kick Start output
[email protected]
Arduino Kick Start [email protected]
Different Varieties of Arduino
Arduino Kick Start [email protected]
Arduino Kick Start [email protected]
Input/Output
Output
Input
Arduino IKmickaSgtaertfrom Theory and Practice of Tangible User Interfaces at UC [email protected]
Digital Input/Output 1
0
• Digital IO is binary
valued—it’s either on [email protected]
or off, 1 or 0
• Internally, all
microprocessors are
digital, why?
Arduino Kick Start
Digital Input
NO terminal
Push button momentary/suis tekan tutup Limit swicth/suis limit
NC terminal [email protected]
Push button momentary/suis tekan buka
Arduino Kick Start
AC Digital Input
DC
NO terminal Motion sensor/ penderia pergerakan
Rain sensor/Penderia air
Arduino Kick Start [email protected]
Arduino Analog Input
Image credit: Tod Kurt
Resolution: the number of different voltage levels (i.e., states) used to
discretize an input signal
Resolution values range from 256 states (8 bits) to 4,294,967,296 states
(32 bits)
The Arduino uses 1024 states (10 bits)
Smallest measurable voltage change is 5V/1024 or 4.8 mV
Maximum sample rate is 10,000 times a second
Arduino Kick Start [email protected]
Analog Input
Distance sensor/ penderia jarak
Arduino Kick Start Light Dependent Resistor/Penderia cahaya
[email protected]
Analog Input
Temparature sensor/ penderia suhu
Arduino Kick Start Humidity sensor/ Penderia kelembapan
[email protected]
Analog or Digital Input
Soil sensor
Arduino Kick Start [email protected]
Process
Arduino Kick Start [email protected]
Output
Light Emitting Diode (LED)/ Diod pemancar cahaya
Buzzer/ Pembaz Relay/ Geganti
Arduino Kick Start [email protected]
Output
DC Motor/ Motor arus terus
LED Lamp/ Lampu LED [email protected]
Arduino Kick Start
Output
Servo motor
Arduino Kick Start Stepper motor
[email protected]
Analog Output
• Can a digital devise produce analog
output?
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
• Analog output can be simulated using
pulse width modulation (PWM)
Arduino Kick Start [email protected]
Arduino Kick Start [email protected]
PMW Pins
• Command:
analogWrite(pin,value)
• value is duty cycle:
between 0 (always off)
and 255 (always on)
• Examples:
analogWrite(9, 128)
for a 50% duty cycle
analogWrite(11, 64)
Image from Theory and Practice of Tangible User Interfaces at UC Berklefyor a 25% duty cycle
Arduino Kick Start [email protected]
Arduino Kick Start
Innovations with existing Technologies
Arduino Kick Start [email protected]
Add-on Shields
Global Positioning SYSTEM (GPS) Shield
Arduino Kick Start [email protected]
Add-on Shields
Wireless Shield
Arduino Kick Start [email protected]