50% found this document useful (2 votes)
1K views

RoboTek Arduino Level 1

This document provides an introduction to robotics and Arduino. It discusses how robots perform tasks, the characteristics of robots, and their ideal uses. It also covers microcontrollers and how they allow robots to understand instructions. The document explains what a breadboard is and how it is used to create circuits and connect components. Practical activities and assessments are included to help students learn.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
1K views

RoboTek Arduino Level 1

This document provides an introduction to robotics and Arduino. It discusses how robots perform tasks, the characteristics of robots, and their ideal uses. It also covers microcontrollers and how they allow robots to understand instructions. The document explains what a breadboard is and how it is used to create circuits and connect components. Practical activities and assessments are included to help students learn.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 287

ROBOTEK:

INTRODUCTION TO ARDUINO
LEVEL 1
MODULE 1

1 How do robots perform tasks?


2 Microcontroller
3 Breadboard
4 How do circuits and LED work?
5 Parts of Arduino IDE (Sketch)
6 How to Manipulate Arduino IDE
7 Conditional Control Structures
SESSION 1: HOW DO ROBOTS
PERFORM TASKS?
ROBOTS AND THEIR CHARACTERISTICS
Session 1: How do robots perform tasks?

Target Outcomes

At the end of this session, the students are able to:


Define robots and robotics
Explain the importance of Laws of Robotics
Differentiate robots based on their characteristics
and its’ ideal task.
Session 1: How do robots perform tasks?

Materials
- plastic bottle
- rubber band
- dynamo
- popsicle stick
- paper
- plastic cups
Session 1: How do robots perform tasks?
Assessment Task 1a

1. Form a group with six (6) members. Assign a leader.


2. The command sheet will be given to the leader. He/she will be the
one to read the commands. The remaining five will portray the ff.:
1. the right arm
2. left arm
3. body
4. left leg
5. right leg
The group that will make the movements correctly and accurately
will be the winner. Note: No commands, no movement. Every
extra movement will be equivalent to deductions.
Key Discussion

Greek God Hephaestus


was the god of fire,
metalworking, stone masonry,
forges and the art of sculpture.
He was the one making all of
the weapons for Olympus and
acting as a blacksmith for the
gods.
Session 1: How do robots perform tasks?
Key Discussion
 ROBOT - also called as droid is a machine—especially one
programmable by a computer— capable of carrying out a
complex series of actions automatically.
 Robots can be guided by an external control device or the
control may be embedded within.
 Robots may be constructed to take on human form but most
robots are machines designed to perform a task with no
regard to how they look.
 Robots can be autonomous or semi-autonomous.
Session 1: How do robots perform tasks?

 Assessment Task 1b

Let us try to find out the characteristics of a robot.


Close your eyes and follow the instructions you will hear.
Session 1: How do robots perform tasks?

Key Discussion
Characteristics of Robotics
1. Sensing – to be able to sense its
surroundings
2. Movement – to be able to move around its
environment
3. Energy – to be able to have power
4. Intelligence – a robot needs some kind of
“smarts”
Session 1: How do robots perform tasks?
Key Discussion
Ideal task for robots
1. Dangerous
2. Repetitive
3. High Precision
Robots are usually applied four D’s:
1. Dirty
2. Dangerous
3. Dull and
4. Difficult for human to perform
Session 1: How do robots perform tasks?
Practical Activity

1. Form a group with six (6) members.


2. Choose materials from the following. Make a visual
model or plans of an ideal robot that can help the
community.
- plastic bottle - rubber band
- dynamo - popsicle stick
- paper - plastic cups
Session 1: How do robots perform tasks?
Assessment Task 2a

1. In your own understanding, what is a


robot?
2. What are the law of robotics?
3. What do you think is the use of the
robot in our daily life?
4. Give the 3 ideal task for robots and
explain.
5. For you, do we need robots to replace
humans in the factory?
Session 1: How do robots perform tasks?
Assessment Task 2b (optional)

Group task: In 3mins, the group with six


members will show a short tableau
showing the different characteristics of a
robot.
Rubrics:
content – 50%
creativity – 30%
group participation -20%
Session 1: How do robots perform tasks?

Subject Integration
1. Science- describe some properties of metals
and non-metals such as its invulnerability.
2. English – Discover literature as a means of
connecting to a significant past.
SESSION 2: HOW DO ROBOTS
UNDERSTAND INSTRUCTIONS?
MICROCONTROLLER
Session 2: How do robots understand instructions?

Target Outcomes

At the end of this session, the students are able to:

 Outline the different parts of an Arduino


microcontroller.
 Name and identify the parts and
function of an Arduino microcontroller.
 Analyze each parts and its use for the
robots.
Session 2: How do robots understand instructions?

Materials

- Arduino Microcontrollers
Session 2: How do robots understand instructions?

MCU
Session 2: How do robots understand instructions?

Key Discussion

 MICROCONTROLLER - (or MCU,


short for microcontroller unit) is a
small computer (SoCon) a single
integrated circuit containing a
processor core, memory, and
programmable input/output periph
erals.
Session 2: How do robots understand instructions?

Assessment task 1b
The students will label
each part of an actual
Arduino as the teacher
discussed the parts one
by one based from the
picture in the students
handouts.
Session 2: How do robots understand instructions?
Key Discussion
1. Power IN (Barrel Jack)

2. Power IN (USB Port)

3. LED (RX: Receiving)


Session 2: How do robots understand instructions?

Key Discussion

4. LED (TX:
Transmitting)

5. LED
(Troubleshooting)
Session 2: How do robots understand instructions?
Key Discussion
 6. Pins (Digital, Analog,
Ground) - It can be used for
input, output, power and
ground.
Pin 0 – 13
Analog Output Pins / PWM
Pins
Pin ~ 3, ~5, ~6, ~9, ~10 and
~11
 7. LED (ON/OFF) - It indicates
if there is a power.
Session 2: How do robots understand instructions?
Key Discussion
 8. Reset Button - It manually reset the
Arduino that make your code to
restart.
 9. Pins (Analog In, Power In, Ground
Power Out, Reset) - It can be used for
input, output, power and ground.
1.Pin A0 – A5
2. Power Pin
3. Reset
4. +3.3 V
5. 5V
6. Ground
7. VIN (Voltage/Power IN)
Session 2: How do robots understand instructions?
Key Discussion

ARDUINO is a single-board microcontroller


to make using electronics in
multidisciplinary projects more
accessible.
 The hardware consists of a simple open
source hardware board designed around
an 8-bit Atmel AVR microcontroller, or a
32-bit Atmel ARM.
Session 2: How do robots understand instructions?
Key Discussion

 Specifications
 Microcontroller: ATmega328
 Operating Voltage: 5V
 Input Voltage (Recommended): 7 - 12V
 Input Voltage (limits): 6 - 20V
 Digital I/O Pins: 14 (of which 6 provide PWM
output)
 Analog Input Pins: 6
Session 2: How do robots understand instructions?

Key Discussion

 DC Current per I/O Pin: 40 mA


 DC Current for 3.3V Pin: 50 mA
 Flash Memory: 32 KB (ATmega328)
 SRAM: 2 KB (ATmega328)
 EEPROM: 1 KB (ATmega328)
 Clock Speed: 16 MHz
Session 2: How do robots understand instructions?

Practical Activity (Group)


Oral recitation:
Depending on the number of participants divide
the class into either 8 separate groups and tell
the students that you are going to give each
group the parts of the MCU and the other group
will explain the function of each part.
Label the parts.
Session 2: How do robots understand instructions?

Assessment task 2
Answer the questions based on the set up.
1. What if Power In (USB port) is not detected in
the Arduino IDE?
2. Where do you think is the problem if LED
(ON/OFF) don’t have light?
3. What if Power In (barrel jack) will be
connected to 15V?
Subject Integration

 Science – (electricity) describe the


different types of charging processes.
 English – (viewing comprehension)Use
structural analysis to determine the
meaning of unfamiliar words or
expressions from the material viewed
SESSION 3: HOW DO BREADBOARD?
BREADBOARD
Target Outcomes
At the end of this session, the students are able
to:
 Name and identify the parts of a
breadboard and,
 Explain the use of a breadboard.
Materials

 Extension cord
 Breadboard
Session 3: How breadboard and wiring connection works?
Assessment Task 1a

1.What’s
this?

2. What is
its use?
Session 3: How breadboard and wiring connection works?

Key Discussion

 BREADBOARD – is used to
create circuits and connect
different sensors and
actuators to the Arduino
board it also refers to a
solderless breadboard.
BREADBOARD
Session 3: How breadboard and wiring connection works?

