0% found this document useful (0 votes)
216 views96 pages

Halocode LVL 1 DLM Grade 9 Grade 12

Uploaded by

Neon 2020X
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views96 pages

Halocode LVL 1 DLM Grade 9 Grade 12

Uploaded by

Neon 2020X
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

UNIT 1

LESSON 1 - ROBOTICS AND BEYOND


Module Objectives
At the end of this session, you should be able to:
provide a definition for what a robot is;
make a timeline of the evolution of robots; and,
recognize the advantages and disadvantages of having robots.

In the future, robots could be in our homes, neighbors’ houses, in offices, malls, on the streets,
and even inside our own bodies. Like from the fictional movie i-robot, a police detective became a
humanoid with a robotic arm.
Today, we are trying to create robots that can perform highly sophisticated tasks that originally,
only a human being can perform with high precision and accuracy. We call them in different names like
robots, androids, humanoids, cyborgs, droids, and actroids. In the next century, these robots will be a
helping tool to anybody, at home, in the hospital, in transport terminals, and other places.

What is a Robot?
A robot is a human-like machine made out of metal, plastic, or steal, that can perform a task or
series tasks automatically based on the programming and environment it was created for. The origin of
the word ‘robot’ can be traced from Karel Capek (1890-1938), a Czech playwright, who used the word
robot referring to forced labor.

Evolution of Robots

10 AD -70 AD
Mechanical Singing Bird was created by Heron of Alexandria from Greece.

1217 – 1379 BC
Water Clock was invented by Amenemhet from Egypt.

1495
The Mechanical Knight known as the First humanoid was designed by Leonardo Da Vinci.

1822
Difference Engine was invented by Charles Babbage as the first calculator.
1961
UNIMATE was created by George Devol and Joseph Engleberger who designed the first
industrial and programmable robot arm.

1980
Wabot II was created by researchers from Waseda University. It was the first full-scale
humanoid robot that had a camera and was programmed to read and play music with its
robotic arm.

1996
Sojourner was created by NASA. It was the first Mars rover that can be operated outside planet
Earth to investigate the Mars habitat.

2000
Honda’s ASIMO was created by Honda in Japan. It was the first robot that could walk and run
independently with relatively smooth movements and could climb up and down the stairs
autonomously.

2016
Sophia was invented by David Hanson. It is a social humanoid robot that interacts with humans
and can display different facial expressions.

The rapid development of robots will soon populate our world, but for robots to be really use-
ful, they need to be self-sufficient. After all, new robots should have more effective functions as time
goes by. Robots would be able to execute new courses of actions through the use of advanced artificial
intelligence.
STUDENT ACTIVITY

Make a timeline showing the evolution and development of robotics. Name the robots and identify
the important events that happened. The first robot has been identified for you.

ROBOTS

Mechanical
Singing

10 AD - 70 AD

created by
Heron of
Alexandria
from Greece

IMPORTANT EVENTS

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 2
HALO CODE
Module Objectives
At the end of this session, you should be able to:
be familiar with HaloCode; and,
identify the parts, features, and specifications of HaloCode.
HaloCode is a powerful single-board computer specially designed for programming.
HaloCode Integrated Onboard Components:
• 12 programmable RGB LEDs
• motion sensor
• microphone
• programmable button
• 4 touch sensors
HaloCode Specifications:

Chip ESP32
Core Xtensa dual-core 32-bit LX6 microprocessor
CPU Clock Speed 240 MHz
Flash Rom 440 K
RAM 520 K
SPI Flash 4 MB
PSRAM 4 MB
Operating Voltage 3.3 V
Product Dimensions Diameter: 45 mm
Weight 10 g

HaloCode Features:
• Built-in Wi-Fi Modules
Self-contained System On Chip (SOC) with integrated TCP/IP (Transmission Controlled
Protocol / Internet Protocol) that can give access to a Wi-Fi (Wireless Fidelity) Network within
a range.
• LAN Functionality
Local Area Network (LAN) links the device together and provide access to other computers
• Easy IoT Applications
IoT (Internet of Things) is a system of interconnected computing devices through machines
• AI Speech Recognition
AI (Artificial Intelligence) automatic speech recognition understands voice by the computer
that performs an action based on the required task.
• Multi-Thread Programming
Ability of a program to process data with more than one user at a time.
Parts of Halo Code

copper foil tape HaloCode


AAA size battery holder

multicolored alligator clip

hook & loop strap

white & black micro USB cable


fuzzy fastener

(1) HaloCode (1) AAA size battery holder


(1) micro USB cable (1) hook & loop strap
(1) copper foil tape (1) multicolored alligator clip
(4) black fuzzy fastener (4) white fuzzy fastener
STUDENT ACTIVITY

Identify the parts of HaloCode and write your answers on the space provided.

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 3
MICROCONTROLLERS
Module Objectives
At the end of this session, you should be able to:
define what a microcontroller is;
differentiate a microcontroller from a microprocessor; and,
enumerate the different kinds of microcontrollers.

A Micro Controller Unit or MCU is a small programmable computer on a single integrated cir-
cuit chip that can process and perform data with a small amount of memory.
Microcontrollers are used in different devices that can be controlled automatically –like engines
from automobiles, home appliances, remote control, toys, and other embedded systems.
A microprocessor is a computer processor that controls different functions of a CPU or Central
Processing Unit on a single Integrated Circuit (IC).
Microprocessors are usually found inside in computer attached to the motherboard. They are
also known as the brains of a computer that carry out commands.

Different Kinds of Microcontrollers


Arduino Uno
- is a microcontroller board based on a microchip. It has 20 digital I/O pins. It is designed
to make electronics accessible to everyone interested in electronics and programming.
Arduino Nano
- is a compact micro board powerful enough to hold 16 MHz of frequency which is the
same as Arduino UNO. However, it does not have a DC power jack.
Raspberry Pi
- is a credit-card sized single board computer that can be used for many applications. It
has the capability of a regular desktop. It can be connected to a monitor, keyboard,
and a mouse.
Makeblock mCore
- is a micro controller that powers the mBot, with a built in I/O component like RGB LED,
buzzer, light sensors, motors, and other communicating devices.
Makeblock Orion
- is a main control board based on Arduino Uno that makes connecting of wires from
different electronic modules of Makeblock easy. It can run and program ten different
I/O devices on a single board.
STUDENT ACTIVITY
Based on the description of a microcontroller, make an analogy. Think of anything that will make
you remember a microcontroller in terms of size and functions. You may draw or write the description
in the space provided.

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 4
COMPONENTS OF HALOCODE
Module Objectives
At the end of this session, you should be able to:
be familiar with the components of HaloCode; and,
determine the function of each part of HaloCode.

The brain of living things receives information through the senses and coordinates with the
other parts of the body for a variety of movements.
Robots, on the other hand, have microcontrollers that interact and give instructions to the sen-
sors and actuators in different ways to adapt to its environment.

Components of a Robot
A typical robot has the following parts:
Controller - is a device that fetches and decodes data interpreted from the memory to form an
action.
Sensors - are devices used for sensing the condition from its environment for effective
performance.
Actuators - are mechanical devices for controlling the movement of an object.
Frames– are materials that hold all the components of a robot.

Being a wireless single board computer, HaloCode has the following parts:

Connecting Pins
Ground
GND
Note: Do NOT connect directly to the power pin.
CONNECTING PINS

3 Volts Power In or Out


3V Note: If the boa
Never connect directly to the GND pin.

Input and output pins can be used for both analog and digital
0-1-2-3
signal.

Input and Output Pins

