ARDUINO ေရးသားနည္း
ARDUINO ေရးသားနည္း
ARDUINO ေရးသားနည္း
Arduino Card
Arduino Uno
Arduino Nano
Arduino Mega
Arduino Due
MCU and MPU
LED ON and OFF example
Programming Basic
Library files
Structures
Variables
Function
Control Structures
Operators
External Device Library files
Arduino Card Library files
External Power Supply Card
Arduino Digital OUTPUT
Arduino Digital INPUT
Input “PULL OWN‟‟ resistor
Input “PULLUP‟‟ resistor
Motion Sensors
Analog Read and Write
Variables resistor
Analog Input Resolution and Output Resolution
DC motor Variable resistor
HCSR 04 Ultrasonic Sensor
1602 LCD (LiquidCrystal Display)
L298 DC motor driver
L298 DC motor driver
DC Relay
Magnetic Contactor
DC relay and Magnetic Contactor
NRF24L01 Wireless Device
Bluetooth Device
Bluetooth device
L298
Android Phone with ardu Droid
DC motor
Battery
Two axis Joysticks
Funduino Joystick Shields
Wireless Control Car
NRF24L01
Funduino joystick Shields
12 volt Battery
DC motor
L298 DC motor driver
ARDUINO STARTER KIT
74HC595 and 7 Segment Display
LDR or Photoresistor
ULN2003 Stepper Motor
LM35 Temperature sensor
Flame Sensor
Ball tilt Sensor
4*4 membrane Keypad
DHT11 Humidity and Temperature Sensor
Buzzer
IR receiver and IR transmitter
Max7219 and Matrix LED
20*4 LCD and I2C Bus
Four Way Wireless Remote Control Kit
Node MCU ESP8266 Testing Board
ESP 8266 Internet Of Things Development Board
WS2812 RGB LED
Strain Guage Pressure Sensor
12volt 0.43amperes Solenoid Electronic Lock and 4*4
Keypad L
Wireless Exacavator
ARDUINO MEGA 2No.
NRF24L01 Wireless Tranceiver 1Set
Servo Motor 4No.
L298 Motor Driver 2No.
Battery 3 Cells 2200Mah 1No.
DC motor and Wheel 12No.
Battery Emulator Circuit 1No.
12 volt LED light 1No.
Key (Super Cup Motor Cycle) 1No.
Push Button 1No.
2 Channel Relay 1No.
1.5 *4 Battery Case 2No.
Variable Resistor 2No.
Toggle Switch 1No.
Two axis Joystick Shields 4No.
DC motor 3No.
Horn 1No.
Automatic Water Filling System
ARDUINO UNO
HCSR04 1No.
Power Supply Card 1No.
Magnetic Contactor 1No.
Overload Relay 1No.
SafeGuard 1No.
2 Channel Relay 1No.
Solenoid 1No.
Contactors
Overload and MCB and Fuse and Circuit Breaker Calculations
AUTO Transfer Switch System
ARDUINO UNO
6 Channel Relay 1No.
12 volt DC relay 2 No.
220 volt AC relay 2No.
Magnetic contactor 2No.
Miniature Circuit Breaker 2No.
Fuse 4No.
Power Supply Card 2No.
DC 12 volt to 5volt Converter 1No.
DC voltmeter 1No.
AC voltmeter 2No.
Cabels
Contactors
Cable and Magnetic Contactor and Load Calculations
Auto Searching Free Space and Avoid Disturbance Car
Arduino Motor Shield
Arduino Uno
Bty
Servo sg90
HCSR04
DC motor Car
ESC (Electronic Speed Controller )
BEC (Battery Emulator Circuit )
Drone Basic
IMU (Inertial Measure Unit) and Coordinate System
Motor and Propellers
Controllers
What is Arduino?
။
။
။ ATmega328P chip ။
chip ။ computer
USB plug ။ external
electronics ၥ
။ ၥ motors, relays , light
sensors, laser diodes, loudspeakers, microphones, etc:
။ Arduino 2005
။ Arduino Board
။
Document ။
။
Program Writing , Compling and Uploading the
Programs Into the Boards ။
။
http:// www.arduino.cc ။
Tx and Rx card
communication data sent
and received ။ Test Led pin digital pin
13 ။
LED ။
Arduino (UNO) card
။ ။
OUTPUT
ampere 40mA ။ ampere
။ Card ။ 40mA
5V DC relay ။
5V 12V relay ON or OFF
။ 3.3V Power pin external component or device
50mA device
။ Arduino card Flash memory
Program card Upload Sketch
program memory ။ SRAM
Variable memory ။
variable ။ EEPROM
Arduino Nano
Arduino Mega
arduino mega Power 7-12V ။
digital pin 54 pin ။ PWM pulse width
modulation pin 14 pin ။ arduino Uno/Nano
။ analog pin 16 pin ။
flash memory 256KB ။
။ ။
Arduino DUE
။
MCU and MPU
။ MCU
Start–Up period Program
executing ။
memory ။ MCU Flash memory
2MB ။
MPU
။ memory external storage
device ။ P store
memory N - ။
external DRAM load ။ execution ။
MPU MCU ။
memory ။ Hard DISK
memory ။ Power ။ U
Power ။ PU Power
။ ။
။
။ arduino Micro-
Computer Microprocessing unit
။ ။
'
Download ။
Download ။ ။
။
။
။
။ ။
။ Setting ။ ။
Personal Hotspot ။ Wifi Hotspot
။
Wifi ။ Connect ။
Wifi Password Password Configuration ။
password ။
Arduino 1.8.1 ။
Arduino.exe double click ။
drivers folder ။
Windows 64 bit
dpinst-amd64.exe ။ 32bit dpinst-x86 ။
drivers card
arduino nano ။ USB 2.0 drivers
။ Software ။
internet ။ nano card computer ။
device manger ။ Mycomputer>right click>manage ။ Yes ။
„„Open‟‟
sketch “Open‟‟ ။
။
„„Open recent‟‟ Program
။
။ „„Example‟‟
။ „„close‟‟ arduino IDE
။ „„Save‟‟ Program ။
။ „„Save as‟‟
Program
။ ။
„„Edit‟‟ ။
။
„„Sketch‟‟
„„ ‟‟
Card ။
„„Help‟‟
„„Help‟‟ ။
Led ။
။ ။
။ LED
LED
။ Digital 1 or 0 ။ LED
ON Digital 1 5V ။
Digital 0 0V ။ Analog
Type 1V ,2V , 3V, 4V , 5V ။
Digital 1 or 0 ,Output 5V or 0V ။
။ Arduino ။
Arduino digital pin 0 to 13 ။ digital Control
component L ။
INPUT
။
digitalWrite(pin,
Value); Function ။ Pin pin
number ။ LED pin 3 digitalWrite(3,HIGH); ။
digitaWrite(3,LOW); ။ DigitalWriteOUTPUT
pinMode(pin,OUTPUT);
။ DigitalReadINPUT pinMode(pin,INPUT);
။ INPUT ။
default ။ digital
။
။ IDE ။
Arduino Board USB cable Computer ။
LED ။
LED Current and voltage ။
။
Power ။
power
။ ။
။ Power ။
arduino ON 5V ။
LED Voltage 3 L ။
ၥ Voltage
။ ။ LED
Resistor ။
Resistor ။ LED
volt 3V current 10mA ။ R=V/I (O ‟
equation) ။ arduino digital pin ON 5V
။ LED used volt 3V and current 10mA ။ R=5-3/0.01;
= Ω ။
LED 1
Arduino Uno
Bread Board
Jumper wire
arduino card
P AC 220V to DC
5V and 12volt Power card ။
။ ။
။
LED ON and OFF Connection ။
။
။
upload Board and port
error ။ Board and Port
။
#include<lib> ။
။
digitalWrite(
Arduino ။ Built in
။ L
Library or Header
file ။
Program ။
။ void setup(); Function
digital pin 9 Output
pinMode(pin,mode); Function ။ Output
pinMode function
။
။ ။
။ ။
Contorl ။
delay(time); Function
။ time ။ time
ms ။ 1000ms 1s ။
digitalWrite(pin, value); Function
။ “value‟‟ LED ON HIGH၊OFF
LOW ။ Program Verify
။ ။
LED ။
။ loop loop ။
LED ။
Arduino GND bread board GND line ။
။ LED GND and bread board GND line Resistor
။
LED ။ pin 7
LED ON pin 8 LED O ။
pin 7 LED pin 8 LED OFF ။ program
။ pin 7 On ။ 1seconds
။ pin 8 LED ။ ။
။ W
။
၁။ P
၂။ IDE software
၃။ LED
၄။ Resistor
Program ။
။
။
Program English
grammer ။
။ Arduino Program
။
1. Header file (Library file)
2. Structure
3. Variables
4. Functions
5. Control structures
6. Data types
7. Further Syntax
8. Advanced I/O
9. Analog I/O
10. Digital I/O
11. Operators
Arithmetic Operator
Comparison Operators
Boolean Operators
Bitwise Operators
Compound Operators
12. Pointer access Operators
13. Time
14. Math
15. Trigonometry
16. Characters
17. Utilities
18. Random Numbers
19. Bit and Byte
20. Interrupts
21. Communication
22. USB
LIBRARY File
Library file prog ။
။ void setup()
။ ။
။
။
။
Library file
။
LED digitalWrite()
။ Function
library ။
IDEsoftware
။ Wireless device
IDE Wireless driver (LIBRARY) ။
Internet LIB download IDE ။
။
#include<LIB or Header file> ။
။ ။
Wireless device Data transmit
။ W L ။
။ Object name. write (
) ။ ။
။
C language ။ Case
sensitive
။ (I) (i) ။
Structures
“ ‟‟ ။
“ ‟‟
။ but
“ ‟‟ ။
။
equation ။ Program
analog voltage 0 to 5V ။ analogRead(pin);
Function ။ analogRead(pin);
။
0 to 5 ။
a=analogRead(pin)+c; ။
b=analogRead(pin)+d; ။ equation
Variable name ။
။ ။
။
။ Car=
။ Car
။ program ။
။ ။
“ ‟‟ format ။ “ ‟‟
“ ‟‟ ။“ ‟‟ “Variable name‟‟ ။
“ ‟‟ ။ ။
“ ‟‟ ။ „„ ‟‟
“ ‟‟ ။
။ 1 ။
။ - ။
။
။ “ ‟‟
။ “ ‟‟ SRAM
RandomAccessMemory ။ “ ‟‟
။ “ ‟‟
။
arduino “ ‟‟ „„ ‟‟ SRAM
2bytes ။
။ Arduino Uno SRAM 2KB ။ 2KB
။ P
Program ။ Program
keywords ။
။
Program ။
။
4. Function
။ ။Function or Method ။
Function ။
Bluetooth car ။
။
5. Control strutures
Control strutures Program Control
။ Control
။
။ ၊ ၊
၊ ၊
Control ။ Control
။ Program
Contorl ။ Control
။ ။
။ ။
။
။ ။
Control ၊
၊ ။
။
။ Program
။ Contol structure ။
„„if ‟‟
။
if (someVariable >50) ။
{ do something }
။ ။ if
someVariable>50do something ။
။ ။
if condition
။
။
။
။ Prog ။
။ ။
if(buttonPress==1) digitalWrite(2,HIGH); digitalWrite(3,HIGH);
။ ။
။ if condition
။
။ ။ if(buttonPress==1) {
digitalWrite(2,HIGH)} digitalWrite(3,HIGH);
။
။ Comparison and
O ။ ။
Program x 120
။ digitalWrite(LEDpin1,HIGH); ။ 120
။ O
။
။
။ ။
Program
။
။
။ ။
။
။ ။
။ ။
။
။
။ ။
Program ။
if( ==1) { } 1 ။
zero ။ ==
Operator ။ ။
„„ / ‟‟
„„ ‟‟ „„ ‟‟
„„ f‟‟ and „„else if‟‟ ။ “if‟‟ pinFiveInput 500
A „„else if‟‟ pinFiveInput 1000
1000 B „„else‟‟
c ။ „„if
/ else if‟‟ ။ ။
„„else‟‟ „„if‟‟ and „„else if‟‟ ။
။
“ ‟‟ Control
For L ။
။ Limit
။ ။ Counter
။“ ‟‟ Control
။ ။ Condition
။ ၊
၊ ။ Condition
။ ။ Condition
။
Condition O
။
O
။ ။ ++ ။-
- ။ += a+=b;
a= a+ b; ။ -= a = a – b;
။ *= a = a* b; /= a = a / b; %=
a = a%b; ။
„„i=o‟‟ ။ „„ ‟‟
။ Condition „„ <=255‟‟ „„ ‟‟ 255
။
analogWrite(PWMpin,i); ။ „„ ‟‟ (++) ။
analog Write Function analog volt ။
LED ။
LED volt 5V i++
။
Program analogwrite() Function analog
voltage ။ „„ ‟‟
။ analogWrite(PWMpin,0) ။
„„if‟‟ == “ ‟‟ 255
။ “ ‟‟ 0 ။ x = -1
။ 10 milliseconds „„ ‟‟ Control condition
။ i=i+x ; i=0+1; i=1 „ ‟‟ -1
„„ ‟‟ Control ။ „„ ‟‟ x
- ။ 255 Analog read/write
။ “ ‟‟
။ ။
“ ‟‟ „„if‟‟
။
„„w ‟‟
var = 0 ။ „„while‟‟
var<200 ။ var==0
။ var++ ။ „„var‟‟
။ 0 + 1 = 1 „„var‟‟
expression ။
2။
။
။ ။
။ „„while‟‟
။
။
„„ ‟‟
„„ witch case‟‟ ။
switch ။
case ။
။
။ „„ ‟‟
“break;‟‟
Control ။ break
။ ။ ။
။ ။ “break ‟‟
။
“Operators‟‟
“O ‟‟ equation
။ ။
။ O
။ Arithmetic Operators
။ ။ Comparison Operators
။ O
။ Bitwise Operators
။ O
။
program ။
output pin ။ pinMode(13,OUTPUT);
pinMode(LED_BUITIN ,OUTPUT);
။ LED_BUILTIN arduino LED
pin 13 ။ original ။
Built in LED_BUILTIN ။
void loop
digitalWrite(LED_BUILTIN,HIGH) ။
delay(1000); digitalWrite(LED_BUILTIN
,LOW); ။
။ ။Program
။ ။
header file
Variables ။ void setup
။ loop ။
Program ။ Loop
loop
။ Repeat
။
LED ။
LED ၁၁ ။ L
။ ။ ၁၁
။ “ ‟‟ and while loop ။
။
။
LED 11 digital pin
0 to 10 output ။ void setup
pin 10 pinMode(0,1,.. OUTPUT); 10 ၁
pinMode(pin,OUTPUT) ။ “ ‟‟
condition ။ ။
pin 0 pin 10 10
။ 0 ။
။ pin ။ ။
။ ။
“ ‟‟ loop
။ loop ။
loop ။ loop
0 to 10 ။
digitalWrite(pin,HIGH); ON
။ “ ‟‟ loop
“ ‟‟ loop ။
။
။ ။
0 to 10 10
“ ‟‟ loop 10 0 ။
0 to 10 10 to 0
။ ။
pin variable name ။ “ ‟‟ pin
“ ‟‟ pin ။ ။
။
LED 8 number “ ‟‟ loop
။ Resistor 300Ω ၈ LED ၈ ။
။
arduino Uno ။
arduino mega/ Nano /Due ။
Digital pin 2 to 9 Output Digital pin LED
resistor ။
။ ။ LED
။
။ ။
။ LED
။ ။
Device ။ ။
Digital pin IN/OUT
။ variable ၂
။ pin and count ။ void setup() function Digital
Output ။
Output digitalWrite(pin,OUTPUT);
၈ “ ‟‟
loop ၂ ၉
။ Output pin
။ ။
။
။ ။
။
pin 2 to 5, pin 9 to 6
။ Program ။
3 ။ “ ‟‟
။
။ count ။
။ “ ‟‟ pin ။
။ ။
3 count=0
။ count 3 ။ ။
LED ၈ ။ ။ ၁ ။
။ ။
။ ။ ။ ။ ။ ။
။ ။ ။ ။ ။ ။
။ ။ count++
။
။ ++ count ။
။ 2 3 4
6789 ၄ ။
2468 1357
။
LED ၈ 2 2
။ 3 3 ။ 9 ။ ၉
။ ။
။9 ။
pin 2 ။ 3 9
။ 4 ။
pin 9 ။ 2 ။
4 ။ ။ count
pin
။ Delay
။
GND arduino
။ N ။
arduino ။ 5V ။
5V ။
။ 5
GND ။
resistor “PULL OWN‟‟ N
5V
resistor “PULLUP‟‟ ။ “PULL OWN‟‟
system
“PULLUP‟‟ system arduino
။
““PULL OWN‟‟‟‟ system ။
Jumper wire
Arduino card
connection ။
““PULL OWN‟‟‟‟
“PULLUP‟‟
““PULLUP‟‟‟‟ system ။
Internal “PULLUP‟‟ ။ 5V
internal ။ ။
N LOW ။
LOW HIGH ။ ။