Key Discussion

 Prototyping is the process of


testing an idea by creating a
preliminary model from which
other forms are developed or
copied, and it is one of the most
common uses for breadboards.
Terminal strip

 is located inside the breadboard. This


allows you to stick a wire or the leg of
any component into the exposed holes
on a breadboard, which then hold it in
place. It clips the leg of the wire.
Session 3: How breadboard and wiring connection works?

Key Discussion

Single terminal strip of conductive metal


Session 3: How breadboard and wiring connection works?

Assessment Task 1b
Observe the picture Power Rails
and identify the parts
of an actual
breadboard.

 Inside a Breadboard Terminal Strip


Power Rails
Session 3: How breadboard and wiring connection works?

Key Discussion

 1– Serial connection
from positive 1 to
30 is used to
connect the
horizontal pins
which is called
power rails.
Session 3: How breadboard and wiring connection works?

Key Discussion

 2– Serial
connection from
A1, B1, C1, D1
and E1 is used to
connect the
vertical pins.
Session 3: How breadboard and wiring connection works?

Key Discussion

 3– Trench serves a very


important purpose, if a dual
in-line package or DIP chip
is used, there is a separation
of connection is made so that
if connection is made to each
side of the IC there will be
no interference between the
functionality of the leg on
the opposite side.
Identify the parts of a breadboard using the sample
picture below. Write your answer in the box.
Session 4: HOW DO CIRCUITS, AND LED WORK?

Types of Circuit
Connection
Target outcomes:

 At the end of this session, the students


will be able to:
 Name and identify the parts of a circuit
connections, and LED.
 Explain the use of a circuit connections,
and LED.
 Perform wiring connections with a
breadboard and LED.
Assessment task 1c

Analyze the pictures.


Q: What are their
similarities and
differences?
Fig. 1

Fig. 2

Fig. 3
Path

Source
Fig.1 Schematic Wiring Fig. 2 Breadboard Wiring

Key Discussion

 Parallel Circuit Connection


It is an electrical connection that has two or
more paths for the current to flow which
the loads are parallel to each other.
Fig.1 Schematic Wiring

Fig. 2 Breadboard Wiring


Key Discussion

 Series Circuit Connection


It is an electrical connection that is
connected along a single path were the
current flows in the same direction.
switch

Fig.1 Schematic Wiring

Fig. 2 Breadboard Wiring


Key Discussion

 Switch Circuit Connection


It is an electrical connection which are
installed on one path that allow or disallow
the flow of current to a device from the
source.
Practical Activity

Identify the parts of a


given set up of a
circuit.
Assessment Task 2
Label each part.
5.
1. 2. 3.

4.
Session 4: How LED works with the breadboard and MCU?

Light Emitting
Diode (LED)
Session 4: How LED works with the breadboard and MCU?

Assessment task 1
Label each
part of an
actual LED
from the
picture.
Session 4: How LED works with the breadboard and MCU?
Key Discussion

 LIGHT EMITTING DIODE (LED)


– A semiconductor diode that
converts electric energy into
electromagnetic radiation at a
visible and near infrared
frequencies when its pn
junction is forward biased.
Session 4: How LED works with the breadboard and MCU?

Key Discussion

In short, LEDs are like tiny light


bulbs. However, LEDs require a
lot less power to light up by
comparison
Session 4: How LED works with the breadboard and MCU?

Key Discussion

LED Electronic Symbol

1 – Short pin to be connected to GND (ground)


2 – Longer pin to be connected to any of the
digital pins (pins 2 – 13)
Session 4: How LED works with the breadboard and MCU?

Key Discussion

Sample schematic diagram of LED


connection with Resistor connected
to an Arduino Microcontroller
 Practical Activity:

Make a set up using LED and a


breadboard.
Session 4: How LED works with the breadboard and MCU?

Assessment Task 2b

1.
2. Essay:
3. Explain the use of:
4. 11-15. breadboard
6.
16-20.circuit
5.
7. connections
21-25. LED.
8.

9. 10.
Subject Integration

 Science – (electricity) describe the


different types of charging processes.
- (light) relate characteristics of
light such as color, intensity and
frequency.
 English - Give the meaning of given signs
and symbols .
SESSION 5: PARTS OF ARDUINO IDE
(SKETCH)
PARTS, SETTING-UP, SKETCH CODE AND CONDITIONAL CONTROL STRUCTURE
SESSION 5: PartS of Arduino IDE (Sketch)
Target Outcomes
At the end of the session, the students are
able to:
 Know Arduino IDE
 Identify and name the parts of the
Arduino IDE.
SESSION 5: PartS of Arduino IDE (Sketch)

Materials

 Desktop and Arduino installer


Key Discussion
Key Discussion

Verify / Compile Checks the code for errors

Upload Uploads the current Sketch to the Arduino

New Creates a new blank Sketch

Open Shows a list of Sketches in your sketchbook

Save Saves the current Sketch

Serial Monitor Displays serial data being sent from the Arduino
Assessment Task 1

Form two (2) groups.


Match the correct
symbol and parts with its
name.
II. Identify what is being described. Write your answer
on the space provided.