The four pins can be used for digital and analog input and
output signals. Pin 0-1 are digital pins signals and pin 2-3 are analog pin
signal (values between 0 and 1023).

The four large pins allow the con-


nection of components through cables
equipped with colored alligator clip.

Power Pin

The pin labeled “3.3 V” provides power to the additional sensors


or actuators connected to the HaloCode.

For safety, avoid contact with other components or pins in the


board for this can cause damage.

Ground Pin

The pin labeled “GND” is the ground connector for the addition-
al sensors or actuators connected to HaloCode.
Single Blue Button
HaloCode has a single blue button located in the center of the
board. The button is a sensor which returns a logical value based on its
state:

• True (logical 1) if pressed


• False (logical 0) if not pressed

One primary function of the button is to select options or toggle states


(ex. Turning On or OFF of an LED).

HaloCode has 12 RGB LEDs in a ring formation. Each RGB LED is made up of three monochrome
LEDs– one of each primary color: red, green, and blue. Combining these three primary colors can create
different colors from the spectrum.

RGB LED

RGB stands for red, green, and blue.

LED stands for Light Emitting Diode.

• Primary colors - red, blue, yellow

• Warm colors - red, orange, yellow

• Cool colors - green, blue, purple

• Complementary colors - directly across


Ex. yellow and violet

• Analogous colors - 3 touching hues


Ex. yellow green, green, blue green

• Triadic colors - 3 evenly-spaced


Ex. yellow orange, blue green, red violet

• Split-Complementary colors - a skinny Y shape


Ex. yellow green, blue green, red

Color Wheel Chart


STUDENT ACTIVITY
Match the components of HaloCode in column A with the proper description in column B. Write
the letter of the correct answer on the line before the number.

Column A Column B

1. Single Blue Button a. It is a device used for sensing the condition of


an environment.
2. Actuators
b. It stands for Light Emitting Diode.
3. Power Pin c. It has 4 pins which can be used for digital and
analog signals.
4. RGB
d. It stands for Ground Pin.
5. Input and Output Pins
e. It is an input key located in the center of the
6. Controller board.
f. It is a mechanical device for controlling the
7. LED
movements of objects
8. Sensors g. It is a pin that provides 3.3V of power to other
sensors.
9. GND
h. It is a device that fetch and decode data from a
10. Frame memory.
i. It stands for Red, Green, and Blue lights.
j. It is a material that holds all components of a
robot.

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 5
SENSORS
Module Objectives
At the end of this session, you should be able to:
define what a sensor; and,
identify the different integrated sensors in HaloCode.

Robots are able to feel, hear, show balance, and react to its surroundings.
Parts of HaloCode:
Front View

Microphone RGB LED

Programmable Button

Motion Sensor
Touch Sensor

MicroUSB Port
Touch Sensor
The four golden colored connection pins are the touch sensors. It is also known as capacitive
sensors that act like a switch. It will activate when touched.
Sound and Voice Sensor
It is a sensor that gives HaloCode the sense of hearing not only for measuring the intensity
of sounds, but also for interpreting it. Using a sound and voice sensor, one can turn on or off the LED
switch one’s voice.
Gyroscope and Accelerometer
A gyroscope is used to maintain the orientation or balance of an object.
An accelerometer is a device that measures the acceleration of an object.
A gyroscopic sensor and an accelerometer allow to measure the angular movement and accel-
eration in 3 axes. The gyroscope range is + -180° on the X axis and + -90° on the Y axis, while the accel-
erometer range is + -8g.

Let us use the airplane’s movement as


an example to help us picture out the
axes.
STUDENT ACTIVITY
Choose the appropriate sensor to complete the given task. Write the letter of the BEST answer be-
fore the number.

1. It is used for activating a project 4. It used for the acceleration of a bicycle.


without the use of voice and sound. a. sound and voice sensor
a. touch sensor b. gyroscope and accelerometer
b. gyroscope and accelerometer c. touch sensor
c. sound and voice sensor
5. It is used for measuring the movement
2. It is used for making a project for a of a rolling ball.
certain command to move. a. touch sensor
a. gyroscope and accelerometer b. sound and voice sensor
b. sound and voice sensor c. gyroscope and accelerometer
c. touch sensor

3. It is used for turning LEDs on and off


with the user’s voiced.
a. touch sensor
b. gyroscope and accelerometer
c. sound and voice sensor

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 6
POWER AND SAFETY
Module Objectives
At the end of this session, you should be able to:
identify the parts on the supply power of HaloCode;
enumerate safety tips and procedures in using HaloCode; and,
recognize the importance of safety measures in dealing with electricity.

To make your HaloCode serve its purpose, it must be connected to a power supply and operate.
Here are the important apparatuses needed for power supply:

Micro USB Port

The Micro USB connector assists in loading programs to the memory and to power on your
HaloCode.

USB Connector

The USB connector makes the transfer of files from your computer to HaloCode fast and easy.

Power Supply

The power supply is a device that supplies electrical energy to any electrically powered
equipment.

To operate HaloCode, a 3- or 5-volts battery can be used. The HaloCode board is powered by
3.7 Volts Lipo battery.

Safety

For safety, avoid contact with other components or pins of the board for this can cause damage
to the device.

Secure all connections before turning it ON. Connect the power supply to HaloCode properly to
avoid false contact.

Avoid a close contact between metal screws to prevent short circuit or damage on board. Use
a nylon screw or cord instead. Why is it important to use the right power supply to make HaloCode
work?
STUDENT ACTIVITY

It is important to follow safety measures in handling equipment especially electrical devices. As a


student, what is the significance of following rules and regulations in school?

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


UNIT 2
LESSON 7 - ALGORITHM
Module Objectives
At the end of this session, you should be able to:
define what an algorithm is;
use a flowchart in making an algorithm; and,
enumerate the uses of algorithm in daily life.

A computer program is a set of instructions given to a computer to perform a series of specific


tasks. Without a program, computers are not capable of performing any task. A general set of programs
is called a software.

A source program or a source code is written by the programmer in a programming language,


more or less close to human language.

An algorithm is a set of well-defined ordered instructions to be carried out by a computer


for solving problems.

In our daily routines, algorithms are used to help us solve problems or execute actions. Let us
utilize the problem on the right as an example.

It is highly recommended for a programmer to be clear about the algorithm before creating
the program.


A flowchart is a type of diagram that follows a sequence of actions represented by symbols
or figures. A flowchart is useful in solving problems in a step-by-step procedure.

Basic Flowchart Symbols

Symbol Name Function

An oval shape represents


START/END
START or END of a program.
Diamond shape indicates
DECISION decision like;
TRUE or FALSE, YES or NO.
A parallelogram shape indicates
INPUT/OUTPUT an INPUT or OUTPUT
instruction from the program.

A rectangle represents the


PROCESS
process.

An arrow represents the flow


FLOW LINES
of the direction in a program.

Example:
Below is a flowchart program to show the procedure on how to read the room temperature with a
code.
STUDENT ACTIVITY
You are requested by your mother to prepare hard-boiled egg. Draw a flowchart to show the
procedure of boiling an egg. Use the symbols and words discussed in the module in creating your flow-
chart.

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

2 3 4
I1don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 8
MAKBLOCK 5 PROGRAM
Module Objectives
At the end of this session, you should be able to:
identify the GUI of Makeblock 5; and
connect HaloCode to mBlock App.

Makeblock 5 is a scratch-based software program used for coding graphical and textual pro-
gram language.
mBlock is easy to use. With just a click, drag, and drop of blocks, coding and programming can
be completed.

Launching mBlock 5

1. Go to the desktop and locate and click the icon mBlock.


