Maker Uno Edu Kit Module
Maker Uno Edu Kit Module
INTRODUCTION
Introduction to Components
- Maker UNO 5
- Maker UNO Board 6
-
Setting Up
- Download Arduino IDE 7
- Install Maker UNO Drivers 11
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
Editor :
Atifah Suad Anwar
Idris Zainal Abidin
INTRODUCTION TO COMPONENTS | 4
MAKER-UNO BOARD
Piezo Buzzer Slide Switch
Slide switch to connect Micro USB B Type Connector (Female)
between pin 8 to piezo buzzer. Main supply for Maker Uno. Used for program
To use piezo buzzer, slide the and debug purpose (Serial Monitor) too.
switch on and program the
buzzer. To use pin 8 for other
purpose, slide the switch off. Reset Button
Button to restart Maker UNO program.
Programmable Button
Piezo Buzzer This button is connected to pin 2 and GND. To
Piezo buzzer is connected to use it, user need to configure it as INPUT_PUL-
pin 8 through slide switch. LUP.
INTRODUCTION TO COMPONENTS | 5
INTRODUCTION TO COMPONENTS | 6
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
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 finish downloading for Windows OS
user while for Mac OS user, you will get a zip file of arduino-1.8.x-macosx zip file as shown
below :
Double-click on the icon to install Arduino IDE. Complete the download, proceed with the
installation as usual. After finish 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
Label Description Label Description
A Menu Bar E Code Area
B Button Bar F Status Bar
C Serial Monitor G IDE Output
D Sketch Name H Board Name and COM Number
SETTING UP | 9
Compiles and approves your code. It will
Verify detect errors in syntax (e.g. missing semi colon
or parentheses).
Open
This button will let you open an existing
sketch.
SETTING UP | 10
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
Select Board :
SETTING UP | 12
LESSON 1 :
THE LED (DIGITAL OUTPUT)
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
1
2 Open new sketch on Arduino IDE.
2
Write this code to your sketch :
void setup()
{ // put your setup code here, to run once:
pinMode(7, OUTPUT);
}
void loop()
{ // put your main code here, to run re-
peatedly:
digitalWrite(7, HIGH);
}
LESSON 1 | 17
3 4 3
1
Compile the file.
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.
LESSON 1 | 18
LESSON 2 :
LED (BLINKING)
LESSON 2 :
LED BLINKING (IDE)
i
LED will blink when delay is applied between ON
and OFF. Then it will blinking!
1
1
Open new sketch on Arduino IDE.
2
2
Write this code to your sketch :
void setup()
{
pinMode(7, OUTPUT);
}
void loop()
{
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
}
LESSON 2 | 20
3
1
3 4 Compile the file.
4
4
1
Upload the sketch.
5
1
You will see status of “Done Uploading” if
everything is correct and your LED will
blink.
LESSON 2 | 21
LESSON 3 :
FADE AN LED
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
1
Open new sketch on Arduino IDE.
2 2
Write this code to your sketch :
int LED = 3;
int brightness = 0;
int fadeAmount = 5;
void setup()
{
pinMode(3, OUTPUT);
}
void loop()
{
analogWrite(LED, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255)
{
fadeAmount = -fadeAmount;
}
delay(30);
}
LESSON 3 | 23
3 4 3
1
Compile the file.
4
4
1
Upload the sketch.
5
1
You will see status of “Done Uploading” if
everything is correct and your LED will fade.
LESSON 3 | 24
LESSON 4 :
PUSH BUTTON (DIGITAL INPUT)
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
1
Open new sketch on Arduino IDE.
2
2
Write this code to your sketch :
int LED = 4;
int Button = 2;
void setup()
{
pinMode(4, OUTPUT);
pinMode(2, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(Button) == LOW)
digitalWrite(LED, HIGH);
LESSON 4 | 26
3 4 3
1
Compile the file.
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.
LESSON 4 | 27
LESSON 5 :
SERIAL WRITE
LESSON 5 :
SERIAL WRITE (IDE)
1
1
Open new sketch on Arduino IDE.
2 2
Write this code to your sketch :
void setup()
{
Serial.begin(9600);
Serial.print("Hello, World!");
}
void loop()
{
LESSON 5 | 29
3 4
3
5 1
Compile the file.
4
4
1
Upload the sketch.
5
1
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!
LESSON 5 | 30
LESSON 6 :
SERIAL READ
i
LESSON 6 : Serial display can display numbers and characters
(based on ASCII data) on the Arduino Serial Monitor.
SERIAL READ (IDE) Click on the symbol to enter the input.
1
1
Open new sketch on Arduino IDE.
2
Write this code to your sketch :
int LED = 7;
2 int data = 0;
void setup()
{
pinMode(LED,OUTPUT);
Serial.begin(9600);
}
void loop()
{
if(Serial.available() > 0 )
{
data = Serial.read();
if(data == '1')
{
digitalWrite(LED, HIGH);
}
else if(data == '0')
{
digitalWrite(LED, LOW);
}
}
}
LESSON 6 | 32
3 4
5
3
1
Compile the file.
4
4
1
Upload the sketch.
5
1
You can turn on the LED pin 7 by inserting the letter
“1” and turn it off using “0” at the Serial Monitor.
LESSON 6 | 33
LESSON 7 :
TONE MELODY
LESSON 7 :
TONE MELODY (IDE)
1 1
1
Go to File > Examples > 02. Digital > toneMelody
LESSON 7 | 35
2 3
2
1
Compile the file.
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!
LESSON 7 | 36
LESSON 8 :
POTENTIOMETER AS ANALOG INPUT
LESSON 8 :
SCHEMATIC DIAGRAM
5V 3V3 VIN
13
12
MAKER UNO ~11
~10
~9
8
7
~6
10KΩ A0 ~5
A1 4
A2 ~3
A3 2
A4 TX 1
A5 RX 0
GND
LESSON 8 | 38
LESSON 8 :
POTENTIOMETER ANALOG INPUT (IDE)
1
1
Open new sketch on Arduino IDE.
2
Write this code to your sketch :
void setup()
{
pinMode(ledPin,OUTPUT);
}
void loop()
{
sensorValue = analogRead(sensorPin);
digitalWrite(ledPin, HIGH);
delay(sensorValue);
digitalWrite(ledPin, LOW);
delay(sensorValue);
}
LESSON 8 | 39
3 4
3
1
Compile the file.
4
4
1
Upload the sketch.
5
1
Turn the potentiometer and you will see the blinking
speed change.
LESSON 8 | 40
LESSON 9 :
LDR AS ANALOG INPUT
LESSON 9 :
SCHEMATIC DIAGRAM
5V 3V3 VIN
13
12
MAKER UNO ~11
~10
~9
10KΩ 8
7
~6
A0 ~5
A1 4
LDR A2 ~3
A3 2
A4 TX 1
A5 RX 0
GND
LESSON 9 | 42
LESSON 9 :
LDR ANALOG INPUT (IDE)
1
1
Open new sketch on Arduino IDE.
2
Write this code to your sketch :
void setup()
{
pinMode(ledPin,OUTPUT);
}
void loop()
{
LDRvalue = analogRead(LDR);
if(LDRvalue > 600)
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
}
LESSON 9 | 43
3 4
3
1
Compile the file.
4
4
1
Upload the sketch.
5
1
When it is dark, the LED on pin 13 will light up.
LESSON 9 | 44
LESSON 10 :
CONTROLLING MOTOR
LESSON 10 :
SCHEMATIC DIAGRAM
5V 3V3 VIN
13
M
12
MAKER UNO ~11
~10
~9
c
8
7
b
~6
A0 ~5 220Ω
A1 4
A2 ~3
A3 2
A4 TX 1
A5 RX 0
GND
LESSON 10 | 46
LESSON 10 :
CONTROLLING MOTOR (IDE)
1
1
Open new sketch on Arduino IDE.
2
Write this code to your sketch :
void setup()
2
{
pinMode(6,OUTPUT);
}
void loop()
{
analogWrite(6,255); //same with HIGH
delay(1000);
analogWrite(6,123);
delay(1000);
analogWrite(6,50);
delay(1000);
analogWrite(6, LOW);//same with 0
delay(1000);
}
LESSON 10 | 47
3 4
3
1
Compile the file.
4
4
1
Upload the sketch.
5
1
The motor will rotate with 4 different speed.
LESSON 10 | 48
PROJECT
PROJECT 1
INTERACTIVE TRAFFIC LIGHT
INTRODUCTION
Interactive Traffic Light is a combination of standard traffic light for
vehicles and traffic light for pedestrian.
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 traffic light system for a pedestrian
crossing. Normally, the traffic 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 traffic light turns green again.
PROJECT 1 | 50
HARDWARE CONNECTION
SCHEMATIC DIAGRAM
220Ω
220Ω
13
220Ω
12
MAKER UNO ~11
220Ω
~10
~9
8
7
~6
A0 ~5
A1 4
A2 ~3
A3 2
A4 TX 1
A5 RX 0
GND
PROJECT 1 | 51
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;
void setup()
{
pinMode(greenLedVehicle, OUTPUT);
pinMode(yellowLedVehicle, OUTPUT);
pinMode(redLedVehicle, OUTPUT);
pinMode(greenLedPedestrian, OUTPUT);
pinMode(redLedPedestrian, OUTPUT);
pinMode(pushButton, INPUT_PULLUP);
digitalWrite(greenLedVehicle, HIGH);
digitalWrite(redLedPedestrian, HIGH);
}
void loop()
{
if(digitalRead(pushButton) == LOW)
{
digitalWrite(greenLedVehicle, LOW);
digitalWrite(yellowLedVehicle, HIGH);
delay(2000);
digitalWrite(yellowLedVehicle, LOW);
digitalWrite(redLedVehicle, HIGH);
delay(1000);
digitalWrite(redLedPedestrian, LOW);
digitalWrite(greenLedPedestrian, HIGH);
delay(5000);
digitalWrite(greenLedPedestrian, LOW);
digitalWrite(redLedPedestrian, HIGH);
delay(1000);
digitalWrite(redLedVehicle, LOW);
digitalWrite(greenLedVehicle, HIGH);
}
}
PROJECT 1 | 52
PROJECT 2
LIGHT THEREMIN
INTRODUCTION
A theremin is an instrument that makes sounds based on the move-
ments of a musician’s hands around the instrument. This project will
use LDR as an input where the amount of light intensity will deter-
mine the melody notes.
INGREDIENTS
a. Maker UNO - 1x
b. Breadboard - 1x
c. Resistor 10kΩ - 1x
d. LDR - 1x
e. Jumper wires
INSTRUCTION
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.
PROJECT 2 | 53
HARDWARE CONNECTION
SCHEMATIC DIAGRAM
5V 3V3 VIN
13
12
MAKER UNO ~11
~10
~9
10KΩ 8
7
~6
A0 ~5
A1 4
LDR A2 ~3
A3 2
A4 TX 1
A5 RX 0
GND
PROJECT 2 | 54
ARDUINO CODE
#include "pitches.h"
int melody[49] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NOTE_C2, NOTE_D2, NOTE_E2, NOTE_F2, NOTE_G2, NOTE_A2, NOTE_B2,
NOTE_C3, NOTE_D3, NOTE_E3, NOTE_F3, NOTE_G3, NOTE_A3, NOTE_B3,
NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4,
NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5,
NOTE_C6, NOTE_D6, NOTE_E6, NOTE_F6, NOTE_G6, NOTE_A6, NOTE_B6
};
int sensorValue = 0;
int sensorLow = 1023;
int sensorHigh = 0;
const int ledPin = 13;
void setup()
{
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);