__________1. Saves a. hex file that may be kept as archive or sent to the board
using other tools.
__________2. Opens the current sketch folder.
__________3. Adds a library to your sketch by inserting #include statements at the
start of your code.
__________4. Adds a source file to the sketch (it will be copied from its current
location.
__________5. Checks your sketch for errors compiling it; it will report memory
usage for code and variables in the console area.
__________6. Compiles and loads the binary file onto the configured board through
the configured Port.
__________7. This will overwrite the bootloader on the board; you will need to use
Tools > Burn Bootloader to restore it and be able to Upload to USB serial port again.
SESSION 6: HOW TO
MANIPULATE ARDUINO IDE
PARTS, SETTING-UP, SKETCH CODE AND CONDITIONAL CONTROL STRUCTURE
Target outcomes:

At the end of the session, the students


will be able to:
 Sketch code and conditional control
structures.
 Differentiate conditional controls based
on its structure.
Session 6: HOW TO MANIPULATE ARDUINO IDE

Arduino Interface
Development
Environment
Session 6: HOW TO MANIPULATE ARDUINO IDE
Key Discussion

SELECTING THE MICROCONTROLLER


SELECTING THE MICROCONTROLLER

 To pick the correct microcontroller


board click Arduino/Genuino Uno by
clicking Tools>Board on the Menu Bar.
The microcontroller name will be based
upon the MCU that you are using. Since
you are using Arduino/ Genuine Uno,
you will choose it. This shows the
connection of the MCU to your laptop or
desktop.
Session 6: HOW TO MANIPULATE ARDUINO IDE
Key Discussion

SELECTING THE PORT


SELECTING THE PORT

 Select the port on where the


microcontroller board is connected by
clicking Port/COM5(Arduino/Genuino
Uno).
 This is for the USB port; the name will
appear depending on the computer that
you are using. If in case you think that
your port is not functioning, you check
this.
Sketch

  A sketch is the name that Arduino


uses for a program. It's the unit of code
that is uploaded to and run on an
Arduino board.
Session 6: HOW TO MANIPULATE ARDUINO IDE

Key Discussion

void setup( ) {
// put your setup code here, to run once:
}
void loop( ) {
// put your main code here, to run repeatedly:
}
SKETCH – SAMPLE CODE
Assessment
SESSION 7: CONDITIONAL CONTROL STRUCTURES

Conditional Control
Structure
Target outcomes:

At the end of the session, the students


will be able to:
 Sketch code and conditional control
structures.
 Differentiate conditional controls based
on its structure.
SESSION 7: CONDITIONAL CONTROL STRUCTURES
Key Discussion
1. if CONDITIONAL STATEMENT
10 void loop()
11 {

12 delayTime = delayTime - 100;


13 if(delayTime <= 0 {
14 delayTime = 1000;
15 }
16 digitalWrite(kPinLed, HIGH);
17 delay(delayTime);
18 digitalWrite(kPinLed, LOW);
19 delay(delayTime);
20 }

CONDITIONAL CONTROL STRUCTURE


SESSION 7: CONDITIONAL CONTROL STRUCTURES
Operator Meaning
= assignment operator
+ addition operator
- subtraction operator
* multiplication operator
/ division operator - be aware that if you are using integers only the whole part is kept. It is NOT
rounded.
For example: 5 / 2 == 2

% modulus operator - This gives the remainder.


For example: 5 % 2 == 1

== is equal to
!= is not equal to

< is less than


> is greater than
<= is less than or equal to
>= is greater than or equal
SESSION 7: CONDITIONAL CONTROL STRUCTURES
Key Discussion

2. else CONDITIONAL STATEMENT

10 void loop()
11 {
12 if(delayTime <= 100){
13 delayTime = 1000;
14 }
15 else{
16 delayTime = delayTime - 100;
17 }
18 digitalWrite(kPinLed, HIGH);
19 delay(delayTime);
20 digitalWrite(kPinLed, LOW);
21 delay(delayTime);
22 }
SESSION 7: CONDITIONAL CONTROL STRUCTURES
Key Discussion

3. while CONDITIONAL STATEMENT


10 void loop()
11 {
12 while(delayTime > 0){ // while delayTime is greater than 0
13 digitalWrite(kPinLed, HIGH);
14 delay(delayTime);
15 digitalWrite(kPinLed, LOW);
16 delay(delayTime);
17 delayTime = delayTime - 100;
18 }
19 while(delayTime < 1000){ // while delayTime is less than !! "" 1000
20 delayTime = delayTime + 100;
21 digitalWrite(kPinLed, HIGH);
22 delay(delayTime);
23 digitalWrite(kPinLed, LOW);
24 delay(delayTime);
25 }
26 }
SESSION 7: CONDITIONAL CONTROL STRUCTURES
4. If…else if CONDITIONAL STATEMENT

void loop ()
{
int x, y, z;
x = analogRead (JoyStick_X);
y = analogRead (JoyStick_Y);

if (x == 1023){
digitalWrite(led1, HIGH);
}
else if (x == 0){
digitalWrite(led2, HIGH);
}
else if (y == 1023){
digitalWrite(led3, HIGH);
}
else if (y == 0){
digitalWrite(led4, HIGH);
}
else {
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
}
SESSION 7: CONDITIONAL CONTROL STRUCTURES

COMBINATIONS
Operator Example Meaning

&& (A < 10) && (B > 5) logical AND (return TRUE if condition A AND condition B are true,
otherwise return FALSE.)

|| (A < 10) || (B > 5) logical OR (return TRUE if condition A OR condition B is true,


otherwise return FALSE.)

!! (A < 10) logical NOT (return TRUE if condition A is false, otherwise return
FALSE.)
SESSION 7: CONDITIONAL CONTROL STRUCTURES

For example:

int ledState = LOW;

void loop()
{
ledState = !ledState;
digitalWrite(kPinLed, ledState);
delay(1000);
}
SESSION 7: CONDITIONAL CONTROL STRUCTURES

5. for CONDITIONAL STATEMENT

8 void loop()
9 {

10 for(int i = 0; i < 4; i++){

11 digitalWrite(kPinLed, HIGH);
12 delay(200);
13 digitalWrite(kPinLed, LOW);
14 delay(200);
15 }

16 delay(1000); // 1 second
17 }
SESSION 7: CONDITIONAL CONTROL STRUCTURES

Practical Activity

 Set up Arduino Interface


Development Environment for
Arduino Uno based from the
instruction.
SESSION 7: CONDITIONAL CONTROL STRUCTURES

Assessment Task 2

I. Identify the conditional control


structure given.
SESSION 7: CONDITIONAL CONTROL STRUCTURES

1.

10 void loop()
11 {

12 delayTime = delayTime - 100;


13 if(delayTime <= 0 {
14 delayTime = 1000;
15 }
16 digitalWrite(kPinLed, HIGH);
17 delay(delayTime);
18 digitalWrite(kPinLed, LOW);
19 delay(delayTime);
20 }
SESSION 7: CONDITIONAL CONTROL STRUCTURES

2.

8 void loop()
9 {

10 for(int i = 0; i < 4; i++){

11 digitalWrite(kPinLed, HIGH);
12 delay(200);
13 digitalWrite(kPinLed, LOW);
14 delay(200);
15 }

16 delay(1000); // 1 second
17 }
SESSION 7: CONDITIONAL CONTROL STRUCTURES
3.
void loop ()
{
int x, y, z;
x = analogRead (JoyStick_X);
y = analogRead (JoyStick_Y);

if (x == 1023){
digitalWrite(led1, HIGH);
}
else if (x == 0){
digitalWrite(led2, HIGH);
}
else if (y == 1023){
digitalWrite(led3, HIGH);
}
else if (y == 0){
digitalWrite(led4, HIGH);
}
else {
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
}
SESSION 7: CONDITIONAL CONTROL STRUCTURES
4.
10 void loop()
11 {
12 while(delayTime > 0){ // while delayTime is greater than 0
13 digitalWrite(kPinLed, HIGH);
14 delay(delayTime);
15 digitalWrite(kPinLed, LOW);
16 delay(delayTime);
17 delayTime = delayTime - 100;
18 }
19 while(delayTime < 1000){ // while delayTime is less than !! "" 1000

20 delayTime = delayTime + 100;


21 digitalWrite(kPinLed, HIGH);
22 delay(delayTime);
23 digitalWrite(kPinLed, LOW);
24 delay(delayTime);
25 }
26 }
SESSION 7: CONDITIONAL CONTROL STRUCTURES

5.
10 void loop()
11 {
12 if(delayTime <= 100){
13 delayTime = 1000;
14 }
15 else{
16 delayTime = delayTime - 100;
17 }
18 digitalWrite(kPinLed, HIGH);
19 delay(delayTime);
20 digitalWrite(kPinLed, LOW);
21 delay(delayTime);
22 }
 Science - describe the different types of
charging processes
 English - Transcode orally and in writing
the information presented in diagrams,
charts, table, graphs, etc.
MODULE 2

8 Safety in Using Electronic Components


9 How does an electronic circuit
function?
10 How does a resistor work?
11 Resistance Value with Arduino
12 How does a serial monitor work?
SESSION 8: HOW TO BE SAFE WHEN
USING ELECTRONIC COMPONENTS?
SAFETY PRECAUTIONS
Target Outcomes
At the end of this session, the students
are able to:
 Know safety procedures in using
electronic components.
 Practice and perform safety
procedures while working with
electronic components.
Assessment Task 1:
Identify the symbols from the pictures.

1. 2.

3.

4. 5.
1. Always remember
and make sure that
your hands are dry
(use working gloves
if necessary).
2. Make sure your
working area are clean.
 NO Liquid materials or
Drinks
 NO Conductible
material near work
area
3. Make sure
where the
first aid kits
are place.
Assessment
Practical Activity

Prepare the area


showing the safety rules
given.
Assessment Task 2
 Essay
Choose one of the safety rules
given and explain why they are
necessary.
Subject Integration

 Science – . describe some properties of


metals and non-metals such
conductivity.
 English - Give the meaning of given signs
and symbols (road signs, prohibited
signs, etc.)
SESSION 9: HOW DOES
ELECTRONIC CIRCUIT FUNCTION?
VOLTAGE AND POLARITY
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

Target Outcomes

 Target outcomes:
 Identify the functions of each part to the
wiring connections.
 Differentiate Voltage, Resistance, and
Current.
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

Materials

 Tissue roll
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

Assessment Task 1

Blow the hole of a tissue roll


and block the air using the
palm of the hands.
Q:1. What did you observe?
2. What is the function of your
hands?
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

3. How does the tissue roll


works?
4. How about you mouth,
where will you compare its
function from your prior
knowledge?
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

VOLTAGE is the
difference in
charge between
AC DC two points.
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

 CURRENT is the rate at


which charge is flowing.
 RESISTANCE is a material’s
tendency to resist the flow of
charge (current).
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

 POLARITY – It describe the positive (+)


and Negative (-) charges, that describe
the current flow in an electrical circuit.
Direct current voltage

 Travels in a straight line, and in one direction only.


 Commonly produced by sources of stored energy such
as batteries.
 Sources of dc voltage have positive and negative terminals.
Terminals establish polarity in a circuit, and polarity can be used
to determine if a circuit is dc or ac.
 Commonly used in battery-powered portable equipment (autos,
flashlights, cameras). Positive must be connected to positive and
negative to negative.
Alternating current voltage (AC)

 Reverses direction at regular intervals.


 Commonly produced by utilities via generators, where
mechanical energy—rotating motion powered by flowing water,
steam, wind or heat—is converted to electrical energy.
 More common than dc voltage. Utilities deliver ac voltage to
homes and businesses where the majority of devices use ac
voltage.
 Some household devices, such as TVs and computers, utilize dc
voltage power. They use rectifiers (such as that chunky block in
a laptop computer’s cord) to convert ac voltage and current to
dc.
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

Practical Activity

 Make a model showing how


voltage, current and
resistance works.
Session 9: HOW DOES ELECTRONIC CIRCUIT
FUNCTION?

Identification: Write your answer on the space


provided.
__________ 1. Voltage that travels in a straight
line.
__________ 2. Rate at which charge is owing
__________ 3. Measure of the opposition to
current flow
__________ 4. Difference in charge between
two points.
Experiment:

 Activity 1. Blow the hole of a tissue


roll and block the air using the palm of
the hand.
1. What did you observe?-
2. What is the function of your hand?
3. How does the tissue roll work?-
4. How about your mouth, where will you
compare its function?
Subject Integration
 Science – (Electricity) infer the relationship
between current and charge;
 English - Use structural analysis to determine
the meaning of unfamiliar words or
expressions from the material seen.
SESSION 10: HOW DOES A RESISTOR
WORK?
RESISTOR’S COLOR CODING AND RESISTANCE VALUE
Session 10: HOW DOES A RESISTOR WORK?
Target Outcomes

At the end of this session, the students


are able to:
 Identify the color code and getting the
resistance value.
 Explain the use of a resistor.
Session 10: HOW DOES A RESISTOR WORK?

Materials
Practical Activity 2
 Microcontroller
Practical Activity I
 USB Cable
 Microcontroller  Jumper Wire Practical Activity 3
 USB Cable  Breadboard  Microcontroller
 Jumper Wire  2 pcs. 220   USB Cable
 Breadboard Resistors
  Jumper Wire
1k Resistors  2 pcs. LED (Any color)
 Breadboard
 LED (Any color)
Assessment 2b  8 pcs. 220  Resistors
Assessment 2a  8 pcs. LED (Any color)
Microcontroller
 Microcontroller USB Cable
 USB Cable
Jumper Wire
 Jumper Wire
 Breadboard Breadboard
 1 pc. 220  Resistors 3 pcs. 220  Resistors
 1 pc. LED (Any color) 1 pc. LED (Red, Yellow, Green)
Session 10: HOW DOES A RESISTOR WORK?

Assessment Task 1
What happen to the gum if the jar is:
1.Slightly open or with small hole?
2.Widely open?
3.It is close?
Session 10: HOW DOES A RESISTOR WORK?

RESISTORS are electronic


components that limits the current
with some value of resistance.
Resistance blocks the flow of
electricity. The bigger the value of
resistance the little flow of
electricity and vice versa.
Session 10: HOW DOES A RESISTOR WORK?

 Resistor Electronic Symbol


Session 10: HOW DOES A RESISTOR WORK?
Session 10: HOW DOES A RESISTOR WORK?
Session 10: HOW DOES A RESISTOR WORK?
Session 10: HOW DOES A RESISTOR WORK?

 The function of a resistor is to oppose the


electric current through it. This is called
electrical resistance, and is measured in the
unit ohm.
 The resistance can be calculated with Ohms
law, when the current is known and the
voltage drop is measured:

V
____
R =
I
where I is the current in amperes, V the voltage in volts and R
the resistance in ohms.
Session 10: HOW DOES A RESISTOR WORK?

 Ohm’s law states that the electrical current


through a conductor is proportional to the potential
difference across it. Furthermore, the electrical
resistance of the conductor is constant.
Session 10: HOW DOES A RESISTOR WORK?

 This leads to the mathematical equation:


Answer the following questions. Write
your answer on the space provided.
1. What is a resistor?
2. What is the use of a resistor in a
circuit?
3. What is the relationship of the resistor
to the flow of energy?
 Identify the resistance value of the
resistor guided by the table. Example:
red—red—black—brown 22Ω
 1. orange—red—yellow—silver
2. white—green—gold—violet
3. gray—blue—gold
4. blue—white—green—black—red
5. green—brown—yellow—silver—blue
SESSION 11: RESISTANCE VALUE
WITH ARDUINO
RESISTOR’S COLOR CODING AND RESISTANCE VALUE
Session 11: Resistance Value with Arduino
Target Outcomes

At the end of this session, the students


are able to:
 Build and key in the code base on the
schematic diagram
Session 11: Resistance Value with Arduino

CIRCUIT CONNECTION
AND PROGRAMMING
USING ARDUINO IDE
Session 11: Resistance Value with Arduino
Practical Activity I int LED = 2;
/* int means integer, LED is a variable that will be used to
represent the device connected on the microcontroller and
MATERIALS assigning 2 as the value for pin 2*/

 Microcontroller void setup( ) {


// put your setup code here, to run once:
 USB Cable
 Jumper Wire pinMode(LED, OUTPUT);
/* pinMode is a function that prepares ALL the pins used in the
 Breadboard microcontroller. Variable LED is the same as 2 thus, pin 2 will be
 1k Resistors used as an OUTPUT device */

 LED (Any color) }

void loop( ) {

// put your main code here, to run repeatedly:

digitalWrite(LED, HIGH);
/* digitalWrite ( ) is the function in controlling digital device,
inside the parenthesis ( ) are the pin that needs to be controlled
and it can be set either HIGH or LOW */
delay(3000);
/* delay ( ) is the function in controlling digital device, inside the
parenthesis ( ) are the pin that needs to be controlled and it can
be set either HIGH or LOW */

digitalWrite(LED, LOW);
delay(2000);

}
Session 11: Resistance Value with Arduino
Practical Activity 2 int LED1 = 7;
MATERIALS
 Microcontroller
int LED2 = 8;
 USB Cable void setup( ) {
 Jumper Wire
 Breadboard pinMode (LED1, OUTPUT); //Pin
 2 pcs. 220  Resistors
 2 pcs. LED (Any color) 7 is defined as output
pinMode (LED2, OUTPUT);//Pin 8
is defined as output
}
void loop( ) {

ALTERNATE BLINKING LED


digitalWrite (LED1, HIGH);//turn on
the LED on pin 7
delay(1000); //wait for 1000
milliseconds
digitalWrite (LED1, LOW) ; //turn
off the LED on pin 7
digitalWrite (LED2, HIGH); //turn
on the LED on pin 8
delay(1000); //wait for 1000
milliseconds
digitalWrite (LED2, LOW); //turn
off the LED on pin 8
}
Session 11: Resistance Value with Arduino
Practical Activity 3 int LED1 = 2; pinMode(LED3,
OUTPUT);
MATERIALS int LED2 = 3;
pinMode(LED4,
 Microcontroller int LED3 = 4;
OUTPUT);
 USB Cable int LED4 = 5;
 Jumper Wire pinMode(LED5,
int LED5 = 6; OUTPUT);
 Breadboard
 8 pcs. 220  Resistors int LED6 = 7; pinMode(LED6,
 8 pcs. LED (Any color) int LED7 = 8; OUTPUT);
int LED8 = 9; pinMode(LED7,
OUTPUT);
void setup( ) {
pinMode(LED8,
pinMode(LED1, OUTPUT);
OUTPUT)
}
pinMode(LED2,
OUTPUT);
CONTROLLING 8 LED (LIGHT CHASE)
void loop( ) { digitalWrite(LED3, HIGH);
digitalWrite(LED1, HIGH); delay(3000);
delay(3000); digitalWrite(LED3, LOW);
digitalWrite(LED1, LOW); delay(2000);
delay(2000); digitalWrite(LED4,HIGH);
digitalWrite(LED2, HIGH); delay(3000);
delay(3000); digitalWrite(LED4, LOW);
digitalWrite(LED2, LOW); delay(2000);
delay(2000);
digitalWrite(LED5, HIGH);
delay(3000); delay(3000);
digitalWrite(LED5, LOW); digitalWrite(LED7, LOW);
delay(2000); delay(2000);
digitalWrite(LED6, HIGH); digitalWrite(LED8, HIGH);
delay(3000); delay(3000);
digitalWrite(LED6, LOW); digitalWrite(LED8, LOW);
delay(2000); delay(2000);
digitalWrite(LED7, HIGH); }
Session 11: Resistance Value with Arduino
int LED= 3;
Assessment Task 2a int brightness=0;
MATERIALS int fading=5; //”fading” sets up the speed of the
 Microcontroller fading.
 USB Cable void setup() {
 Jumper Wire
 Breadboard pinMode (LED, OUTPUT); //The pin with the LED
 1 pc. 220  Resistors is supposed to be an output.
 1 pc. LED (Any color) }
void loop() {
analogWrite(LED, brightness);
brightness=brightness + fading;
delay(25);
if(brightness==0 || brightness== 255) {
fading= -fading;
LED WITH FADE EFFECT }
}
Session 11: Resistance Value with Arduino

Assessment Task 2b
MATERIALS
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 3 pcs. 220  Resistors
 1 pc. LED (Red, Yellow,
Green) TRAFFIC LIGHT
int ledPin1 = 2; // red
int ledPin2 = 4; // yellow //stop
int ledPin3 = 6; // green digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2,LOW);
void setup() { digitalWrite(ledPin3,LOW);
pinMode(ledPin1,OUTPUT); delay(5000);
pinMode(ledPin2,OUTPUT);
pinMode(ledPin3,OUTPUT);
} //ready
void loop() { digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin3,LOW);
delay(3000);
//go
digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,LOW);
delay(8000);

//ready
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin3,LOW) ;

delay(3000);
}
Subject Integration

 Science- explain the functions of circuit


breakers, fuses, resistors, double
insulation, and other safety devices.
SESSION 12: HOW DOES SERIAL
MONITOR WORK?
Target Outcomes

At the end of this session, the


students are able to:
 Define what is a serial monitor.
 Key in the codes on the serial
monitor
Materials
 2 clean bond papers
Assessment Task 1

Draw or write anything on


the paper that will be
passed to you.
 SERIAL MONITOR is used for
communication between the Arduino
board and a computer or other devices.
OPENING UP THE SERIAL MONITOR

 The Serial Monitor Window will open


Serial Monitor
Practical Activity
Copy the codes on your serial monitor.
SKETCH – SERIAL MONITOR
//COPY FROM THIS LINE
void setup () {
Serial.begin (9600); // Sets the data rate in bits per second (baud) for
serial data transmission
Serial.println ("Serial connection established...\n\nPlease enter text above
and press send.\n");
}
void loop () {
String temp = Serial.readString(); /*This is a LOCAL variable, it will store
any text we send TO the Arduino FROM the PC.*/
if (temp != NULL) { //If the variable is NOT empty run the next instructions
Serial.print ("You sent the string: "); //Print the string
Serial.print (temp); //then print the text we sent to the Arduino
Serial.println ("."); //Finally print a fullstop. This is data FROM the
Arduino TO the PC.
}
//If there is no text entered, the Arduino will continue processing
from here…But as there are no further instructions, it will return to
the top and start again. If you were to put something here such as a
Serial.print () command, it would fire constantly until you provide a
string of text. Feel free to try it!
}
//COPY TO THIS LINE
Assessment Task 2

1.What is serial monitor?


2. What is the importance
of a serial monitor?
ASSESSMENT
I. Directions: Answer the following questions on the space provided.
1. What is a serial monitor?

2. What is the importance of a serial monitor?

II. Directions: Follow the set up in the schematic diagram and key in the code for this activity.

//COPY FROM THIS LINE


void setup () {
Serial.begin (9600); /* Sets the data rate in bits per second (baud) for serial data
transmission */
Serial.println (“Serial connection established...\n\nPlease enter text above and press
send.\n”);
}
voidloop() {
String temp = Serial.readString(); /*This is a LOCAL variable, it will store any text we
send TO the Arduino FROM the PC.*/
if (temp != NULL) { //If the variable is NOT empty run the next instructions
Serial.print (“You sent the string: “); //Print the string
Serial.print (temp); //then print the text we sent to the Arduino
Serial.println (“.”); //Finally print a fullstop. This is data FROM the Arduino TO the PC.
}
/*If there is no text entered, the Arduino will continue processing from here…But as there
are no further instructions, it will return to the top and start
e again. If you were to put
something here such as a Serial.print() command, it would fir c onstantly until you provide
a string of text. Feel free to try it!*/
}
//COPY TO THIS LINE

PROCEDURE
1. You will be given a set of materials.
apple
2. Key in the codes on the Arduino IDE. orange
3. Run the program using serial monitor. banana
grapes
4. Type the following character on the input tab using printIn and without printIn.

26
Philippine Copyright 2018 TechFactors, Inc
MODULE 3

13 Types of Switch
14 Switch Statement
15 Types of Potentiometer
16 How do potentiometers work?
17 Kinds of Buzzer
18 How does a buzzer work?
19 Kind of Segment
20 How does a segment work?
SESSION 13: TYPES OF SWITCH
Session 13: Types of Switch

Target Outcomes

At the end of this session, the students


are able to:
 Identify the different types of switch.
 Explain the use of a switch in a circuit.
 Draw a schematic diagram of a circuit
with switch.
Session 13: Types of Switch

Materials
• Microcontroller
• USB Cable
• Jumper Wire
• Breadboard
• 1 pc. 220  Resistors
• 1 pc. Push Button
Session 13: Types of Switch

Assessment Task 1
Session 13: Types of Switch
 SWITCH is an electrical device having
two states, on or off (open or close).
Ideally having zero impedance when
closed and infinite impedance when
open.

Switch Electronic Symbol


Session 13: Types of Switch

 PUSH BUTTON/ TACT SWITCHES react


to user interaction with
the button or switch when it makes
contact with the control panel beneath.
Session 13: Types of Switch

Types of switch

SINGLE POLE SINGLE THROW


SWITCH (SPST) basic ON and OFF
switch consisting of one input
contact and one output contact.

SINGLE POLE DOUBLE THROW


SWITCH (SPDT) switch has three
terminals, one is input contact and
remaining two are output contacts.
Session 13: Types of Switch

DOUBLE POLE DOUBLE THROW SWITCH


(DPDT) a dual ON/OFF switch consisting
of two ON positions. It has six terminals,
two are input contacts and remaining
four are the output contacts.

TOGGLE SWITCH is manually


actuated (or pushed up or down)
by a mechanical handle, lever or
rocking mechanism. These are
commonly used as light control
switches.
Session 13: Types of Switch

Assessment Task
 What is the use of a switch in a circuit?
 What are the different types of switch?
 Draw a schematic diagram of a circuit
with switch. Label and explain its
content.
Identification: Answer the following on the space
provided.

1. It is a dual ON/OFF switch consisting of two ON positions. It has six


terminals: two are input contacts and the remaining four are the output
contacts.
2. It reacts to user interaction with the button or switch when it makes
contact with the control panel beneath.
3. It is a basic ON and OFF switch consisting of one input contact and one
output contact.
4. It is manually actuated (or pushed up or down) by a mechanical handle,
lever or rocking mechanism. These are commonly used as light control
switches.
5. It is a switch that has three terminals, one is input contact and the
remaining two are output contacts.
SESSION 14: SWITCH STATEMENT
TARGET OUTCOMES
At the end of this session, the students
are able to:
 Identify the correct polarity of a switch.
 Demonstrate the proper wiring in
connecting the circuit to switch.
Switch (case) Statement, used with serial input

 An if statement allows you to choose


between two discrete options, TRUE or
FALSE. When there are more than two
options, you can use multiple if
statements, or you can use the switch
statement. Switch allows you to choose
between several discrete options.
ACTIVITY
 Directions: Follow the set up in the schematic diagram and key in the
code for this activity.
 PROCEDURE
 1. You will be given a set of materials.
2. Connect the circuit properly to switch.
3. Key in the given codes in the Arduino IDE.
4. Check your output using your serial monitor.
5. Observe what will be the output display in the serial monitor every
time you press the push button.
 Observation: __________________________________________
 Conclusion: ___________________________________________
Session 14: Switch Statement

Practical Activity
MATERIALS
•Microcontroller
•USB Cable
•Jumper Wire
•Breadboard
•1 pc. 220  Resistors
•1 pc. Push Button
int pbValue;
/* int means integer, pbValue is a variable that will be used to hold the value that the tact
switch will send to the microcontroller unit */
void setup( ) {
pinMode(2, INPUT);
/* pinMode is a function that prepares ALL the pins used in the microcontroller. 2 is the digital
pin used to connect the tact switch and it’s considered as an INPUT device */
Serial.begin(9600);
// Sets the data rate in bits per second (baud) for serial data transmission
}
void loop( ) {
pbValue = digitalRead(2);
// digitalRead will basically get the data from pin 2 and assign that value to variable pbValue.
Serial.println(pbValue);
// prints over the Serial Monitor the value assigned to pbValue
// Serial.println(“pbValue”); - this code will display the word “pbValue”
}
Subject Integration

 Science – (electricity) describe the


different types of charging
processes.
SESSION 15:TYPES OF POTENTIOMETER
Session 15:Types of Potentiometer

Target Outcomes
At the end of this session, the students
are able to:
 Define what is potentiometer.
 Differentiate the 2 types of
potentiometer.
Materials
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Potentiometer
Assessment Task 1

Observe the
music coming
out from the
phone.
 POTENTIOMETER is a three-terminal
resistor with a sliding or rotating
contact that forms an adjustable voltage
divider.

 Potentiometer Electronic Symbol


USES OF POTENTIOMETER

Rheostat → To use the potentiometer as a rheostat, only two pins


are used: one outside pin and the center pin.
 If we have a 10kΩ potentiometer, it means that the maximum
resistance of the variable resistor is 10kΩ and the minimum is
0Ω. This means that by changing the wiper position, you get a
value between 0Ω and 10kΩ.
Potentiometers → can be used as voltage dividers. To use the
potentiometer as a voltage divider, all the three pins are
connected. One of the outer pins is connected to the GND, the
other to VCC and the middle pin is the voltage output.
 The voltage divider is used to turn a large voltage into a smaller
one.
Types of Potentiometer
Rotary the most common of variable resistor or
potentiometer is a rotary version.
Linear potentiometers produce a resistance
output that varies according to the
displacement or position of a slider or wiper.
ASSESSMENT:

1. What is a potentiometer?
2. What are the two kinds of
potentiometer?
3. What is the purpose of a potentiometer
in circuit?
SESSION 16:HOW DO POTENTIOMETERS
WORK?
 TARGET OUTCOMES:
At the end of this session, the students
are able to:
 Identify the correct polarity of a
potentiometer.
 Demonstrate the proper wiring in
connecting the circuit to potentiometer.
int varPin = A0;
Practical Activity int val = 0;
MATERIALS void setup() {
 Microcontroller // put your setup code here, to run once:
 USB Cable Serial.begin(9600);
 Jumper Wire Serial.println("Serial connection
 Breadboard established..\nAdjust the Potentiometer to see
 1 pc. Potentiometer the value change!");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("Potentiometer Value: ");
val = analogRead(varPin);
Serial.println(val);
}
Acitivity
PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to potentiometer.
3. Key in the given codes in the Arduino IDE.
4. Check your output using your serial monitor.
5. Observe what will be the output display in the serial monitor every time
you turn the knob from le to right and vice versa.
 Observation:
______________________________________________
 Conclusion:
_______________________________________________
Assessment
Subject Integration

 Science – (electricity) describe the


different types of charging
processes.
SESSION 17: KINDS OF BUZZER
Target Outcomes

At the end of this session the students are


able to:
 Define what is a buzzer.
 Differentiate active and passive buzzer.
 Explain the use of a buzzer.
Materials
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Passive Buzzer
Assessment Task 1

You will sing the song “Bahay


Kubo” while passing the ping
pong ball. As the song stop, the
student who is holding the ball
will pick the question regarding
the past topic.
 A buzzer or beeper is
an audio signaling
device, which may be
mechanical,
electromechanical, or
Buzzer Electronic Symbol piezoelectric (piezo for
short)
Two Kinds of Buzzer
Passive Buzzer Active Buzzer
 TWO KINDS OF BUZZER
 An active buzzer will generate a tone using an
internal oscillator, so all that is needed is a DC
voltage. A passive buzzer requires an AC signal to
make a sound. It is like an electromagnetic speaker,
where a changing input signal produces the sound,
rather than producing a tone automatically.
 Passive buzzers do not diferentiate positive and
negative polarity while active buzzers do. There is a
little similarity between passive buzzers.
SESSION 18: HOW DOES A BUZZER
WORK?
Target Outcomes:
At the end of this session the students are
able to:
 Explain the use of a buzzer.
 Use a buzzer in a set up for prototyping.
Code Components
FUNCTIONS
 tone([pin],[frequency]): You can make sounds with a
buzzer using the function tone(). In order to use it,
you need only to tell the pin to which the buzzer Is
connected and which frequency (in Hertz) you want.
For example tone(5, 4000); produces a frequency of 4
kHz on the pin D5 on Arduino.
 noTone([pin]):
In order to stop the sound, we must use another
function called noTone(). This function receives as
parameters only the pin, without the necessity to
specify the frequency. For instance, noTone(5);.
Directions: The learners will follow the set up in the schematic and key in
the code for this activity.
PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to buzzer.
3. Key in the given codes in the Arduino IDE.
4. Explore and analyze what will be the output by changing the digital pin
location to digital-analog pin location.
Red wire for __________ polarity.
Black wire for __________ polarity.
 Observation: __________________________________________
 Conclusion: ___________________________________________
SESSION 18: How does a buzzer work?
Practical Activity int buzzer=13; // initialize digital IO
Materials pin that controls the buzzer
 Microcontroller
 USB Cable void setup()
 Jumper Wire {
 Breadboard pinMode (buzzer, OUTPUT);// set pin
 1 pc. Active Buzzer mode as “output”
}

void loop()
{
digitalWrite(buzzer, HIGH); // produce
sound
delay (500);
digitalWrite(buzzer, LOW);
ACTIVE BUZZER ALARM SOUND delay (500);
}
SESSION 18: How does a buzzer work?
Materials
 Microcontroller int buzzer=3; // initialize digital IO
 USB Cable pin that controls the buzzer
 Jumper Wire
 Breadboard void setup() {
 1 pc. Passive Buzzer
pinMode (buzzer, OUTPUT);
}
void loop() {
tone (buzzer, random (500, 1500);
delay(300); //wait half a second
before changing pitch
}
PASSIVE BUZZER MELODY SOUND
SESSION 18: How does a buzzer work?

Assessment Task 2 Activity


Materials int buzzer=3; // initialize digital IO
 Microcontroller pin that controls the buzzer
 USB Cable
 Jumper Wire void setup() {
 Breadboard pinMode(buzzer, OUTPUT);
 1 pc. Active Buzzer }

void loop() {
analogWrite (buzzer,
random(0,255));
delay(500); //wait half a second
before changing pitch
}

ACTIVE BUZZER CHANGING SOUND


SESSION 18: How does a buzzer work?

PASSIVE BUZZER FIRE ALARM SOUND

MATERIALS
•Microcontroller
•USB Cable
•Jumper Wire
•Breadboard
•1 pc. Passive Buzzer
SESSION 18: How does a buzzer work?
int buzzerPin = 3; //the buzzer pin attach to
int fre; //set the variable to store the frequency value
void setup()
{
pinMode(buzzerPin, OUTPUT);
}

void loop()
{
for (int i = 200;i <= 800;i++) //frequency loop from 200 to 800
{
tone(buzzerPin,i); //turn the buzzer on
delay(5); //wait for 5 milliseconds
}
delay(4000); //wait for 4 seconds on highest frequency
for(int i = 800;i >= 200;i--)//frequency loop from 800 down to 200
{
tone(buzzerPin,i);
delay(10);
}
}
Subject Integration
 Science - explain the functions of circuit
breakers, fuses, earthing, double
insulation, and other safety devices.

 Music - sings folksongs from the lowlands


of Luzon;
SESSION 19: KINDS OF SEGMENT
SESSION 19: Kinds of Segment

Target Outcomes
At the end of this session the students are
able to:
 Identify the schematic diagram of a
segment.
 Explain the use of a segment.
Assessment Task 1a
Questions:
1. Have you ever tried
watching basketball league?
2. Are you familiar with its
digital scoreboard?
3. How does it looks like?
4. How about the digital
clock? What are their
similarities?
 SSD or SEVEN-SEGMENT indicator, is a
form of electronic display device for
displaying decimal numerals that is an
alternative to the more complex dot
matrix displays.
Assessment Task 1b
Find the pin
address by
tracing the
segment.
EX:
0 - ABCDEF
Two Kinds of Segment
ASSESSMENT:

 I. Answer the questions briefly.


1. What is a segment?
2. What are the common uses of a
segment?
3. Why does a segment use LED and not
the other type of light?
II. Give the following pin address
to activate the segment.

1. 8 7. 2
2. 5 8. 4
3. 3 9. 6
4. 9 10.7
5. 0
6. 1
SESSION 20: HOW DOES A SEGMENT
WORK?
SESSION 20: How does a segment work?

Target Outcomes
At the end of this session the students are
able to:
 Learn how to display, code numbers and
operate a segment in basic electronics.
 7-Segment Display Segment for All Numbers
 It can be seen that to display any single digit number
from 0 to 9 in binary or letters from A to F in
hexadecimal, we would require 7 separate segment
connections plus one additional connection for the
LED’s “common” connection. Also as the segments are
basically a standard light emitting diode, the driving
circuit would need to produce up to 20mA of current
to illuminate each individual segment and to display
the number 8, all 7 segments would need to be lit
resulting a total current of nearly 140mA, (8 x 20mA).
ASSESSMENT:

Directions: The learners will follow the set up in the


schematic and key in the codes for this activity.
PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to 7 segment display
3. Please refer to teacher’s PowerPoint presentation for
the codes.
4. Key in the given codes in the Arduino IDE.
5. Observe what will be the output from the 7-segment
display if you are using either Anode or Cathode type
segment
Practical Activity

MATERIALS
Microcontroller
USB Cable
Jumper Wire
Breadboard
1 pc. 7 Segment
int pinA = 2; (pinB,OUTPUT);
int pinB = 3; pinMode
int pinC = 4; (pinC,OUTPUT);
int pinD = 5; pinMode
int pinE = 6; (pinD,OUTPUT);
int pinF = 7; pinMode
int pinG = 8; (pinE,OUTPUT);
void setup() { pinMode
pinMode (pinF,OUTPUT);
(pinA,OUTPUT); pinMode
pinMode (pinG,OUTPUT);
}
void loop() {
//0 //1
digitalWrite (pinA, LOW); digitalWrite (pinA, HIGH);
digitalWrite (pinB, LOW); digitalWrite (pinB, LOW);
digitalWrite (pinC, LOW); digitalWrite (pinC, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinD, HIGH);
digitalWrite (pinE, LOW); digitalWrite (pinE, HIGH);
digitalWrite (pinF, LOW); digitalWrite (pinF, HIGH);
digitalWrite (pinG, HIGH); digitalWrite (pinG, HIGH);
delay(1000); delay(1000);
//2 //4 //6
digitalWrite (pinA, LOW); digitalWrite (pinA, HIGH); digitalWrite (pinA, LOW);
digitalWrite (pinB, LOW); digitalWrite (pinB, LOW); digitalWrite (pinB, HIGH);
digitalWrite (pinC, HIGH); digitalWrite (pinC, LOW); digitalWrite (pinC, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinD, HIGH); digitalWrite (pinD, LOW);
digitalWrite (pinE, LOW); digitalWrite (pinE, HIGH); digitalWrite (pinE, LOW);
digitalWrite (pinF, HIGH); digitalWrite (pinF, LOW); digitalWrite (pinF, LOW);
digitalWrite (pinG, LOW); digitalWrite (pinG, LOW); digitalWrite (pinG, LOW);
delay(1000); delay(1000); delay(1000);
//5 //7
//3
digitalWrite (pinA, LOW); digitalWrite (pinA, LOW);
digitalWrite (pinA, LOW);
digitalWrite (pinB, HIGH); digitalWrite (pinB, LOW);
digitalWrite (pinB, LOW);
digitalWrite (pinC, LOW); digitalWrite (pinC, LOW);
digitalWrite (pinC, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinD, HIGH);
digitalWrite (pinD, LOW);
digitalWrite (pinE, HIGH); digitalWrite (pinE, HIGH);
digitalWrite (pinE, HIGH);
digitalWrite (pinF, LOW); digitalWrite (pinF, HIGH);
digitalWrite (pinF, HIGH);
digitalWrite (pinG, LOW); digitalWrite (pinG, HIGH);
digitalWrite (pinG, LOW);
delay(1000); delay(1000);
delay(1000);
//8 //9
digitalWrite (pinA, LOW); digitalWrite (pinA, LOW);
digitalWrite (pinB, LOW); digitalWrite (pinB, LOW);
digitalWrite (pinC, LOW); digitalWrite (pinC, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinD, LOW);
digitalWrite (pinE, LOW); digitalWrite (pinE, HIGH);
digitalWrite (pinF, LOW); digitalWrite (pinF, LOW);
digitalWrite (pinG, LOW); digitalWrite (pinG, LOW);
delay(1000); delay(1000);
}
Subject Integration

 Physical Education - describes the


nature and background of the sport.
 Science – (Light) relate characteristics of
light such as color and intensity to
frequency and wavelength;
MODULE 4

21 How do you combine projects?


22 Buzzer + Pushbutton Switch
23 Buzzer + Pushbutton Switch + LED
24 LED + Potentiometer + Serial Monitor
SESSION 21: HOW DO YOU COMBINE
PROJECTS?
Target Outcomes
At the end of these sessions, the students are
able to:

 Review and observe relationships of all the materials


discussed.
 Perform and practice safety procedures
 Always remember and make sure
that your hands are dry (use
working gloves if necessary).
 Make sure your working area are
clean.
NO Liquid materials or Drinks
NO Conductible material near
work area
 Make sure where the first aid kit
are place.
 Always triple Check
your work
 Connections
 Wiring
 Program Codes

 Read the schematic


diagram carefully
ASSESSMENT
Directions: The learners will follow the set up in the schematic and
key in the code for this activity. LED with Potentiometer (Fading
Light)
PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to potentiometer and LED light.
3. Key in the given codes in the Arduino IDE.
4. Observe what will happen to the LED, if you change the value of
the resistor.
5. Observe what will be the output when the knob is turned either
clockwise or counterclockwise. 6. If a potentiometer is put in a
circuit with LED light, what will happen?
LED WITH POTENTIOMETER
(FADING LIGHT)
MATERIALS
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Potentiometer
 1 pc. LED (Any Color)
 1 pc. 220 Resistors
int led = 9;
int potpin = 0;

void setup() {
pinMode (led, OUTPUT);
}

void loop() {
int val = analogRead(potpin);
val = map (val, 1, 1024, 1,
255);
analogWrite (led, val);
}
SESSION 22:BUZZER + PUSHBUTTON
SWITCH
SESSION 22:Buzzer + Pushbutton Switch
Target Outcomes
At the end of these sessions, the students are
able to:

 Make combined projects such as: Buzzer +


Pushbutton Switch
 Learners will combine all the components that they
have learn from assembly to coding and
troubleshooting with the use of Arduino and basic
electronics.
 A BUZZER or BEEPER is an audio
signaling device, which may be
mechanical, electromechanical, or
piezoelectric (piezo for short).
 PUSH BUTTON/TACT SWITCH reacts to
user interaction with the button or
switch when it makes contact with the
control panel beneath.
Directions: The learners will follow the set up in the
schematic and key in the code for this activity.
 PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to buzzer and
pushbuttong switch.
3. Key in the given codes in the Arduino IDE.
4. Observe what will happen to the buzzer every time
you press the push button.
 Observation: _____________________________
 Conclusion: ______________________________
LED WITH SWITCH
(LED WITH PUSH
BUTTON)
MATERIALS
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Push Button
 1 pc. LED (Any Color)
 1 pc. 220 Resistors
int PinButton1 = 2;
int PinLed = 9;
void setup()
{
pinMode(PinButton1, INPUT);
digitalWrite(PinButton1, HIGH); // turn on
pull-up !!
pinMode(PinLed, OUTPUT);
}
void loop()
{
if(digitalRead(PinButton1) == LOW){
digitalWrite(PinLed, HIGH);
}
else{
digitalWrite(PinLed, LOW);
}
}
LED WITH
POTENTIOMETER
(BLINKING LED)
MATERIALS
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Potentiometer
 1 pc. LED (Any Color)
 1 pc. 220 Resistors
int potpin = A0;
int led = 13;
int val = 0;

void setup() {
pinMode (led, OUTPUT);
}

void loop() {
val = analogRead(potpin);
analogWrite(led, val);
delay (10);
digitalWrite (led,HIGH);
delay(val);
digitalWrite (led,LOW);
delay(val);
}
BUZZER WITH PUSHBUTTON
SWITCH (ON AND OFF SOUND)
Materials
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Push Button
 1 pc. Active Buzzer
int buzzer = 7;//the pin of the active buzzer
int inPin = 12; //button//
int val;
void setup( )
{
pinMode(buzzer,OUTPUT); //initialize the
buzzer pin as an output
pinMode (inPin, INPUT); //button//
}
void loop( ){
val = digitalRead (inPin);
if (val == LOW) {

digitalWrite(buzzer,HIGH);
}else{
digitalWrite(buzzer,LOW);
}
}
SESSION 23:
BUZZER + PUSHBUTTON SWITCH + LED
Target Outcomes
At the end of these sessions, the students are
able to:
 Make combined projects such as: Buzzer +
Pushbutton Switch + LED
 Learners will combine all the components that they
have learn from assembly to coding and
troubleshooting with the use of Arduino and basic
electronics.
 A BUZZER or BEEPER is an audio signaling device,
which may be mechanical, electromechanical, or
piezoelectric (piezo for short).
 PUSH BUTTON/TACT SWITCH reacts to user
interaction with the button or switch when it makes
contact with the control panel beneath.
 LIGHT EMITTING DIODE (LED) is a semiconductor
diode that converts electric energy into
electromagnetic radiation at a visible and near
infrared frequencies when its pn junction is forward
biased
 Directions: The learners will follow the set up in the
schematic and key in the code for this activity.
PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to buzzer, pushbutton
switch and LED.
3. Key in the given codes in the Arduino IDE.
4. Observe what will happen to the buzzer and LED
every time you press the push button.
 Observation: _____________________________
 Conclusion: ______________________________
BUZZER + PUSHBUTTON
SWITCH + LED (ALTERNATE
SOUND AND LIGHT)
MATERIALS
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Push Button
 1 pc. Active Buzzer
 1 pc. LED (Any Color)
 1 pc. 220 Resistors
int buzzer = 7;//the pin of the
active buzzer
int PinButton1 = 12; //button//
int PinLed1 = 10; //led//

void setup()
{
pinMode(PinButton1, INPUT);
digitalWrite(PinButton1,
HIGH); // turn on pull-up !!
pinMode(PinLed1, OUTPUT);
pinMode(buzzer, OUTPUT);
}
void loop(){
if(digitalRead(PinButton1) == LOW){
digitalWrite(PinLed1, HIGH);
}
else{
digitalWrite(PinLed1, LOW);
// buzzer
if(digitalRead(PinButton1) == HIGH){
digitalWrite(buzzer, HIGH);
delay (1);
digitalWrite(buzzer, LOW);
delay (1);
}
else{
digitalWrite(buzzer, LOW);
}
}}
SESSION 24:
LED + POTENTIOMETER + SERIAL
MONITOR
Target Outcomes
At the end of these sessions, the students are
able to:
 Make combined projects such as: LED +
Potentiometer + Serial Monitor
 Learners will combine all the components that they
have learn from assembly to coding and
troubleshooting with the use of Arduino and basic
electronics.
 LIGHT EMITTING DIODE (LED) is a semiconductor
diode that converts electric energy into
electromagnetic radiation at a visible and near
infrared frequencies when its pn junction is forward
biased
 A POTENTIOMETER is a three-terminal resistor with a
sliding or rotating contact that forms an adjustable
voltage divider.
 SERIAL MONITOR is used for communication between
the Arduino board and a computer or other devices.
 Directions: The learners will follow the set up in the schematic
and key in the code for this activity.
 PROCEDURE
1. You will be given a set of materials.
2. Connect the circuit properly to LED, potentiometer and serial
monitor.
3. Key in the given codes in the Arduino IDE.
4. Observe what will be the output display in the serial monitor
every time you rotate the knob either clockwise or counter
clockwise.
 Observation: _______________________________________
 Conclusion: ________________________________________
LED + POTENTIOMETER +
SERIAL MONITOR (BLINKING
LED WITH VALUE READING
MATERIALS
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc. Potentiometer
 1 pc. LED (Any Color)
 1 pc. 220 Resistors
int potpin = A0;
int led = 13;
int val = 0;

void setup() {
pinMode (led, OUTPUT);
Serial.begin (9600);
}

void loop() {
val = analogRead(potpin);
Serial.println (val);
analogWrite(led, val);
delay (10);
digitalWrite (led,HIGH);
delay(val);
digitalWrite (led,LOW);
delay(val);
}
LED + POTENTIOMETER
+ SERIAL MONITOR
(BLINKING LED WITH
VALUE READING)
Materials
 Microcontroller
 USB Cable
 Jumper Wire
 Breadboard
 1 pc.7 Segment
 1 pc. LED (Red and Green)
 3 pc. 220 Resistors
int pinA = 2;
int pinB = 3;
int pinC = 4; pinMode (pinA, OUTPUT);
int pinD = 5; pinMode (pinB, OUTPUT);
int pinE = 6; pinMode (pinC, OUTPUT);
int pinF = 7; pinMode (pinD, OUTPUT);
int pinG = 8; pinMode (pinE, OUTPUT);
int ledR = 9; pinMode (pinF, OUTPUT);
int ledG = 10; pinMode (pinG, OUTPUT);
pinMode (ledR, OUTPUT);
void setup() { pinMode (ledG, OUTPUT);
}
void loop() {
//red
digitalWrite (ledR, HIGH);
//5
digitalWrite (pinA, LOW); //4
digitalWrite (pinB, HIGH); digitalWrite (pinA, HIGH);
digitalWrite (pinC, LOW); digitalWrite (pinB, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinC, LOW);
digitalWrite (pinE, HIGH); digitalWrite (pinD, HIGH);
digitalWrite (pinF, LOW); digitalWrite (pinE, HIGH);
digitalWrite (pinG, LOW); digitalWrite (pinF, LOW);
delay(1000); digitalWrite (pinG, LOW);
delay(1000);
//3
digitalWrite (pinA, LOW);
digitalWrite (pinB, LOW); //2
digitalWrite (pinC, LOW); digitalWrite (pinA, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinB, LOW);
digitalWrite (pinC, HIGH);
digitalWrite (pinE, HIGH);
digitalWrite (pinD, LOW);
digitalWrite (pinF, HIGH); digitalWrite (pinE, LOW);
digitalWrite (pinG, LOW); digitalWrite (pinF, HIGH);
delay(1000); digitalWrite (pinG, LOW);
delay(1000);
//1 //green
digitalWrite (pinA, HIGH); digitalWrite (ledG, HIGH);
digitalWrite (pinB, LOW); //8
digitalWrite (pinC, LOW); digitalWrite (pinA, LOW);
digitalWrite (pinD, HIGH); digitalWrite (pinB, LOW);
digitalWrite (pinE, HIGH); digitalWrite (pinC, LOW);
digitalWrite (pinF, HIGH); digitalWrite (pinD, LOW);
digitalWrite (pinG, HIGH); digitalWrite (pinE, LOW);
delay(1000); digitalWrite (pinF, LOW);
digitalWrite (ledR, LOW); digitalWrite (pinG, LOW);
delay(500); delay(1000);
//7
digitalWrite (pinA, LOW);
digitalWrite (pinB, LOW); //6
digitalWrite (pinC, LOW); digitalWrite (pinA, LOW);
digitalWrite (pinD, HIGH); digitalWrite (pinB, HIGH);
digitalWrite (pinE, HIGH); digitalWrite (pinC, LOW);
digitalWrite (pinF, HIGH); digitalWrite (pinD, LOW);
digitalWrite (pinG, HIGH);
digitalWrite (pinE, LOW);
delay(1000);
digitalWrite (pinF, LOW);
digitalWrite (pinG, LOW);
delay(1000);
//5 //4
digitalWrite (pinA, LOW); digitalWrite (pinA, HIGH);
digitalWrite (pinB, HIGH); digitalWrite (pinB, LOW);
digitalWrite (pinC, LOW); digitalWrite (pinC, LOW);
digitalWrite (pinD, LOW); digitalWrite (pinD, HIGH);
digitalWrite (pinE, HIGH); digitalWrite (pinE, HIGH);
digitalWrite (pinF, LOW); digitalWrite (pinF, LOW);
digitalWrite (pinG, LOW); digitalWrite (pinG, LOW);
delay(1000); delay(1000);
//3 //2
digitalWrite (pinA, LOW); digitalWrite (pinA, LOW);
digitalWrite (pinB, LOW); digitalWrite (pinB, LOW);
digitalWrite (pinC, LOW); digitalWrite (pinC, HIGH);
digitalWrite (pinD, LOW); digitalWrite (pinD, LOW);
digitalWrite (pinE, HIGH); digitalWrite (pinE, LOW);
digitalWrite (pinF, HIGH); digitalWrite (pinF, HIGH);
digitalWrite (pinG, LOW); digitalWrite (pinG, LOW);
delay(1000); delay(1000);
//1
digitalWrite (pinA, HIGH);
digitalWrite (pinB, LOW);
digitalWrite (pinC, LOW);
digitalWrite (pinD, HIGH);
digitalWrite (pinE, HIGH);
digitalWrite (pinF, HIGH);
digitalWrite (pinG, HIGH);
delay(1000);
digitalWrite (ledG, LOW);
delay(500);
}
LET’S EVALUATE AND REVIEW

 Answer the following guide questions based on your own


observation:
1. Which technology is similar to the sample activities? Why?
2. In what other way can you incorporate these activities?
3. Draw a program flow using flowchart symbols on how you came
up with the final result of the activities.
4. Give your own conclusion. In what way can these activities help
you at home or in the community?
5. Make your own design project based on the previous sample
activities and list down the materials that will be used.

You might also like