Navigation Tool Bar

Icon Name Description

Language You can click it to change the UI language.

You can click it to create, open, save a project,


File import a project from your PC, or export your
project to PC.
You can click it to turn on or off the stage turbo
Edit
mode.

You can click it to change the title of the


Title
current project.

You can click it to save the current project to My


Save
Projects.
You can click it to view the online mBlock 5
Tutorials
help documents and program examples.
You can click it to give your feedback to us. Your
Feedback experience is what we care about. Any feedback
is welcome.
Sign up or You can click it to sign up a mBlock account or
Sign in sign in.

Editing Area

Red Stage Area: add designs, connect devices, and set sprites and backgrounds
Blue Blocks Area: command blocks are located and are categorized by color
Green Script Area: area where different blocks are placed
Connecting to HaloCode

1. Under “Devices”, click “+” to add device.

2. From the pop-up


Device Library page,
select “HaloCode”
and click ”OK”.

3. Use a micro-USB cable to connect your


HaloCode to a USB port in your computer.
4. Under “Devices”, choose “HaloCode,”
and click ”Connect”.

5. The Device Connection window will pop up.


The serial port of HaloCode will automatically
be detected. Click ”Connect”.

6. Toggle on Upload Mode.


STUDENT ACTIVITY

Complete the table by describing and identifying the icons using your own words.
Icon Name and Description
LESSON 9
COMMAND BLOCKS
Module Objectives
At the end of this session, you should be able to:
identify different command blocks; and,
demonstrate how to control a Sprite character.

Command blocks are designed in different shapes and color which can be connected to each
other vertically like a jigsaw puzzle.

Event Block
Event Blocks and Their Uses

executes when you press the green flag.

executes when you press the specified key on the keyboard.

executes when you click the sprite.

Control Block
Event Blocks and Their Uses

executes the scripts included in this block repeatedly.

repeats the scripts included in this block a number of times. The default
value is 10.

executes the scripts included in this block repeatedly.


executes the scripts included in this block.

executes script 1 included in this block if the specified conditions are met. Oth-
erwise, script 2 is executed.

waits until the specified conditions are met before executing.

executes the included scripts and stop execution when the specified conditions
are met.

Motion Block
Motion Blocks and Their Uses

moves the Sprite forward the specified number of steps.

turns the Sprite clockwise the specified degrees

turns the Sprite counter-clockwise the specified degrees.

makes the Sprite face the specified direction.

makes the Sprite face the mouse pointer or another specified


sprite.

makes the Sprite bounce back when it touches the edge of the
stage.

sets the rotation style of the sprite either; left-right, don’t rotate,
or all around
Looks Block
Looks Blocks and Their Uses
displays a speech bubble containing the specified text on the
upper right of the Sprite for the specified period.

displays a speech bubble with the specified text on the upper right
of the sprite.

Sensing Block

displays a speech bubble with the specified text on the upper


right of the sprite.

Operators Block
Operator’s Blocks and Their Uses

performs the mathematical operation either addition, subtraction,


multiplication, or division.

picks a number randomly from the specified range.

executes the subsequent script if the value of the specified param-


eter is greater than the specified value.

executes the subsequent script if the value of the specified param-


eter is smaller than the specified value.

executes the subsequent script if the value of the specified param-


eter is equal to the specified value.
What is a Sprite?

A Sprite is a graphical character that can be programmed using mBlock.

You can choose a Sprite in creating your program.

Buildings Fantasy

Plants
Let’s make our Sprite move.

When you click the green flag, the Sprite moves 10 steps for-
ward.

After you click the green flag, the Sprite says “Hello,” waits one
second, and then says “I am a Panda.” (The sprite in this exam-
ple is Panda.)
STUDENT ACTIVITY

Describe the action of the Sprite character based on the given command blocks for each item.
LESSON 10
LIGHTS
Module Objectives
At the end of this session, you should be able to:
manipulate LEDs using command blocks; and,
control RGB LED Lights.

Lighting
The HaloCode consists of 12 RGB LEDs forming a ring shape.

The Play block specifies LED animation.


There are four (4) options: 1) ”rainbow”, 2) “spin-
drift”, 3) ”meteor”, and 4) ”firefly”.

The block itself allows access to a drop-down menu to select one of the available patterns:

Effects: Description
Rainbow All the LEDs light up and a transition of the colors of the rainbow occurs.
All LEDs turn blue and then a group of white LEDs rotates until the
Spindrift
circle is completed.
Similar to the previous one but at a higher speed and two rounds are
Meteor
completed.
Firefly At random, the LEDs are switched on and off progressively.

When the “GREEN FLAG” is clicked, the


LED animation “rainbow” will be played.

Show Block
When the “GREEN FLAG” is clicked, the LED ring will
light up in the specified color order.
In this program, when the “GREEN FLAG” is clicked,
the board will show the specified color order of the LEDs
with a waiting sec of 0.5.

Soon after this task, the LEDs will move based on


the assigned rotations of onboard lights.

This block allows you to turn on all the LEDs by


specifying a certain color, saturation, and brightness.

Clicking the color opens a drop-down that allows


selecting each parameter. It also has a tool in the lower
part to take the color sample from the mBlock5 stage.

When the “GREEN FLAG” is clicked, all the LEDs will


light up green.

This block allows you to turn on all the LEDs by specifying a certain color, saturation, and
brightness. You can also set the brightness, either with a constant value or with a variable.

When the “GREEN FLAG” is clicked, all the LEDs will


light up green at 50% brightness.
This block allows you to turn on all the LEDs by specifying the value of each of the three com-
ponent colors (red, green, or blue). Indicating the values 0, the LEDs turn off.

Based on this program, the red LED and


theblue LED will light up at the same time with
a specified value for it to have a mixed color of
violet.

On this program, the Red LED will light


up with a given value of 1 second followed by
Green LED for 1 second in sequence and with
the command where the all assigned LEDs will
turn off after executing the given code.

For more interesting color mixture, try to use this color table.
STUDENT ACTIVITY
Using mBock 5 draw a HaloCode figure with 12 LED lights, create a program to display the specified
color order with its 12 LEDs in sequence.

Write your code here:

ASSESSMENT
Create a rainbow color sequence per LED that changes according to your design.

Write your code here:

SELF ASSESSMENT

Criteria Description Rate


problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
LESSON 11
SENSING
Module Objectives
At the end of this session, you should be able to:
utilize command blocks sensing;
determine how to control integrated sensors in HaloCode; and,
create programs using correct sensors of HaloCode.

Sensing block is used to check if the button is


pressed. It is usually used to condition actions.

When the “GREEN FLAG” is clicked, if the button is


pressed, the LED animation “rainbow” will be played.

This block reports current loudness detected by


HaloCode’s microphone. The value ranges from 0-100.

This block specifies the assigned touchpad (0, 1, 2,


3) when touched. It reports when the condition is met.

This block reports the strength by which the


specified touchpad (0, 1, 2, 3) is touched. The value range
is 0-100.

When the “GREEN FLAG” is clicked, if the touch-


pad 0 is touched by strength greater than 50, the LED
animation “rainbow” will be played.

This block specifies the position of HaloCode.


There are six (6) options: 1) ”left-tilted”, 2) ”right-tilted”,
3) ”arrow-up”, 4) ”arrow-down”, 5) ”LED-ring-up”, and 6)
”LED-ring down”.

When the “GREEN FLAG” is clicked, if it is left- tilted, the


LED animation “rainbow” will be played.
This block specifies if HaloCode is being shaken.
It will report the if the condition is met.

