Lab 1 - Working with Arduino and Programming (1)
Lab 1 - Working with Arduino and Programming (1)
Students are responsible for submitting the final report by the stated deadline for full
marks. Late submissions will NOT be accepted.
Objective: This Lab is to help students to get start with Arduino & programming
NOTE: The final report should be written in English and submitted with the
programming source files (if any).
- Good luck -
1
IUH Lecturer – Le Ngoc Tran, Ph.D.
https://www.arduino.cc/en/Main/Software
3/ Installing Fritzing
http://fritzing.org/download/
5/ Installing notepad++
https://notepad-plus-plus.org/
2
IUH Lecturer – Le Ngoc Tran, Ph.D.
Lab equipment
# Device Quantity
1 Arduino Board 1
2 BreadBoard 1
3 LED 5
4 Resistor 220Ω 5
5 USB connector 1
6 Jumper Wires 10
7 Battery 9V (optional) 1
8 VOM Multimeter 1
Procedure
1. Connect Arduino to your computer using USB cable
2. Make a simple circuit
3. Use VOM to measure the voltage, current and resistor
http://kythuatphancung.vn/2009/02/15/co-ban-su-dung-dong-ho-vom/
Procedure
1. Use built-in LED (LED 13) for testing
2. Write the code with Arduino IDE:
- LED works in duty cycle: Turn on in 1s and off in 1s
- Change the duty cycle (on/off interval) and see how it works
3
IUH Lecturer – Le Ngoc Tran, Ph.D.
Procedure
1. Use Fritzing tool to draw a circuit diagram as shown in Figure 1
2. Connect LED, and resistor 100 Ω via breadboard and Pin 10 on Arduino
(figure 1)
3. Write the code with Arduino IDE:
- LED works in duty cycle: Turn on in 1s and off in 1s
- Print message in Serial monitor:
+ Print “LED on” in Serial monitor when turning LED on
+ Print “LED off” in Serial monitor when turning LED off
Procedure
1. Connect 3 LEDs, and resistor 220 Ω via breadboard in serial connection and
Pin 10 on Arduino
2. Write the code with Arduino IDE:
- LED works in duty cycle: Turn on in 1s and off in 1s
4
IUH Lecturer – Le Ngoc Tran, Ph.D.
Procedure
1. Connect 3 LEDs, and resistor 220 Ω via breadboard in parallel mode and Pin
10 on Arduino
2. Write the code with Arduino IDE:
- LED works in duty cycle: Turn on in 1s and off in 1s
- Print message in Serial monitor:
+ Print “3 LED in parallel mode on” in Serial monitor when LED on
+ Print “3 LED in parallel mode off” in Serial monitor when LED off
Procedure
1. Connect 3 LEDs, and resistor 220 Ω to 3 pin (8, 9, 10) on Arduino
2. Write the code with Arduino IDE:
- LED turn ON/OFF in sequencing (order 1, 2, 3, …)
Procedure
1. Use 3 LEDs (Red, green, yellow) and resistor 220 Ω to connect to 3 pin Digital
I/O on Arduino
2. Make a traffic light system:
+ Green LED turn ON in 30s
+ Yellow LED on in 3s
+ Red LED on in 20s
+ Working continously in this cycle