H2 Arduino Beginner
H2 Arduino Beginner
1
The heart of engineering isn’t calculation;
It’s problem solving.
3
Industry / Robot /
System
Industry /
System
4
System & Control
System / Plant: “A system may be a piece of equipment, perhaps just a set of machine
parts functioning together, the purpose of which is to perform a particular operation”.
“Suatu sistem dapat berupa sebuah peralatan, mungkin hanya sekumpulan bagian-bagian
mesin yang berfungsi bersama-sama, yang tujuannya adalah untuk melakukan suatu
operasi tertentu”.
6
Open loop system
7
Closed loop system
8
Multivariable control system
9
Embedded Systems
10
Components of Embedded Systems
Communication
Power Supply Processor Memory Timers & Counters
Ports
UART
••Stable
Power
Speed Supply Output
& Smooth RS-423
••Load
Number
Regulation
of I/O– Pins
Fluctuation in output voltage when
CAN
•••Proper
Processor
UnitOutput
Price memory(RAM)
Read-Only
Assembler Current to Drive the Load RS-485
••load
Power
current
Consumption
changes
SPI
••Perfect
Random
Emulator
Display
Packaging Access
Device
Power Memory(ROM)
Efficiency UART
•Efficiency
Amount of RAM and ROM
I2C
••StableElectrically
Debugger
Buzzer Erasable
for Alert
Performance
in Different Programmable
Temperature Range Read-Only I2C
•Input/Output
SpecializedRipple
Processing
Voltage
Units
Device
•••Proper
Memory
Compiler
USB Drivers
Peripheral
Noise Filtering
Set
(EEPROM) ••Transient
Architecture
SPI Response
8-bit, 16-bit, or 32-bit
MEMS
••Proper
Timer devices
Decoupling
Etherneton the Chip Allowable Dissipation
••LineRS-232
Operating
RegulationVoltage
changes
11
ANALOG DIGITAL
12
Communication
• PARALLEL
• SERIAL
1011000
Sender Receiver
13
Pulse Width Modulation
14
Pulse Width Modulation
15
Why Arduino..?
16
Lets Start
Arduino…!
17
Arduino Basics
arduino ( arrr-dween-oh )
18
Types of Arduino Boards
Arduino Nano
Arduino Mega
Arduino LilyPad
19
Arduino Uno
Digital pins:
14 digital IO pins
6 are PWM pins (3, 5, 6, 9, 10, and 11).
Analog pins:
6 analog pins(A0, A1, A2, A3, A4, and A5)
Takes analog values as an input
20
21
Arduino IDE
VERIFY SERIAL
MONITOR
UPLOAD
NEW TAB
OPEN CODE GOES
SAVE HERE
BOARD &
SERIAL PORT
SELECTIONS
22
Basic Coding
structure
23
Basic Coding structure
§setup() function
•Dipanggil saat sketsa dimulai.
•Untuk menginisialisasi variabel, menyematkan mode, mulai menggunakan
perpustakaan, dll.
•Hanya akan berjalan sekali, setelah setiap power-up atau reset papan Arduino.
§loop() function
•Loop secara berurutan.
•Kode di bagian loop() sketsa digunakan untuk mengontrol papan Arduino secara
aktif.
§Commenting
•Baris apa pun yang dimulai dengan dua garis miring (//) tidak akan dibaca oleh
kompiler, jadi Anda dapat menulis apa pun yang Anda inginkan setelahnya.
24
§ pinMode()
Instruction used to set the mode (INPUT or OUTPUT) in
which we are going to use a pin.
Eg: pinMode (13, OUTPUT);
ie. setting pin13 as output.
§ digitalWrite()
•Write a HIGH or a LOW value to a digital pin.
•Eg: digitalWrite (11, HIGH);
•ie. setting pin 11 to high.
25
§ digitalRead()
•Reads the value from a specified digital pin,
either HIGH or LOW
•Eg: int inPin=7;
val = digitalRead(inPin);
•ie. reads the value from inPin and assigns it to val.
§ delay()
•Pauses the program for the amount of time (in milliseconds)
specified as parameter.
•Eg: delay(1000);
•ie. waits for a second (1000 ms = 1 s)
26
Component List
Ø Arduino Uno
Ø USB cable
Ø LED, RGB LED
Ø LDR
Ø POT(10k)
Ø Resistors
Ø Temp sensor LM-35
Ø Motor Driver L293D, DC Motor
ØConnecting wire
27
LED Blink
28
Digital Read
29
Analog Read
30
LDR (Light Dependent Resistor)
31
LDR - Wiring
32
TEMP Sensor-LM35
33
34
DC Motor Drive – L293D
Motor Driver Circuit (L293D)
§ The L293 and L293D devices are quadruple high
current half-H drivers.
35
L293D Functional
Block Diagram
36
37
DC Motor Control
using L293D
38
RGB LED
Vcc
Green
Red Blue
39
“Berapa banyak lagi yang bisa
dilakukan Arduino hanya
bergantung pada imajinasi
Anda”
40