When the “GREEN FLAG” is clicked, if it is


shaken, the LED animation “rainbow” will be played.

This block reports the strength by which


HaloCode is being shaken. The value range is 0-100.

When the “GREEN FLAG” is clicked, if the


shaking strength is greater than 20, the LED animation
“rainbow” will be played.

Motion Sensor

This image shows the three axes (x, y, z) of


HaloCode and corresponding directions of the roll (Y),
pitch (X) and Yawn (Z).

This block reports the acceleration (m/s²)


detected by motion sensor around the x, y, or z axis.

This block allows to obtain the inclination angle


of HaloCode.
Returns values between 0 and 180, negative
forward and positive backward. It is usually used to as-
sign it to variables or condition actions.

This block allows to obtain the lateral rotation


angle of HaloCode.

Return values between 0 and 90 degrees,


negative to the left and positive to the right. It is usually
used to assign it to variables or condition actions.

When the “GREEN FLAG” is clicked, if the pitch is


greater than 150 degrees, all the LEDs will light up red.

This block reports the rotation angle around the


x-axis, y-axis, z-axis, or all axes of HaloCode.

The gyroscopes sensors are suitable for determining instantaneous and small magnitude
turning angle, but they are not suitable for determining angles of rotation over time or of great
magnitude.
This block reports HaloCode’s timer value
(measured in second, rounded to the nearest tenth).

When the “GREEN FLAG” is clicked, if the Halo-


Code timer is greater than 1000 seconds, all the LEDs
will light up red.
STUDENT ACTIVITY
Write the correct sequence of command blocks from the given instruction.

Write your code here:


When the “GREEN FLAG” is clicked, if the
detected loudness is greater than 50, the LED
animation “rainbow” will be played.

Write your code here:


When the “GREEN FLAG” is clicked, if
touchpad “0” is touched,the LED animation
“rainbow” will be played.

Write your code here:

When the “GREEN FLAG” is clicked, if the


acceleration around the x-axis is greater than 10,
all the LEDs will light up green.

Write your code here:

When the “GREEN FLAG” is clicked, if the


rotation angle around the x-axis is greater than
720 degrees, all the LEDs will light up red.
SELF ASSESSMENT

Criteria Description Rate


problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 12
OPERATORS
Module Objectives
At the end of this session, you should be able to:
manipulate command blocks operators; and,
apply mathematical operations in coding.

Operators are group of blocks that allow mathematical operations, logical operations,
comparisons,and arithmetic function to be applied in coding.

Common Operators (Mathematical Operators)

Addition Multiplication

Subtraction Addition

Sample code:

When the “SPACE BAR” key is pressed, the LEDs will


light up in 1 second and OFF in 1 second with RED color
repeatedly every (1+2) or 3 seconds.

When the “SPACE BAR” key is pressed, the LED ring


will light up after rotating a specified color in (2-1) or 1
LEDs.
When the “SPACE BAR” key is pressed, the LEDs will light
up in 1 second and OFF in 1 second with RED color repeatedly
every (6÷2) or 3 seconds.

Pick Random Number


Pick random number is a block that randomly selects
a number between the given values. The random numbers are
generated by a computer and follow a sequence determined
from an initial number called “Random Seed”.
Sample code:
When the “SPACE BAR” key is pressed, LED
ring will light up and rotate in specified color after
any number from (1-5) LEDs.

Comparison
These three blocks allow you to compare two variables of the same type. If the comparison
is true, the result is true. Otherwise, it is false.

Assume that the variables to be compared are A and B, the possible comparisons are:

Logical
Logical Block Description Equivalent Value
Operation
check if value A is equal to
A=B A is Equal to B
Value B
check if value A is greater
A>B A is Greater than B
than value B
check if value A is less
A<B A is Less than B
than value B

Sample code:

When the “SPACE BAR” key is pressed, if the


microphone loudness is greater than 50, all the LEDs will
light up the RED color and turn off after a one-second loop
in (forever) operation.
Logical Operators AND, OR, NOT
Two logical operations: 1 is equal to ”true”, while 0 is equal to ”false”.

The operator AND allows the combination of two conditions. For


the overall result to be true, both conditions must also be true.

The operator OR allows the combination of two conditions but will


be accepted true even though ONLY one condition is true.

Logical Operation AND Result Logical Operation OR Result

1 AND 1 = 1 1 1 OR 1 = 1 1
1 AND 0 = 0 0 1 OR 0 = 1 1
0 AND 1 = 0 0 0 OR 1 = 1 1
0 AND 0 = 0 0 0 OR 0 = 0 0

This block allows you to reverse the resulting value of a condition. It corre-
sponds to the “Not” operation of the Boolean in algebra.

Not(1) = 0 Not(0) = 1

When the “SPACE BAR” key is


pressed, the LED animation “rainbow” will
be played and turn OFF after 1 second, if
touchpad 0 is touched AND HaloCode is-
being shaken. Loop in forever operations.

When the “SPACE BAR” key is


pressed, the LED lights ON in RED color
and will turn OFF after 1 second if the
button is pressed OR HaloCode is being
shaken. Loop in forever operations.
STUDENT ACTIVITY
Identify the operators used in the following codes and give what is being asked.

mathematical operators pick random number

comparisons logical operators

1. Write the code based on the problem given, place your answer inside the box.

If the rotation angle around the x-axis is


greater than 600 degrees, all the LEDs
will light up purple.

2. Write the output action of the given code below.

ASSESSMENT
What is the importance of operators in a program?

Mathematics is all around us. If you will be asked to add, subtract, multiply, and divide something in
your life, what would it be? Why?
LESSON 13
PINS
Module Objectives
At the end of this session, you should be able to:
manipulate command blocks pins; and,
use digital or analog pins of HaloCode.

Connecting pins in HaloCode can be configured either as an input or output and for digital or
analog signals.
Pins 0 and 1 are called digital pins (D) in HaloCode, while pins 2 and 3 are analog pins (A). All
analog pins can be identified from values 62 higher than 512, and digital pins are identified as 1 and
lower values as 0.

This block allows you to check the digital (binary)


values of any of the 4 pins.

Controlled by a PWM (Pulse Width Modulation) signal like a potentiometer, you can con-
trol the 12 LED ring of HaloCode from 0 value to 1023.

Materials Needed: Wiring Connection:


• 1pc. breadboard
• 1pc. potentiometer
• connecting wires

Procedure:
1. Connect black wire to GND.
2. Connect red wire to digital pin 0.
3. Connect blue wire to 3.3V.
Code
When the “SPACE BAR” key is pressed, if pin 0 is in
high voltage, all LEDs will light up blue, but if the voltage is
low, all LED will light up red.

Digital Read Pin


It reads the digital value of the specified pin of (0, 1, 2,
3). The value is either 0 or 1.

When the “SPACE BAR” key is pressed, if the digital


value of pin 0 is 0, all the LEDs will light up blue, otherwise
red.

Analog Read Pin


It reads the analog value of the specified pin of (0, 1, 2,
3). The value range 0 -1023.

When the “SPACE BAR” key is pressed, if the analog


value of pin 2 is greater than 500, all the LEDs will light up
blue, otherwise red.

Servo Pin
It rotates the servo motor of the specified pin (0, 1,
2, 3) to a specified angle.
Materials Needed: Wiring Connection:
• 1pc. micro servo motor
• connecting wires

Procedure:
1. Connect black wire toGND.
2. Connect red wire to3.3V.
3. Connect yellow wire to digital pin0.

Code
When the “SPACE BAR” key is pressed, it rotates the
servo pin 0 from 0-degree angle to 90-degree angle.

