6.
ARDUINO BOARD &
PROGRAMMING
Mikroprosesor & IoT
TTI3I3
What is the difference between µP and µC?
CU Register Flash SRAM EEPROM
memory
ALU
microprocessor Programmable Power
Input / Output Regulator
Programmable
Timer / Counter Programmable
Interrupt Controller (Crystal) Clock
microcontroller Regulator
What is the difference between μP, μC, and
Development Board?
External
CU Register Flash SRAM EEPROM Memory
memory
Pin Connector
ALU
microprocessor Programmable Power
Input / Output Regulator
Programmable
Timer / Counter Programmable
Interrupt Controller (Crystal) Clock
microcontroller Regulator
development board
ARDUINO
• http://www.arduino.cc
• http://www.arduino.org/
products/boards/arduin
o-uno
WHAT IS ARDUINO
Physical computing platform
Open source
“Hardware Abstracted” Wiring
Language
USB programmable
Large community
Inexpensive ($31.95 from Sparkfun)
WHAT IS ARDUINO
Based on ATmega8
w. USB interface
Voltage regulator
The “power” is in:
Standard board design
Wiring language
Open Source
FILOSOFI ARDUINO
Open source hardware/software prototyping platform
Physical computing: computer that can sense and control physical world
compared to ordinary computer (PC)
ARDUINO BOARD OVERVIEW
ARDUINO “OFFICIAL”
Arduino boards Arduino shields
• Uno Ethernet
• Mega 2560
Wireless SD
• Mega ADK
• Ethernet Wireless Proto
• BT Motor
• LilyPad Proto
• Fio
• Pro
• Nano
• Mini
• Pro Mini
ARDUINO BOARD http://arduino.cc/en/uploads/Main/Lilypad_thumb_3.jpg
http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg
http://arduino.cc/en/uploads/Main/ArduinoMega2560_R3_Front_450px.jpg
http://arduino.cc/en/uploads/Main/ArduinoMini_thumb.jpg
ARDUINO SHIELDS
http://arduino.cc/en/uploads/Main/ArduinoEthernetShieldV3.jpg
http://arduino.cc/en/uploads/Main/Arduino_WirelessProtoShield_Front_450px.jpg
“ Unofficial” Boards and Shields
• Adafruit
• Sparkfun
• DFRobot
• Itead Studio
• etc
Peta pin
• Complete schematic
• Atmel ATmega328P
datasheet
ARDUINO PHYSICAL LAYOUT
http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg
ARDUINO BOARD
LINGKUNGAN PENGEMBANGAN/ IDE
• Arduino programming language berdasarkan
Wiring (http://wiring.org.co)
• Arduino development environment
berdasarkan Processing
(http://www.processing.org)
• Source code = Sketches
• Sekilas introduksi
ARDUINO “OFFICIAL”
Taman bermain (playground)
http://playground.arduino.cc/
Learning
https://www.arduino.cc/en/Guide/HomePage
Arduino Uno Rev3
Arduino Uno Rev3: Tech Spec
MICROCONTROLLER ATmega328P
OPERATING VOLTAGE 5V
INPUT VOLTAGE (RECOMMENDED) 7-12V
INPUT VOLTAGE (LIMIT) 6-20V
DIGITAL I/O PINS 14 (of which 6 provide PWM output)
PWM DIGITAL I/O PINS 6
ANALOG INPUT PINS 6
DC CURRENT PER I/O PIN 20 mA
DC CURRENT FOR 3.3V PIN 50 mA
FLASH MEMORY 32 KB (ATmega328P) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
CLOCK SPEED 16 MHz
LED_BUILTIN 13
LENGTH 68.6 mm
WIDTH 53.4 mm
WEIGHT 25 g
Arduino Uno Rev3: Pinout
Arduino: Reference
Functions: Variables: Structures: Comparison Operators
Digital I/O Constants Control Structure != (not equal to)
else < (less than)
digitalRead() HIGH | LOW
for <= (less than or equal to)
digitalWrite() INPUT | OUTPUT
if == (equal to)
pinMode()
> (greater than)
Data Types >= (greater than or equal to)
Analog I/O array Arithmetic Operators
analogRead() bool % (remainder) Boolean Operators
analogWrite() byte * (multiplication) ! (logical not)
char + (addition) && (logical and)
Time float - (subtraction) || (logical or)
int / (division)
delay()
= (assignment)
TinkerCAD.com
Component Simulation
Component Simulation (After Mid Exam)
Learning Curve
Lab: Seven Segment
direct connection from Arduino Uno Rev3
using BCD-to-Seven Segment Decoder
using 8-bit shift register (Serial In Parallel Out)
Lab: ADC and PWM
Practice with Programming (combination of both labs
above)
countdown timer
displaying analog value with 7 Segment
Learning Curve (After Mid Exam)
Lab: How to use Sensor
Photoresistor
Ultrasonic Distance
PIR (Passive Infrared) 🡪 identify the differences
between Ultrasonic Distance with PIR
Temperature
Lab: How to use Actuator
DC motor
micro servo
Learning Curve (After Mid Exam)
Lab: How to use Display
7 Segment + power saving button (push to see)
LED display
16x2 LCD display
Temperature
Lab: How to use Piezo
Bonus Lab: How to use keypad
End of Course 4
Thank You