You are on page 1of 15

WHOLE BRAIN LEARNING SYSTEM

OUTCOME-BASED EDUCATION

Science, Technology and Engineering (STE) Program


GRADE
ELECTRONICS 10

LEARNING QUARTER 4

MODULE WEEK 7-8

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 0


MODULE IN ELECTRONICS
Science, Technology and
Engineering (STE) Program

QUARTER 4
WEEK 7-8

Downloading Programs from the


Computer to the Microcontroller
and Basic Robot Movements

Development Team

Writer: Richard F. Aison

Editors/Reviewers: Hamilton C. Remigio Ponciano S. Raspado

Lay-out Artist: Hamilton C. Remigio

Management Team: Vilma D. Eda, CESO V

Arnel S. Bandiola Lourdes B. Arucan

Juanito V. Labao Flenie A. Galicinao

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 1


What I Need to Know

This module in Electronics contains information and suggested learning activities


that provides you understanding on the knowledge, skills and desirable attitudes required in
Robotics.

In order to benefit much from this module, you should learn about Downloading
Programs from the Computer to the Microcontroller and the Basic Robot Movement.

Most Essential Learning Competency:

Explain downloading programs from the computer to the microcontroller and the basic
robot movements.

Learning Objectives:

1. State and explain the different downloading programs from the computer to the
microcontroller.
2. Identify the basic robot movements.

Lesson 1 Downloading Programs from the Computer to the Microcontroller


Lesson 2 Basic Robot Movements

What I Know

Directions: Read each item carefully. Choose only the letter of the correct answer and write
it on a sheet of paper.

1. It is a brand of microcontroller commonly used among hobbyists and professionals alike.


A. Arduino C. Mblock
B. Lego D. PIC

2. It is typically programmed in higher-level languages such as C++ or Java.


A. Mica Controller C. Milli Controller
B. Microcontroller D. Mini Controller

3. It is an important part of any design process and programming microcontrollers is no


exception.
A. debugging C. programming
B. downloading D. uploading

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 2


4. Which of the following locomotion simulates human or animal gait, as a replacement for
wheeled motion.
A. brachiating C. swimming
B. slithering D. walking

5. It is the way real snakes move.


A. brachiating C. slithering
B. mimicking D. walking

Lesson Downloading Programs from the


1 Computer to the Microcontroller

What’s In

CROSSWORD PUZZLE
Directions: Look for the words integrated to the Robot Locomotion. Write your answers on a
separate sheet of paper.

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

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 3


What’s New

Introduction to Microcontroller

In today’s evolving world, technology is not only becoming more and more advanced,
but also more and more common in our everyday lives. The invention of “smart” products is
revolutionizing the design process for nearly every product imaginable. Shoes containing chips
that pair with our phones to keep track of our activity, refrigerators that can track when
groceries expire, and now even cars that are capable of driving themselves are all examples
of modern inventions that use microcontrollers to make our lives easier.

A microcontroller is a programmable IC, capable of multiple functions depending on


how it’s programed. Many different kinds of microcontrollers exist that offer a wide range of
functionality. The versatility of the microcontroller is what makes it one of the most powerful
tools in modern design. This guide will explain the basics of microcontrollers and how they are
programmed.

What is It

Selecting A Microcontroller

The features and functionality of microcontrollers are unique to each brand/model.


Before coding a microcontroller for your project, you must select a model that meets all the
requirements of your design. Common features people look for in a microcontroller include I/O
pins, clock frequency and storage memory, however a countless number of other
specifications exist. Writing code is pointless if the hardware can’t interact with your circuit the
way you need it to.

For beginners, Arduino is a brand of microcontroller commonly used amongst