Buzzer Pin
It reads the frequency value and produce buzzing sound of the specified pin (0, 1, 2, 3).

Materials Needed: Wiring Connection:


• 1pc. passive buzzer
• connecting wires

Procedure:
1. Connect black wire to GND.
2. Connect red wire to digital pin 0.

Code
When the “SPACE BAR” key is
pressed, buzzer pin 0 plays at a frequency
of an assigned value with a given length of
time.
STUDENT ACTIVITY

Create the following projects and perform the tasks required. Write your answer in the box.
Project 1: Project Angle Measuring Device Materials Needed:
1 pc. white folder 1pc. protractor 1 pc. HaloCode
1 pc. servo motor 1pc. marker connecting wires
1 pc. masking tape

Procedure

1. Cut a 6 x 4 inches white folder, and a small arrow


pointer to be attached to the servo motor.

2. At the center of the cut folder, draw an arc using a


protractor and label it with value of 0, 45, 75, 90, 115,
130,and 180-degree angle.

3. Place the servo motor at the center together with the


cut folder and arrow pointer to the servo motor.

4. Start programming your HaloCode using the servo


pin, the objective is to rotate the arrow pointer and
pause for a second and move to the next position.

Task 1: Program your HaloCode


Write your code here:
showing the arrow pointer move at 45
degrees.

Task 2: Program your HaloCode showing Write your code here:


that the arrow pointer is moving from 0
going to 90 degree and pause for 1
second before returning back to 0 angle.
SELF ASSESSMENT

Student Name: Grade / Section


Activity Name: Servo Action
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20

SELF REVIEW

How did you find the activity? Circle the number that corresponds to your answer and write a short
description of your answer.

2 3 4
I don’t really
1 I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 14
PROJECT: VOLUME DETECTOR
Module Objectives
At the end of this session, you should be able to:
manipulate command blocks light, control, and events; and,
define sound.

Sound is defined as the energy created by the vibration of particles


travels through solid, liquid, and gas like air that can be detected by a human
ear. The perception of loudness from the intensity of sound is called volume.

Low Volume (less air pressure) High Volume (more air pressure)

This activity will test the volume of sound using the microphone in HaloCode.

Microphone
STUDENT ACTIVITY
Materials Needed:
1 pc. HaloCode and microphone

Procedure
1. Prepare the HaloCode setup.
2. Sing the notes of DO RE MI then measure the volume of sound using the microphone as the
input source showing in the 12 LED ring of HaloCode as our output display.
3. Regulate the sounds produced to achieve the task given.

Sing the note for DO to maintain only 6 LED lights on for 3 seconds.

Rate yourself (Check the box beside your answer).


I tried by
I did it easily. I did fine.
best.

Sing the note for RE to maintain only 3 LED lights on for 3 seconds.

Rate yourself (Check the box beside your answer).


I tried by
I did it easily. I did fine.
best.

Sing the note for MI to maintain only 8 LED lights on for 2 seconds.

Rate yourself (Check the box beside your answer).


I tried by
I did it easily. I did fine.
best.

Sing the note for FA to maintain only 10 to 11 LED lights on for 2


seconds.

Rate yourself (Check the box beside your answer).


I tried by
I did it easily. I did fine.
best.
SELF ASSESSMENT

Student Name: Grade / Section


Activity Name: Volume Detector
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20

SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because

In this lesson, I learned

During the process, we encountered issues

In the end, we solved the problem by


LESSON 15
PROJECT: COLOR MIXER
Module Objectives
At the end of this session, you should be able to:
manipulate command blocks light, control, and events; and,
mix color using HaloCode.

The color wheel is the basis of color theory. It shows the arrangement of colors from primary,
secondary, to tertiary colors. Mixing colors bring color harmony that is pleasing to the eyes.

Color schemes refer to harmonious color combinations. It may be composed of any two col-
ors opposite each other in the color wheel; any three colors equally spaced around the color wheel
forming a triangle, or any four colors forming a rectangle
Did you know that colors have meanings as well?

Red is the color of fire and blood. It is associated with energy, war, danger, strength, power,
determination, as well as passion, desire, and love.

Yellow is the color of sunshine. It is associated with joy, happiness, intellect, and energy.

Green is the color of nature. It symbolizes growth, harmony, freshness, and fertility. Green has
strong emotional correspondence with safety. Dark green is also commonly associated with
money.

Blue is the color of the sky and sea. It is often associated with depth and stability. It symbolizes
trust, loyalty, wisdom, confidence, intelligence, faith, truth, and heaven

Orange combines the energy of red and the happiness of yellow. It is associated with joy,
sunshine, and the tropics. Orange represents enthusiasm, fascination, happiness, creativity,
determination, attraction, success, encouragement, and stimulation.

Purple combines the stability of blue and the energy of red. Purple is associated with royalty. It
symbolizes power, nobility, luxury, and ambition. It conveys wealth and extravagance. Purple is
associated with wisdom, dignity, independence, creativity, mystery, and magic.

White is associated with light, goodness, innocence, purity, and virginity. It is considered to be
the color of perfection.

Black is associated with power, elegance, formality, death, evil, and mystery.
STUDENT ACTIVITY

This activity will test the mixing of colors using the touchpad in HaloCode.

Materials Needed:
3 pcs. wire
1 pc. HaloCode
masking tape

Procedure:
1. Cut 3 sheets of aluminum foil cut into a square.
2. Attach the individual wires to the aluminum foil using a tape.
3. Attach the end of the wire to the HaloCode.

Sample code:

Task 1: One Touch. Touch the aluminum foil and observe what color is shown.
When touchpad 0 is touched what color lights up?
When touchpad 1 is touched what color lights up?
When touchpad 2 is touched what color lights up?

Task 2: Mixing Colors. Touch the aluminum foil and observe what color is shown.
When touchpad 0 and 2 are combined, what color lights up?
When touchpad 0 and 1 are combined, what color lights up?
When touchpad 1 and 2 are combined, what color lights up?
When all touchpads are combined, what color lights up?
SELF ASSESSMENT

Student Name: Grade / Section


Activity Name: Color Mixing
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20

SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because

In this lesson, I learned

During the process, we encountered issues

In the end, we solved the problem by


UNIT 3
LESSON 16 - NETWORK CONNECTION
Module Objectives
At the end of this session, you should be able to:
define what a network is;
understand the fundamentals of a network; and
enumerate the types of network connections.

A network is a group of devices such as computer systems linked together, for sharing files,
and even for importing and exporting documents.

A network connection involves two or more computers connected either by wire or wireless
connection for transmitting, receiving shared resources and data.

The physical and logical framework of a network is called a network architecture. It is a


structured design that includes hardware, software, and network devices that include topology and
communication protocols.

Computer network devices are digital communication devices used for network shared
information between other nodes. Some examples of these are router, hub, modem, and network
data cables.

A router is a device that connects multiple networks and send nodes within the network.

A hub is a common connection point of devices connected to a network.

A modem or “modulator-demodulator” is a device used to send digital data over a tele-


phone line, where modulation means sending analog data signals and demodulates receiving back
into a digital data signal.

Network data cables are used to connect and transfer information in a form of data be-
tween computers and other network devices in a network. There are different kinds of network
cables: coaxial, fiber optic, and twisted pair cables.

Network Structure
There are different types of networks where devices can be connected to share information.

LAN (Local Area Network) is normally used for a small


network or a short distance like computer laboratory or
resident house.
WLAN (Wireless Local Area Network) is like LAN, but it is
a network device that uses wireless connectivity.

WAN (Wide Area Network) is a network that uses a long-


