Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Arduino Workshop

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Arduino

Workshop
Tonkar Learning
ຜູ້ດາເນີນການ Workshop

Frank Jim
Co-founder & CEO of CQ Electrical Engineering, UNSW
Co-founder of Tonkar Co-founder of Xiang Miang Lab
ຊະຕາກາຂອງທຸກຄົນທີ່ຈະໄດ້ພົບໃນມື້ນີ້

ນ້ອງຊື່ວ່າ Arduino nano

ສັ່ງນ້ອງເຮັດຫຍັງກໍ່ໄດ້

ພຽງແຕ່ຕໍ່ sensor
ແລ້ວຂຽນໂປແກມບອກນ້ອງພໍ!
ອຸປະກອນທີ່ເຮົາຈະໄດ້ໃຊ້

Inputs ເກັບຂ້ມູນ
(ສາຜັດ) - Sensors

Brain ຕັດສິນໃຈ
(ສະໝອງ) - Microcontroller,
FPGA, RPi

Output ເຮັດສິ່ງຕ່າງໆ
(ການກະທາ) - ດ້ານກົນຈັກ, ເປັ່ງແສງ,
ອອກສຽງ
Brain
(ສະໝອງ)

Output
(ການກະທາ)

Inputs
(ສາຜັດ)
Digital in and out (IO)

Analog in and out (IO) 5V Ground & Vin


Vin
Arduino Integrated Development Environment (IDE)

https://www.arduino.cc/en/main/software

ຫຼື

ເຊື່ອມຕໍ່ wifi LaoITDev (pw: laoitdeV)


Username: guest
Password: laoitdeV

http://192.168.55.247/arduino.zip (mac)
http://192.168.55.247/arduino.exe (windows)
ເກັດຄວາມຮູ້ເລັກໆນ້ອຍໆ
● Digital
○ ມີພຽງ 2 ສະຖານະທີ່ເປັນໄປໄດ້ຄື High (5V) ຫຼື Low (0V)
● Analog
○ ສາມາດມີໄດ້ຫຼາຍສະຖານະ, ເພີ່ມຂຶ້ນຈາກ 0V - 5V
● GND
○ Ground - 0V
● PWM
○ Pulse Width Modulation - ເປັນເຕັກນິກການອ່ານ/ຂຽນ
ຂໍ້ມູນ Analog ດ້ວຍສັນຍານ Digital
Breadboards
ຂົ້ວບວກແມ່ນຂາຍາ

ເລືອກສຽບຊ່ອ
ງ Digital
ໄດ້ຕາມໃຈເລີຍ
ຍົກເວັ້ນ
D0 & D1

ຖັນ Ground

ຕົວຢ່າງການເຊື່ອມດອກໄຟ LED ເຂົ້າກັບ Arduino


ການຂຽນໂປແກມສາລັບ Arduino
Ultrasonic sensor
DHT22 humidity & temperature sensor
Proximity sensor (metal detector)
Bluetooth
LDR photocell (light sensor)
Output: LED

Negative terminal
Positive terminal
Output: LCD I2C

16x2 monitor
Project 1 (LED introduction)
break
1. LCD (2)
2. Ultrasonic (3)
3. Temperature (2)
4. Photocell sensor + LED (2)
5. Bluetooth (2)
Project 1: LCD

LCD connection:
Pin gnd to gnd
pin vcc to 5V
pin SDA to A4
pin SCL to A5

Library update: I2C liquid crystal


Look for the data destination by
using the this code:
https://playground.arduino.cc/Main/I
2cScanner/

after getting the address (normally


0x27): then replace the set up with:
LiquidCrystal_I2C lcd(0x27, 2, 1, 0,
4, 5, 6, 7, 3, POSITIVE);
and #include <liquidCrystal_I2C.h>
Project 2: Ultrasonic

Ultrasonic connection + LCD:


vcc to 5V
gnd to ground
echo to any pin
trig to any pin
Project 3: temperature sensor
Project 4: (photocell + LED)
Project 5: (bluetooth)
Project 6: bluetooth + LCD

ຂັ້ນຕອນ:

1. ເຊື່ອມ 5V ຈາກ bluetooth ໄປ 5V ຂອງ Arduino 10. ເຊື່ອມຕໍ່ bluetooth ໂທລະສັບກັບ sensor ຊື່ HC-05
2. GND ຈາກ bluetooth ໄປ GND ຂອງ Arduino 11. Download app: Serial Bluetooth Terminal
12. ເລືອກ bluetooth HC-05
3. RX ຈາກ bluetooth ໄປ D2 ຂອງ Arduino
13. ສົ່ງຂໍ້ຄວາມ!
4. TX ຈາກ bluetooth ໄປ D3 ຂອງ Arduino
5. GND ຈາກ LCD ໄປ GND ຂອງ Arduino
6. 5V pin ຂອງ LCD ໄປ 5V ຂອງ bluetooth
7. SDA ຂອງ LCD ໄປ A4 ຂອງ Arduino
8. SCL ຂອງ LCD ໄປ A5 ຂອງ Arduino
9. Code: https://pastebin.com/MH5ryhgj

You might also like