IUH Lecturer – Le Ngoc Tran, Ph.D.
Course: CSE479 – Internet of Things (IoT)
Lab 1 – Introduction to Arduino & Arduino Programming
Duration: 4 hours
Group ID Write group number here
Students’ name Write students’ name in the group here
Final Score
Lab Exercise Submission
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
Content Lab Description
- Introduction to Arduino
- Installing Arduino Development Environment
- Configuration of the Arduino program
- Basic applications with Arduino UNO
Lab 1. Introduction to Arduino & o Applications of LED using the GPIO
Arduino Programming o Turning on LED by pressing a switch using
GPIO
o Making a stopwatch using interrupt
▪ Equipment: COMPUTER, Arduino UNO, LED
module, Button Switch
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.
Students are required to perform the following tasks:
Task 01 – Installing Arduino Softwares
1/ Installing Arduino IDE
https://www.arduino.cc/en/Main/Software
2/ Get started with Arduino IDE (see the arduino guide)
3/ Installing Fritzing
http://fritzing.org/download/
4/ Get started with Fritzing (see the Fritzing guide)
5/ Installing notepad++
https://notepad-plus-plus.org/
2
IUH Lecturer – Le Ngoc Tran, Ph.D.
Task 02 – Working with Arduino and Electronic device
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
Task 2.1 – Working with Electronic device and VOM
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/
Task 2.2: LED Blink with built-in LED
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.
Figure 1. Using Breadboard
Task 2.3: LED Blink with breadboard
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
Task 2.4: LEDs in serial mode
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.
- Print message in Serial monitor:
+ Print “3 LED in serial mode on” in Serial monitor when turning LED on
+ Print “3 LED in serial mode off” in Serial monitor when turning LED off
Task 2.5: LEDs in parallel mode
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
Task 2.6: Turn ON/OFF LED in sequencing
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, …)
Task 2.7: Make a traffic light system
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