range telecommunication link to connect more than two
computers or LAN computers in different places like states
or countries.

MAN (Metropolitan Area Network) are for larger than


LAN but smaller than WAN, like Cities, town or Campuses.

PAN (Personal Area Network) is a single personalize


network for example your phone is linked to a laptop that
shares and sync your personal data like e-mails, photos,
and other documents.

CAN (Campus Area Network) is larger than LAN but serves


a network of devices within the vicinity of a campus or
universities.
Network topology describes the physical arrangements of computers connected in a net-
work. It includes a star, ring, bus, tree, and mesh configurations.

Ring topology is a topology used in LAN where in all


devices are connected in a circular architecture – where data
travel in the same direction.

Star topology is used to limit the probabilities of a net-


work failure since all connections travel in a central hub.

Bus topology is used in LAN, where all the nodes are


connected to a single cable. This central cable is called a back-
bone.

Tree topology is a network structure wherein different


elements are arranged in branches like a tree. This is frequently
used to organize corporate computer networks.

Mesh topology is a network structure where each com-


puter and network device are interconnected with each other.
This allows transmission of data to be distributed even if one
network connection is down. This is normally used for wireless
networks.
STUDENT ACTIVITY

Describe and give the acronym meaning of the following:

1. CAN 4. PAN
meaning: meaning:
who uses it: who uses it:
where is it used: where is it used:

2. LAN 5. WAN
meaning: meaning:
who uses it: who uses it:
where is it used: where is it used:

3. MAN
meaning:
who uses it:
where is it used:

SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because

In this lesson, I learned

During the process, we encountered issues

In the end, we solved the problem by


LESSON 17
INTERNET
Module Objectives
At the end of this session, you should be able to:
define Internet; and
enumerate the types of Internet protocols.

The Internet is the information superhighway, also called the “net” – a term popularized in the
1990s. This refers to a digital communication system.
The Internet is a global network of computers across thousands of devices worldwide, from
computers to smartphones, to their communication devices. Anyone can communicate hassle-free from
different services and products. Everything is connected globally to the Internet world.
“The Internet ecosystem is made up of many organizations and communities that help the
Internet work and evolve. The rapid and continued development and adoption of Internet technologies
can be attributed to the involvement of a broad range of people and organizations; open, transparent,
and collaborative processes; and the use of products and infrastructure with dispersed ownership and
control” (Source: Internetsociety.org).
There are lots of advantages with the use of the Internet to society – from information, knowl-
edge, and learning (read, watch, and listen) to music and entertainment. Everybody is updated and
connected through communication and sharing.
Sending emails and instant messages in real-time, together with media websites, are easy and
accessible to everyone. You can search for locations using virtual maps, buying and ordering food and
products, doing e-commerce like buying and selling and making a profit is now possible. You can know
the latest trends in business and commerce anywhere in the world.
Virtual conferencing and classroom settings can be done anywhere as long as one has an Inter-
net connection. Honestly, the Internet is still evolving, which is why we always need to be vigilant and
careful whenever we are online.
Remember to always “think before you click.” Here are some of the negative impacts when one
is irresponsible in using the net.
• cyberbullying • data leakage
• black mailing • destroys lives
• lying to yourself and to • social disconnection
others • cyber crime
• types of internet connectivity
The Internet and Network Connection
A network is a collection of devices used in communication. It makes the sharing of information
possible.
The Internet is based on a two-part networking system called the TCP/IP (transmission control
protocol/Internet Protocol). This allows the exchange information within a network structure.

Different Types of Internet Protocols

• Transmission Control Protocol (TCP) i is a communication protocol used for communication


inside a network.
• Internet Protocol (IP) is designed for specific addressing protocol connected ina network.
• Post Office Protocol (POP) is designed for receiving incoming-mails.
• File Transfer Protocol (FTP) is used for transferring files from one device to another, such as:
videos, images, audios, and documents.
• Hyper Text Transfer Protocol (HTTP) is designed for transferring hypertext files from client to
server in a system.
• IoRT (Internet-of-Robotic-Things)

Internet-of-Robotic-Things is a developing model that brings an autonomous robot system


together with Internet-of-Things (IoT). It is connected to sensors and smart objects that are linked to-
gether in an embedded system working in an everyday environment.
It is a cooperation of robotics and IoT technology that can be useful to humanity and to the
environment. It is used in farming, dispatching of products in a factory, cleaning and maintaining of a
structure, waste recycling and segregating, and applying logistic systems in different facilities.
The Robot Vector is an example of the Internet-of-Robotic- Things (IORT) that uses Inter-
net-of-Things (IoT). It is an autonomous robot that can recognize people, move objects, and can avoid
obstacles.
It interacts with his surrounding using the sensor of sight, touch, and sound. It can take pictures
and state the weather condition and time. It has also a built-in AI technology that can set reminders,
add to do list, and control your home devices like lights and others related activities.
STUDENT ACTIVITY

Identify the acronym's meaning of the following:

1. IoT

2. FTP

3. TCP

4. POP

5. HTML

6. IP

7. IORT

SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because

In this lesson, I learned

During the process, we encountered issues

In the end, we solved the problem by


LESSON 18
WI-FI
Module Objectives
At the end of this session, you should be able to:
utilize the Wi-Fi and Bluetooth module; and,
explain the advantages and dis advantages of Wi-Fi.

Wi-Fi or Wireless Fidelity is a wireless network technology that lies between ra-
dio wave and microwave signals to provide connection to a network device.


Bluetooth is a wireless technology device that allows different devices to link
together and transfer files at a high-speed performance. It uses radio waves signals to
connect to devices like smartphones, laptops, speakers, controllers, and others in a limited
distance.

HaloCode has a built in Wi-Fi and dual-mode Bluetooth module with a low-power system on
a chip microcontroller.

This group of blocks use a wireless communication using voice to communi-


cate with two or more HaloCode boards.

Voice recognition in HaloCode uses Microsoft Cognitive Services. The HaloCode board
records the voice message and sends it to the Microsoft Server that translates the voice into text.
Wi-Fi access should be available to connect HaloCode to the Internet, and the user needs to login to
Makeblock.com account to make it functional.

Steps on How to Sign Up – Sign In to mBlock 5

1. Click Sign up/Sign in on the right side of the toolbar.

2. Follow the on-interface instructions to sign up/sign in.

Note:
You need to use an international account to sign in to the inter-
national community.

3. After signing in, you can manage or publish your projects and use cloud services.

Click “My Projects” to manage all your saved projects.

Click “Profile” to enter the home page of the mBlock community.

Click “Account Settings” to enter the account settings page to


change your password.
Connect HaloCode to a Wi-Fi Access Point

This allows to connect HaloCode to a Wi-Fi


access point, indicate the name SSID, and the access
key WPA/PSK of the access point.

Once connection is established, you can start programming the Wi-Fi blocks.

When HaloCode starts up, connect to Wi-Fi


“Name “.

Check Wi-Fi Connection

It allows user to check if the Wi-Fi connection


between HaloCode and the Wi-Fi Access point has
established a connection.
Sample code:

When HaloCode starts up, connect to Wi-Fi”


Name.” If the Wi-Fi is successfully connected, all the
LEDs will light up yellow.

Recognize (language) for ( ) Seconds

It allows recognizing a specified language


(Chinese or English) for a given time (seconds).

Sample code:

When the button is pressed, HaloCode will recog-


nize English for 3 seconds.

1. Record a voice within the indicated time.

2. Send the voice file to the Microsoft server to convert into text based on the selected language
(Chinese or English).

3. Wait to receive the message.


