Advisor and Supporter :
Phang Chin Yee
Ober Choo Sui Hong
Suhana Azmi
Lim Siaw Chiat
Tan Eng Tong
LESSONS
1. The LED (Digital Output) 16
2. LED Blinking 19
3. LED Output (PWM) 22
4. Push Button as Digital Input 25
5. Serial Write 28
6. Serial Read 31
7. Tone Melody 34
8. Potentiometer as Analog Input 37
9. LDR as Analog Input 41
10. Controlling Motor 45
PROJECTS
Interactive Trac Light 50
Light Theremin 53
Page 3
INTRODUCTION
Page 4
MAKER-UNO
Maker UNO, an Arduino UNO compatible board designed and developed specially for
students to learn coding and microcontroller. We named it Maker UNO to encourage every-one to be a maker by getting started with this amazing board..
MAKER - UNO Features:
- SMD ATmega328P microcontroller(the same microcontroller on Arduino UNO) with
Optiboot (UNO) Bootloader.
- USB Programming facilitated by the CH340.
- Input voltage: USB 5V, from computer, power bank or standard USB adapter.
- 500mA (maximum) 3.3V voltage regulator.
- 0-5V outputs with 3.3V compatible inputs.
- 14 Digital I/O Pins (6 PWM outputs).
- 6 Analog Inputs.
- ISP 6-pin Header.
- 32k Flash Memory.
- 16MHz Clock Speed.
- R3 Shield Compatible.
- LED array for 5V, 3.3V, TX, RX and all digital pins.
- On board programmable push button (pin 2, need to congure as INPUT_PULLUP).
- On board piezo buzzer (pin 8).
- Utilize USB Micro-B socket.
- PURPLE PCB!
INTRODUCTION TO COMPONENTS
| 4
Page 5
MAKER-UNO BOARD
Piezo Buzzer Slide Switch
Slide switch to connect
between pin 8 to piezo buzzer.
To use piezo buzzer, slide the
switch on and program the
buzzer. To use pin 8 for other
purpose, slide the switch o.
Piezo Buzzer
Piezo buzzer is connected to
pin 8 through slide switch.
Power Pin
GND - Ground Pins
5V - Regulated 5V output
3V3 - Regulated 3.3v supply
Analog Pin
This pin can be used with
analogRead(); to read an
input in analog form (0-1023)
MicroUSBBTypeConnector(Female)
Main supply for Maker Uno. Used for program
and debug purpose (Serial Monitor) too.
Reset Button
Button to restart Maker UNO program.
Programmable Button
This button is connected to pin 2 and GND. To
use it, user need to congure it as INPUT_PULLU P.
Series of LED for Digital I/O
Every digital IO is equipped with LED, where
you can control it or make it as indicator for
input.
PWM Pin
The digital pin that has this symbol can only use
analogWrite(); to control the output. (0-255)
Digital Pin
This pin can be used with :
digitalRead(); as an input
digitalWrite(); as an output
~
INTRODUCTION TO COMPONENTS
| 5
Page 6
INTRODUCTION TO COMPONENTS
| 6
Page 7
DOWNLOADING ARDUINO IDE
Maker UNO requires Arduino software to run. You can download the software from Arduino
website (http://arduino.cc/en/Main/Software) and it is free to use.
Arduino IDE is compatible with Windows, Mac OS X and also Linux. You just need to choose
the appropriate operating system installation package for your computer.
*Note: If you are a Windows user, it is recommended that you choose Windows (installer).
SETTING UP
| 7
Page 8
Choose the installer that compatible with your laptop OS and download the Arduino IDE.
You will have arduino-1.8.x-windows.exe software after nish downloading for Windows OS
user while for Mac OS user, you will get a zip le of arduino-1.8.x-macosx zip le as shown
below :
*Note: For latest version of Arduino IDE, go to https://www.arduino.cc/en/Main/Software
Double-click on the icon to install Arduino IDE. Complete the download, proceed with the
installation as usual. After nish installing the software, you can start using it by double-click
on the icon. Then, you will see this layout of Arduino IDE.
SETTING UP
| 8
Page 9
Label
LabelDescription
Description
A
D
Menu Bar
B
C
Button Bar
Serial Monitor
Sketch Name
G
H
E
F
Code Area
Status Bar
IDE Output
Board Name and COM Number
SETTING UP
| 9
Page 10
Verify
Upload
Compiles and approves your code. It will
detect errors in syntax (e.g. missing semi colon
or parentheses).
Sends your code to the Maker UNO. When you
click it, you should see the lights on your
board blink rapidly.
New
Sketch
Open
Save
This button opens up a new code window tab.
This button will let you open an existing
sketch.
This saves the currently active sketch.
Serial
Monitor
Open Serial Monitor.
SETTING UP
| 10
Page 11
installing MAKER uno driver
Download Maker UNO driver at Maker Uno product page (under Attachment tab). Please
choose appropriate driver depends on your OS. Complete the download, proceed with the
installation as usual.
After installation is complete, your Maker UNO port should appears at Device Manager
under Ports (COM & LPT) - e.g. USB-SERIAL CH340 (COM3). Please remember the port
number.
SETTING UP
| 11
Page 12
Select Board :
Select Serial Port :
SETTING UP
| 12
Page 13
LESSON 1 :
THE LED (DIGITAL OUTPUT)
Page 14
LESSON 1 :
LIGHT UP THE LED (IDE)
i
LED is a light emitting diode. It will light up when a proper
voltage is applied in correct direction.
1
2
Open new sketch on Arduino IDE.
2
1
Write this code to your sketch :
voidsetup()
{ // put your setup code here, to run once:pinMode(7, OUTPUT);
}
voidloop()
{ // put your main code here, to run re-
peatedly:
digitalWrite(7, HIGH);
}
LESSON 1
| 17
Page 15
43
3
1
Compile the le.
4
4
1
Upload the sketch.
5
1
You will see status of “Done Uploading”if
everything is correct your LED at pin 7 will light up.
The void setup() runs once when the Maker UNO
is powered on. The code in the void setup() usually
use to congure the pin as INPUT or OUTPUT
using pinMode();
The void loop() runs continuously after the void
setup() has complete. The code in the void loop()
usually use to control the INPUT and OUTPUT.
The digitalWrite(); is used to set the digital
OUTPUT of the pin number to HIGH or LOW
LESSON 1
| 18
Page 16
LESSON 2 :
LED (BLINKING)
Page 17
LESSON 2 :
LED BLINKING (IDE)
i
LED will blink when delay is applied between ON
and OFF. Then it will blinking!
You will see status of “Done Uploading” if
everything is correct and your LED will
blink.
1
The digitalWrite(7, HIGH); digital pin number 7
is set to HIGH which is to turn ON the LED while
the digitalWrite(7, LOW); digital pin number 7 is
set to LOW which is to turn OFF the LED.
The delay(); is a function to make the Maker UNO
execute anything for the time set in miliseconds.
1000 is equal to 1second.
LESSON 2
| 21
Page 19
LESSON 3 :
FADE AN LED
Page 20
LESSON 3 :
FADE AN LED(IDE)
i
The LED will fade using analogWrite() function using
Pulse Width Modulation (PWM) which make a digital
output acting as analog output.
1
Open new sketch on Arduino IDE.
2
2
Write this code to your sketch :
int LED = 3;
int brightness = 0;
int fadeAmount = 5;
You will see status of “Done Uploading” if
everything is correct and your LED will fade.
1
The analogWrite() function uses PWM, so if
you want to change the pin you're using, be
sure to use another PWM capable pin. On most
Arduino, the PWM pins are identied with
a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.
The analogWrite(LED, brightness); set OUTPUT
of the pin number 3 to variable “brightness”. The
LED will light up based on the amount of variable
“brightness”.
LESSON 3
| 24
Page 22
LESSON 4 :
PUSH BUTTON (DIGITAL INPUT)
Page 23
LESSON 4 :
PUSH BUTTON (IDE)
i
Push button act as a digital input device. Maker UNO
is able to sense 2 states for digital input, i.e. HIGH and
LOW. Push the button and the LED will turn ON!
1
Open new sketch on Arduino IDE.
2
2
Write this code to your sketch :
int LED = 4;
int Button = 2;
voidsetup()
{
pinMode(4, OUTPUT);
pinMode(2, INPUT_PULLUP);
}
voidloop()
{
if (digitalRead(Button) == LOW)
digitalWrite(LED, HIGH);
1
else if (digitalRead(Button) == HIGH)
digitalWrite(LED, LOW);
}
LESSON 4
|
26
Page 24
43
3
1
Compile the le.
4
4
1
Upload the sketch.
5
1
You will see status of “Done Uploading” if
everything is correct, when button is pressed, the
LED pin 4 will light up.
1
Using pinMode(INPUT_PULLUP), there is an
internal 20K-ohm resistor is pulled to 5V. This
conguration causes the input to read HIGH when
the switch is open, and LOW when it is closed.
The if() statement is use to compare a condition
whether it is TRUE or FALSE.
The else if() statement is use to set other condition than if() statement.
The digitalRead(Button) == LOW); will read the
button input. If the button is pushed, the INPUT
will be LOW.
You will see the Button status through the Serial
Monitor. Press the button to see the result!
i
Click on the symbol to see the result!
1
The Serial.begin(); open a serial communication
between the Maker UNO and the computer. 9600
is the baud rate of the comunication. The serial
monitor must use the same baud rate to view the
information.
The Serial.print(); sends information from Maker
UNO to the connected computer. The information
will be in the serial monitor.
The Serial.println(); sends information from
Maker UNO to the connected computer. The information will be in the serial monitor and print out
line by line.
LESSON 5
| 30
Page 28
LESSON 6 :
SERIAL READ
Page 29
LESSON 6 :
SERIAL READ (IDE)
i
Serial display can display numbers and characters
(based on ASCII data) on the Arduino Serial Monitor.
Click on the symbol to enter the input.
You can turn on the LED pin 7 by inserting the letter
“1” and turn it o using “0” at the Serial Monitor.
1
The Serial.available() get the number of bytes
(characters) available for reading from the serial
port.
The Serial.read() reads all the incoming data in
Maker UNO.
LESSON 6
| 33
Page 31
LESSON 7 :
TONE MELODY
Page 32
LESSON 7 :
TONE MELODY (IDE)
1
1
Go to File > Examples > 02. Digital > toneMelody
1
LESSON 7
| 35
Page 33
32
2
1
Compile the le.
i
4
3
1
Upload the sketch.
4
1
You can change the music note based on your
preference and enjoy the music tone.
1
i
You can refer to the next tab pitches.h for more music
note!
{
analogWrite(6,255); //same with HIGHdelay(1000);
analogWrite(6,123);
delay(1000);
analogWrite(6,50);
delay(1000);
analogWrite(6,
LOW);//same with 0
delay(1000);
}
LESSON 10
| 47
Page 45
43
3
1
Compile the le.
4
4
1
Upload the sketch.
5
1
The motor will rotate with 4 dierent speed.
LESSON 10
| 48
Page 46
PROJECT
Page 47
PROJECT 1
INTERACTIVE TRAFFIC LIGHT
INTRODUCTION
Interactive Trac Light is a combination of standard trac light for
vehicles and trac light for pedestrian.
This project applies knowledge outcome from:
Lesson 1: Light Up LED
Lesson 4: Push Button as Digital Input
INGREDIENTS
a. Maker UNO - 1x
b. Breadbord - 1x
c. Red LED - 2x
d. Green LED - 2x
e. Yellow LED - 1x
f.
Resistor 220Ω - 5x
g. Jumper wires
INSTRUCTION
By using all the parts above, create a simple trac light system for a pedestrian
crossing. Normally, the trac light is green. But when the push button is pressed,
the light will switch to yellow for two seconds, then to red. After 1 more second,
the green pedestrian light will light up for 5 seconds, then turns back to red.
After 1 more second, the trac light turns green again.
PROJECT 1
| 50
Page 48
HARDWARE CONNECTION
SCHEMATIC DIAGRAM
5VVIN3V3
MAKER UNO
A0
A1
A2
A3
A4
A5
GND
13
12
~11
~10
~9
~6
~5
~3
TX 1
RX 0
220Ω
220Ω
220Ω
220Ω
220Ω
8
7
4
2
PROJECT 1
| 51
Page 49
ARDUINO CODE
const int greenLedVehicle = 5;
const int yellowLedVehicle = 6;
const int redLedVehicle = 7;
const int greenLedPedestrian = 3;
const int redLedPedestrian = 4;
const int pushButton = 2;
A theremin is an instrument that makes sounds based on the movements of a musician’s hands around the instrument. This project will
use LDR as an input where the amount of light intensity will determine the melody notes.
Using all the parts above create an instrument that creates melody played by
piezo depends on your hand position. The closer your hand is to the LDR, the
higher the notes produced. When you withdraw your hand, no sound will be
generated. So, enjoy the melody you create!
Note: To calibrate the sensor, move your hand up and down over the LDR for 5
seconds to change the amount of light that reaches it. The closer you replicate
the motions you expect to use while playing the instrument, the better the
calibration will be.