hobbyists and professionals alike. Its software is open source, meaning anyone can contribute
to the growing pool of recourses available to its users. A simple Google search will yield
countless threads, blogs, and forums with examples, documents, and tutorials on how to write
code for a desired application. The development suite used to program the Arduino is available
for free on their website, Arduino.cc. Texas Instruments also has a wide variety of
microcontrollers available, some with specific hardware included on board to specialize them
for more specific tasks. However, these are more complicated to program and use. Often the
user must set data registers manually, often requiring them to read 600+ page data sheets to
find the proper line of code or variable to achieve a certain goal. Compared to Arduino, the
Texas Instrument microcontrollers have more to offer but require more recourses and time.
Countless other manufacturers such as Atmel, Intel, Sony and Ubicon all offer microcontrollers
with different indented applications. Research and experience will help you select the optimal

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 4


choice for your design. Many Internet resources such as http://www.instructables.com/id/How-
to-choose-a-MicroController/ can help along the way.

Programming

Microcontrollers are typically programmed in higher-level languages such as C++ or


Java. One of the essential tools needed to program a microcontroller is an integrated
development environment (IDE). This software is usually developed by the creators of the
microcontroller and contains useful tools to help you program your microcontroller. Common
tools found in IDE’s include code editors, compilers, and debuggers. Depending on the
application of the microcontrollers, additional features may be added as well.

Once a suitable IDE is obtained, you can begin writing code. For explanatory purposes,
this guide will show an example of the Arduino IDE in use. Below is an example of a simple
Arduino program that makes an LED blink on and off at a frequency of 1Hz. The code is split
into 4 different sections as follows:

Figure 1. Arduino-0010 Alpha


Source: app_note_john_foxworth.docx.pdf

It is a generally accepted practice to start any code with a comment section containing
a general description of what the code/program does. While this section has no effect on the
program’s functionality, it’s always a good to document it for future reference. User
instructions, company and copyright information are also commonly placed here as well.

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 5


The second section is the Variable decoration. These variables are global and can be
called in any sections that follow. It is also common to create variables to describe each pin’s
function and set them equal to the pin number on the board to make coding more intuitive.

Thirdly, comes the “Void Setup ()” section. Digital pins on microcontrollers are
commonly used as inputs or outputs, but very rarely can they be both. In this section, the user
defines which pins are inputs or outputs, as well as any other parameters that must be
initialized. While the method of doing so varies for different microcontrollers, almost all of them
require a similar step to configure the microcontrollers internal circuitry to fit the needs of your
design.

Lastly, the “Void Loop ()” section. This section is where the function of your
microcontroller is written. Any actions that require reading or writing values from pins or
computing the values of different variables is done here.

Compiling And Uploading

This step is almost always handled by the IDE. Once your code is written, it must be
uploaded to the microcontrollers. Most have USB interfaces, but some smaller
microcontrollers require a special hardware to be programmed. While we typically program
microcontrollers in higher level languages, the microcontroller itself runs on assembly. To
translate code to a format usable by a microcontroller, a compiler must be used. A compiler is
a software tool that takes higher level code and optimizes it for assembly. Assembly provides
specific instructions to the microcontroller on what register operations to perform to match the
operation of the original code.

Once the assembly code is created, it can be uploaded to the microcontroller for
testing.

Debugging

Not everything will work perfectly on your first attempt. Debugging is an important part
of any design process and programming microcontrollers is no exception. Fortunately, there
are several methods to help you locate errors in your code without excessive effort.

The first most basic method is to hook up your microcontroller to the circuit it is made
to control. Often enough you can see what is wrong simply by observing the output and how
it differs from the intended functionality. This is called black box testing. While this method is
simple and does not require any additional tools, it is also very limited, as no knowledge of the
inner workings of the microcontroller is available. As mentioned previously, most IDE’s contain
debuggers that are able to run the code step by step at the users control while keeping track
of variable and register values so the user can learn exactly what point the program behaves
differently than as intended. This is a form of white box testing and provides much more
information that can be used to deduce the cause of a faulty program.

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 6


Lesson
Basic Robot Movements
2
Robot locomotion is the collective name for the various methods that robots use
to transport themselves from place to place.

Wheeled robots are typically quite energy efficient and simple to control. However,
other forms of locomotion may be more appropriate for a number of reasons, for example
traversing rough terrain, as well as moving and interacting in human environments.
Furthermore, studying bipedal and insect-like robots may beneficially impact on biomechanics.

A major goal in this field is in developing capabilities for robots to autonomously decide
how, when, and where to move. However, coordinating numerous robot joints for even simple
matters, like negotiating stairs, is difficult. Autonomous robot locomotion is a major
technological obstacle for many areas of robotics, such as humanoids (like Honda's Asimo).

Types of Locomotion

1. Walking
Walking robots simulate human or animal gait, as a replacement for wheeled motion.
Legged motion makes it possible to negotiate uneven surfaces, steps, and other areas that
would be difficult for a wheeled robot to reach, as well as causes less damage to
environmental terrain as wheeled robots, which would erode it.
Hexapod robots are based on insect locomotion, most popularly
the cockroach and stick insect, whose neurological and sensory output is less complex than
other animals. Multiple legs allow several different gaits, even if a leg is damaged, making
their movements more useful in robots transporting objects. Examples of advanced running
robots include ASIMO, BigDog, HUBO 2, RunBot, and Toyota Partner Robot.

2. Rolling

In terms of energy efficiency on flat surfaces, wheeled robots are the most efficient.
This is because an ideal rolling (but not slipping) wheel loses no energy. A wheel rolling at a
given velocity needs no input to maintain its motion. This is in contrast to legged robots which
suffer an impact with the ground at heel strike and lose energy as a result.
For simplicity most mobile robots have four wheels or a number of continuous tracks.
Some researchers have tried to create more complex wheeled robots with only one or two
wheels. These can have certain advantages such as greater efficiency and reduced parts, as
well as allowing a robot to navigate in confined places that a four-wheeled robot would not be
able to.
Examples: Boe-Bot. Cosmobot, Elmer, Elsie, Hero, IRobot Create, Irobot’s Roomba,
Johns Hopkins Beast, Land Walker, Modulus robt, Musa, Omnibot, PaPeRo, Phobot,

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 7


Pocketdelta robot, Push the Talking Trash Can, RB5X, Rovio, Seropi, Shakey the robot, Sony
Rolly, Spykee, TiLR, Topo, TR Araña, and Wakamaru.

3. Hopping
Several robots, built in the 1980s by Marc Raibert at the MIT Leg Laboratory,
successfully demonstrated very dynamic walking. Initially, a robot with only one leg, and a very
small foot, could stay upright simply by hopping. The movement is the same as that of a person
on a pogo stick. As the robot falls to one side, it would jump slightly in that direction, in order
to catch itself. Soon, the algorithm was generalized to two and four legs. A bipedal robot was
demonstrated running and even performing somersaults. A quadruped was also
demonstrated which could trot, run, pace, and bound.
Examples:
• The MIT cheetah cub is an electrically powered quadruped robot with passive compliant
legs capable of self-stabilizing in large range of speeds.
• The Tekken II is a small quadruped designed to walk on irregular terrains adaptively.

4. Metachronal motion
Coordinated, sequential mechanical action having the appearance of a traveling wave
is called a metachronal rhythm or wave, and is employed in nature by ciliates for transport,
and by worms and arthropods for locomotion.

5. Slithering
Several snake robots have been successfully developed. Mimicking the way real
snakes move, these robots can navigate very confined spaces, meaning they may one day
be used to search for people trapped in collapsed buildings. The Japanese ACM-R5 snake
robot can even navigate both on land and in water.
Examples: Snake-arm robot, Roboboa, and Snakebot.

6. Swimming
An autonomous underwater vehicle (AUV) is a robot that travels underwater without
requiring input from an operator. AUVs constitute part of a larger group of undersea systems
known as unmanned underwater vehicles, a classification that includes non-
autonomous remotely operated underwater vehicles (ROVs) – controlled and powered from
the surface by an operator/pilot via an umbilical or using remote control. In military applications
an AUV is more often referred to as an unmanned undersea vehicle (UUV). Underwater
gliders are a subclass of AUVs.

7. Brachiating
Brachiation allows robots to travel by swinging, using energy only to grab and release
surfaces. This motion is similar to an ape swinging from tree to tree. The two types of
brachiation can be compared to bipedal walking motions (continuous contact) or running
(richochetal). Continuous contact is when a hand/grasping mechanism is always attached to
the surface being crossed; richochetal employs a phase of aerial "flight" from one surface/limb
to the next.

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 8


8. Hybrid
Robots can also be designed to perform locomotion in multiple modes. For example,
the Bipedal Snake Robot can both slither like a snake and walk like a biped robot.

What’s More

Jumbled Words

Directions: Arrange the jumbled words to come up with the terms discussed in this lesson.

1. INFKWAL 6. MINGMIWS
2. GLINROL 7. CHIABRATING
3. NIPHOPG 8. BYRHID
4. NALORHCATEM NOTIOM 9. COLOTIONMO
5. HESLITRING 10. CHORICHETAL

What I Have Learned

Microcontrollers are a practical, affordable, and flexible solution to many challenges of


circuit design and modern control systems. While details such as the 6software used to
program the microcontroller can vary, the thought process used to program them is universal.

Microcontrollers are everywhere, serving as the invisible computers in our age of digital
electronics and working tirelessly behind the scenes in all areas of our life. Can you count all
of the devices in your immediate surroundings that you rely on that might have a
microcontroller inside? You might be surprised at what you find. These computers have
opened a world of possibilities for new interactions and intelligence in otherwise common and
everyday objects like washing machines, remote controls, power tools, toys, and a whole lot
more. Without microcontrollers, the world we know today would never be possible.

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 9


What I Can Do

ERROR CORRECTION TEST ITEM:

LEARNING COMPETENCY: (U)

Students are expected to be able to:

Most Essential Learning Competency:

Explain downloading programs from the computer to the microcontroller and the
basic robot movements.

Learning Objectives:

1. State and explain the different downloading programs from the computer to the
microcontroller.
2. Identify the basic robot movements.

GENERAL DIRECTIONS:

The following test has been answered for you. Your job is to check the answers for
errors. If there are errors do the following in the table below the test sample:

1. Identify the error. Explain why the answer is wrong.


2. Write a correction of the identified error.
3. Then explain why your correction is right.

ANSWERED TEST WITH ERRORS:


Directions: Read the following statements regarding downloading programs from the computer
to the microcontroller and basic robot movements. Identify the error in the answers
to the corresponding questions. Write your answers on a separate sheet of paper.
Refer to the template of answers on page 11.

Questions Answers
Sample: What is the collective name for the Robot Psychomotor is the collective
various methods that robots use name for the various methods that robots use
to transport themselves from place to place? to transport themselves from place to place.

1. What is a brand of microcontroller 1. Lego is a brand of microcontroller


commonly used amongst hobbyists and commonly used amongst hobbyists and
professionals alike? professionals alike.

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 10


2. What locomotion simulates human or 2. Slithering locomotion simulates human or
animal gait, as a replacement for animal gait, as a replacement for wheeled
wheeled motion? motion.
3. What is an important part of any design 3. Uploading is an important part of any design
process and programming process and programming microcontrollers.
microcontrollers?
4. What is typically programmed in higher- 4. Mini Controller is typically programmed in
level languages such as C++ or Java. ? higher-level languages such as C++ or
Java.
5. What is a motion that is similar to an ape 5. Walking is a motion that is similar to an ape
swinging from tree to tree. swinging from tree to tree.
6. What is a software tool that takes higher 6. C ++ is a software tool that takes higher
level code and optimizes it for assembly? level code and optimizes it for assembly
7. What locomotion allows robots to travel by 7. Hopping allows robots to travel by
swinging, using energy only to grab and swinging, using energy only to grab and
release surfaces? release surfaces.
8. What is a programmable IC, capable of 8. Mica Controller is a programmable IC,
multiple functions depending on how it’s capable of multiple functions depending
programed? on how it is programed.
9. What root is based on insect locomotion, 9. Quadpod Robot is based on insect
most popularly the cockroach and stick locomotion, most popularly
insect, whose neurological and sensory the cockroach and stick insect, whose
output is less complex than other neurological and sensory output is less
animals? complex than other animals.

10. What robot can both slither like a snake 10. Snakebot can both slither like a snake and
and walk like a biped robot? walk like a biped robot.

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 11


Identified Error Correction of Explanation of Correction
Error
Sample: Robot Locomotion Robot locomotion is the collective name
Robot Psychomotor for the various methods that robots use
to transport themselves from place to place.

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Assessment

Directions: Read each item carefully. Choose only the letter of the correct answer and write
it on a sheet of paper. Do not write anything in this module.

1. It is based on insect locomotion, most popularly the cockroach and stick insect, whose
neurological and sensory output is less complex than other animals.
A. Hexapod Robot C. Quadpod Robot
B. Octapod Robot D. Tripod Robot
2. It is a programmable IC, capable of multiple functions depending on how it is programed.
A. Mica Controller C. Milli Controller
B. Microcontroller D. Mini Controller
3. It allows robots to travel by swinging, using energy only to grab and release surfaces.
A. brachiation C. mimicking
B. slithering D. walking
4. It is a software tool that takes higher level code and optimizes it for assembly. .
A. compiler C. programmer
B. downloader D. uploader
5. It is a motion that is similar to an ape swinging from tree to tree.
A. brachiating C. slithering
B. mimicking D. walking

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 12


13 Electronics (Grade 10) Self-Learning Module MELC-Aligned WBLS-OBE
WHAT’S IN
W E R T Y U I O P L J N H G V F D C L
D N B V C X Z A S D F G H J J K L O I
R T Y Y U I O P M H J U K T R H E W A
S D F G H H J K L M N B V C C Y X Z W
E R T Y U I O P L K J H G F D B V C S
J H G F D D S A W E R T Y U I R I O N
R T Y U I O N B R A C H I A T I N G M
O I U Y T R E H O P I N G R E D W V E
V G T Y H N W A L K I N G M J U I U I
O N J N K H Y S L I T H E R I N G Y U
N G H J T R S W I M M I N G U I I M N
M E T A C H R O N A L M O T I O N I O
N U I T B F D S G V E W K D F U I N B
ASSESSMENT JUMBLED WORDS WHAT I KNOW
1. A 1. WALKING 6. SWIMMING 1. A
2. B 2. ROLLING 7. BRACHIATING 2. B
3. A 3. A
4. A 3. HOPPING 8. HYBRID 4. B
5. A 4. METACHRONAL MOTION 9. LOCOMOTION 5. B
5. SLITHEING 10. RICHOCHETAL
Answer Key
References

Foxworth, J. (2019). How to program a microcontroller an application note. Retrieved from


app_note_john_foxworth.docx.pdf

Wikipedia. (June 2021). Microcontroller. Retrieved from


https://en.wikipedia.org/wiki/Microcontroller

Wikipedia. (June 2021). Robot locomotion. Retrieved from


https://en.wikipedia.org/wiki/Robot_locomotion

Wolfram Language & System Documentation Center. (2021). Uploading programs to the
microcontroller. Retrieved from
https://reference.wolfram.com/language/MicrocontrollerKit/tutorial/UploadingProgram
s.html

For inquiries or feedback, please write or call:

Department of Education – Schools Division of Laoag City


Curriculum Implementation Division
Brgy. 23 San Matias, Laoag City, 2900
Contact Number: (077)-771-3678
Email Address: laoag.city@deped.gov.ph

WBLS-OBE MELC-Aligned Self-Learning Module Electronics (Grade 10) 14

You might also like