Speech Recognition Result

This allows to report the result of speech


recognition.
Sample code:

When HaloCode starts up, if the speech


recognition result includes “blue,” all the LEDs will
light up blue.

Broadcast User Cloud Message

This allows to broadcast the specified user


cloud message.

It works effectively when all HaloCode boards are connected to the same user account, re-
gardless of the location.

Sample code:

When the button is pressed, HaloCode will


broadcast user cloud message “message”.

When Receiving a Cloud Message

This allows grouping a set of actions to be


performed when a message is received from the
user’s cloud.

Sample code:

When HaloCode receives the user cloud


message “message,” all the LEDs will light up red.
STUDENT ACTIVITY
Circle listed words below and write the definition of each on the space provided.

E A C O S T P Q M N O B E W I F I O
P F R P X Z R W A B L V K P L T O X
H G H A O J S B E N L F S P E E D S
S B M L N E T F J K U O E I L N F J
N J O S H G H F H O P E C R E N T A
M F D S T V E M N T E W A Q S W C R
P I U R H S N O P E X Z E T K B L H
L S L S E C U R I T Y S W X P U I W
Q S E N U I W B M L P F R E S T E O

1. cost

2. module

3. range

4. security

5. Wi-Fi

SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 19
LAN
Module Objectives
At the end of this session, you should be able to:
identify the function of the LAN block; and
updating the HaloCode firmware.

LAN (Local Area Network) in HaloCode is a command block that manages the wireless net-
work between HaloCode boards to exchange messages and data among others.

Set-Up LAN Name

This enables to setup LAN connection with a specific


name.
Sample code:

When HaloCode starts up, set up LAN will be named


“mesh1”.

Join LAN Name


This enables to join LAN connection with a specific
name.
Sample code:

When HaloCode starts up, set up LAN “mesh 1” will


allow LAN named “mesh1” to join.

Broadcast Message on LAN


This allows user to broadcast a specific message to the
local network.
Sample code:

When HaloCode starts up, set up LAN “mesh 1” and


join LAN named “mesh1” will receive the broadcast “hello”.

Broadcast a Message on LAN with Value


This allows the user to send a specific mes-
sage with a value to a local network.

Sample code:

When HaloCode starts up, set up and join


a LAN named “mesh1”, and then broadcast “Quiet
Please” with the value “1” on LAN.

When Receiving LAN Broadcast

This allows the user to receive a specific


message to a local network with a certain action
from the script.

Sample code:

When HaloCode receives LAN broadcast


“message”, all the LEDs will light up blue.

LAN Message Value Received


This allows the user to use a value associated
with a specific message sent to local network.

Sample code:

When HaloCode receives LAN broadcast


“message”, if the value received with the message is
“1”, all the LEDs will light up blue.
HaloCode Firmware Update
It is essential to update a firmware because the corresponding programs might fail to run if a
firmware version is too low.

Do to it, it is recommended that you use a USB cable to connect the device to computer and
update the firmware of the device through mBlock 5 on the computer or web (www.mblock.cc).

Updating Firmware Through mBlock 5 on the Computer or the Web

1. Use a USB cable to connect your device to the computer.

2. Open mBlock 5 and connect the device. (You need to start mLink first if you will use mBlock 5 on
the web.)

3. Click “SETTING”, and then click “FIRMWARE UPDATE”. Click “UPDATES” in the dialog box that
appears.
STUDENT ACTIVITY

Materials Needed:
2 HaloCode Boards

Procedure:

1. Work with the group assigned by your teacher (at least 2groups).

2. With your HaloCode, write the code to accomplish the following tasks.

Write your code here:


Task 1: When HaloCode starts up, set up your
LAN (named with your group number) to
join LAN of other group (named with their
group number) to broadcast “Mabuhay”
with a of value “2” on LAN.

Write your code here:

Task 2: One group will send a message “Winner”


and turns the LED lights Red when NO
message receives the LED lights green.
UNIT 4
LESSON 20 - PROJECT: TOUCH AND SHAKE
Module Objectives
At the end of this session, you should be able to:
use the touch sensor in the HaloCode board; and,
use the gyro sensor in the HaloCode board.

Touch is one of the body senses using hands or other body parts to receive stimuli from the
environment.
Shake is an act of movement from different directions. It may include a rotational or angular
motion.
You can create different sounds using your HaloCode.

HaloCode Music Set Using Touch Sensor

Note: Use Sprites tab, to add the music block, click the extension block, and select music.

Use Sprite Character Tambourine Use Sprite Character Triangle

Use Sprite Character Cymbals Use Sprite Character Drum


STUDENT ACTIVITY

Task A. Use your creativity to play a music. Task B. Make a HaloCode Steering Wheel Using
the Gyro Sensor.
1. Use the old folder as a base. 1. Use an old CD and place the HaloCode board
2. Get an aluminum foil and cut it into 4strips. at the center.

3. Cut 4 wires and attach one end to the foil and 2. Use a double-sided tape or an electrical tape
the other end to the HaloCode board. to attach HaloCode.

4. Attach the USB cable to your computer and to 3. Connect the USB cable to your computer and
HaloCode. to HaloCode.

5. Run the program and start playing music. 4. Run the program and start playing.
5. Use the code below to make your steering
wheelwork.
Sample code:

You may add a Sprite character that will help you identify the movement when tilting
HaloCode in different directions; left, right, up, and down.

Code for HaloCode Using Sprite Character

Sprite Airplane
Procedure:
1. Perform task A and B.
2. After you accomplish task A, report to your teacher to have your output checked before
proceeding to the next task.

Guide Questions:
Task A. 1. Describe the sounds produced by your HaloCode.

2. Think of a project where this set up can be used.

Task B. 1. Describe the directions of the Sprite in relation to the directions of the steering wheel.


2. What difficulty did you encounter in performing the task?

SELF ASSESSMENT

Student Name:
Activity Name: Touch and Shake
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
LESSON 21
PROJECT: MESH
Module Objectives
At the end of this session, you should be able to:
use of the mesh network; and,
use of the mesh in HaloCode boards.

Mesh network is a type of network topology in which all devices are interconnected in the
same network either through wired or wireless connection.
STUDENT ACTIVITY

Materials:
2 HaloCode boards
A. HaloCode Mesh Network Project Lights On
Procedure
1. Two groups will be combined to perform this task.
2. Wait for your teacher’s instructions (what groups will work by pair).
3. Use the code below and observe the output actions of your HaloCode board.

HaloCode A Code

HaloCode

HaloCode B Code

HaloCode

HaloCode 2
Guide Questions:
1. Describe the output action of your HaloCode when:

a. HaloCode stars up.

b. button is pressed.

c. receiving LAN broadcast.

SELF ASSESSMENT

Student Name: Grade/Section


Activity Name: Mesh Network (Lights On)
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because

In this lesson, I learned

During the process, we encountered issues

In the end, we solved the problem by


LESSON 22
PROJECT: VOICE AND SPEECH
Module Objectives
At the end of this session, you should be able to:
use the audio recognition via speech or voice command; and,
use the wireless network with the use of audio recognition.

Voice or Speech Recognition is the ability of a machine to identify words in any format of
language. It is embedded in its system and converts it into machine language to be understood
and executed as commanded.
STUDENT ACTIVITY

Task A. Speech Control Command Sample code:


Materials:
HaloCode
USB cable
Wi-Fi connections

Procedure:
1. Copy the given code for HaloCode.
2. Connect your HaloCode via USB cable.
3. Connect your HaloCode to a Wi-Fi access
point before giving a command to your
HaloCode.
4. Upload the program and test.

Guide Questions:
Describe the output actions of your HaloCode after the executing the program.

SELF ASSESSMENT

Student Name: Grade/Section


Activity Name: Speech Control Command
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
Task B. Project Noise Monitoring Procedure:

1. Two groups will work together for this 5. Connect your HaloCode to a Wi-Fi access
project. point before giving a command to your
HaloCode.
2. Wait for your teacher’s instruction for
the groupings. 6. Upload and run the program.

3. Copy the given code below. 7. Use a battery to power the HaloCode.

4. Connect your HaloCode via USB cable. 8. Observe and analyze the output action
of the two HaloCode boards.

HaloCode A (Outdoor)

HaloCode A (Indoor)
Guide Questions:

1. Describe the output action of your HaloCode.

Student Name: Grade/Section


Activity Name: Project Noise Monitoring
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
LESSON 23
PROJECT: WRISTBAND
Module Objectives
At the end of this session, you should be able to:
describe the BAN technologies; and,
use the variable block.

BAN (Body Area Network) is an example of network wireless signal devices with a minimum-
range of that is attached to a human body.

Examples of BAN are the wearable devices like smart health watch and ring. These devices
can monitor user’s heartbeat, blood pressure, motion, sleep, and other information to be sent to your
smartphones connected via Bluetooth or Wi-Fi access point.

Smart Health Oura Health Ring


Watch
STUDENT ACTIVITY

Materials:
HaloCode
USB cable
straps

Task A. HaloCode Project Wristband Procedure:

1. Connect and copy the code to your HaloCode board.

2. Upload and run the program.

3. Attach the HaloCode to the straps to make a wrist watch like feature as shown in the picture
below.

4. Move your wrist in different directions until a SMILEY face is shown in your display.

Guide Questions:
1. Describe the output of your project.

2. When did the SMILEY face show in the display?

.
Student Name: Grade/Section
Activity Name: Project Wristband
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20

Variables Block

Variable block is the orange colored block that is


used to hold values (number) and strings (text).

Once the variables block is selected, select “Make


a Variable”, then type the new variable name that you will
assign to be the value in your program.

Type a new variable name to assign as the value


in your program.

Then click “OK”.

Then select a function for your variable.


• set () To () (Variableblock)
• change () By () (Variableblock)
• show Variable () (Variableblock)
• hide Variable () (Variableblock)
In this activity, we use HaloCode as a wearable device using the motion sensor as an input
source of this project:

Task B. HaloCode Power Wristband


Procedure:
1. Connect and copy the code to your HaloCode board.
2. Upload and run the program.
3. Use a battery to power HaloCode.
4. Shake HaloCode.

Guide Questions:
1. Describe the output of your project.

2. What happened when you shake your HaloCode?


SELF ASSESSMENT

Student Name: Grade/Section


Activity Name: Project Wristband
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20

SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because


LESSON 24
PROJECT: PEDOMETER
Module Objectives
At the end of this session, you should be able to:
describe a pedometer; and,
use a pen block.

Pedometer is a device that counts the steps made by a person. It is sometimes called step count-
er. It detects the movement and tracks different routines.

Pen Block
Pen block is used to enable the Sprite to draw lines or shapes inside the stage area.
To activate the pen block, click the extension in Sprite tab and select pen. Once activated, you
can start drawing shapes and lines with different colors. You may also set pen size to work inside the
stage area.

Let’s Try to Pen Block


Code for Sprite Character Blue Dot Code for Sprite Character Red Dot

Figure 1 (starting area) Figure 2 (walking and resting)


STUDENT ACTIVITY

Task: HaloCode Pedometer Wristband


Code for HaloCode:
Materials Needed:
HaloCode

Procedure:
1. Connect and copy the code to your HaloCode board.
2. Code for HaloCode
3. Upload and run the program.
4. Use a USB Cable to power HaloCode and to read the data.
5. Attach HaloCode to a strap on your risk.
6. Move or walk from side to side and get the reading while
you are moving and resting.
7. Observe and analyze the output action of this project.

Guide Questions:
1. Describe the output of your project.

2. Try to walk slow/ fast, what do you observe in the output?

3. What is the advantage of using a pedometer?

SELF ASSESSMENT

Student Name: Grade/Section


Activity Name: Pedometer
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
LESSON 25
PROJECT: SMART HOME
Module Objectives
At the end of this session, you should be able to:
describe a smart home; and,
explain the convenience of a smart home.

Smart home is a futuristic home using devices connected to the Internet like IoT that enables
the monitoring and managing of your home. This device keeps you on track for surveillance even
you’re away from home.

Convenience of Having a Smart Home


• handling and managing home devices away from home
• maximum home security
• function a home remote control
• increased energy efficiency
• functional monitoring of products and appliances
• automated response through voice command

Materials:
• 1/8 Illustration Board
• Cutter and Scissor
STUDENT ACTIVITY

• Marker • 9g Servo motor and servo arm


• Ruler • Connecting wires
• Double sided tape • Battery
• Masking tape • Smartphone with mBlock app
• 1 HaloCode Board

Procedure for smart home:


1. Create a small doll house.

2. Divide 2 rooms for the garage and living room.

3. Cut a hole for the windows and for the garage door.

4. Create a garage door which will be connected at the servo arm.

5. Attach the servo motor inside the garage and stick it at once side of the wall

6. Connect the servo arm at the servo motor with a small hook attached to the servo arm and the
garage door that will be used for opening and closing the garage door.

7. Connect all wires for the servo motor and individually connect to assign pins of HaloCode.

8. Connect the battery to power your HaloCode.

9. Create a roof and place at the top for your smart home.

10. Turn on your HaloCode.

Procedure for app control:

1. Go to the Sprite tab and create 5 command buttons.


2. Copy the sample code below.

Sprite Code for Bright - Soft Sprite Code for Garage

Sprite Code for Night - Colorful

Code for HaloCode


3. Type smart home as a filename

4. Click publish to be save your file to the cloud.

5. Download and install mBlock App from the Google Play store.

Download mBlock App fromthe Google Play store and install it to your
mobile device to operate your smart home using this app.

6. Using your mobile device, login to your account and open the smart home you save to the cloud
from your computer.

7. Test and run your program.

Guide Questions:
1. Describe your SMART HOME.

2. Why is the project called SMART HOME?


GROUP ASSESSMENT

Meets Developing (3) Poor (2)


Criteria Exemplary (5) Expectations (4) Score

completed and almost com- incomplete tried to perform


accomplished all pleted and details with only the activities
the tasks in the accomplished all one or two cor- but not able to
Accuracy activity the tasks -one rect actions successfully per-
or two items form the tasks
lacking
finished all the finished all the finished all the not able to com-
tasks in less than tasks in more tasks before the plete
Time 20 minutes than 20 minutes end of the class the tasks on
hour/s time
shows cooper- shows cooper- only two or not able to have
ation among all ation among three members cooperation
Cooperation group members some of the are working in in the group
group members the activity

Total

SELF ASSESSMENT

Student Name: Grade/Section


Activity Name: Project Smart Home
Criteria Description Rate
problem solving skills demonstrated problem solving skills in doing the task /5
understanding followed the step-by-step instructions to complete the task /5
cooperation contributed ideas and supported the team /5

responsibility gave an outstanding effort as part of the group /5

Total /20
SELF REVIEW
How did you find the activity? Circle the number that corresponds to your answer and write a short
description for your answer.

1 2 3 4
I don’t really I needed a little I need a bit more I was able to help my
understand the help and I got it. practice. classmates and I need
lesson. more challenge.

I choose number because

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy