Grade 10 - STE - Electronics - Robotics - Q4 - Module 5 - Wks5-6 - ADM
Grade 10 - STE - Electronics - Robotics - Q4 - Module 5 - Wks5-6 - ADM
Grade 10 - STE - Electronics - Robotics - Q4 - Module 5 - Wks5-6 - ADM
Electronics
Quarter 4 – Module 5:
Basic Programming Tools Used
in Microcontrollers for Robots
Republic Act 8293, section 176 states that: No copyright shall subsist in any work of
the Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.
Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names,
trademarks, etc.) included in this module are owned by their respective copyright holders.
Every effort has been exerted to locate and seek permission to use these materials from their
respective copyright owners. The publisher and authors do not represent nor claim ownership
over them.
Electronics
Quarter 4 – Module 5:
Basic Programming Tools Used
in Microcontrollers for Robots
Introductory Message
This Self-Learning Module (SLM) is prepared so that you, our dear learners,
can continue your studies and learn while at home. Activities, questions, directions,
exercises, and discussions are carefully stated for you to understand each lesson.
Each SLM is composed of different parts. Each part shall guide you step-by-
step as you discover and understand the lesson prepared for you.
Pre-tests are provided to measure your prior knowledge on lessons in each
SLM. This will tell you if you need to proceed on completing this module or if you
need to ask your facilitator or your teacher’s assistance for better understanding of
the lesson. At the end of each module, you need to answer the post-test to self-check
your learning. Answer keys are provided for each activity and test. We trust that you
will be honest in using these.
In addition to the material in the main text, Notes to the Teacher are also
provided to our facilitators and parents for strategies and reminders on how they can
best help you on your home-based learning.
Please use this module with care. Do not put unnecessary marks on any part
of this SLM. Use a separate sheet of paper in answering the exercises and tests. And
read the instructions carefully before performing each task.
If you have any questions in using this SLM or any difficulty in answering the
tasks in this module, do not hesitate to consult your teacher or facilitator.
Thank you.
What I Need to Know
This module was designed and written with you in mind. It is here to help you
master basic programming tools used in microcontrollers for robots. The scope
of this module permits it to be used in many different learning situations. The
language used recognizes the diverse vocabulary level of students. The lessons are
arranged to follow the standard sequence of the course. But the order in which you
read them can be changed to correspond with the textbook you are now using.
1
What I Know
Directions: Read each question carefully. Choose the letter of the correct answer.
1. What part of the human body can be compared to the microcontroller in robots?
a. Brain
b. Eyes
c. Motor
d. Sensors
2
6. Which microcontroller is a popular programming tool because of its digital
embedded system?
a. Arduino
b. ARM
c. C++
d. MSP
8. What is the name of this modified Harvard architecture machine where programs
and data are stored in a divided physical memory system?
a. ARM
b. AVR
c. MSP
d. PIC
10. What system gathers information from input devices like sensors and programs
the robot to execute and control the output devices such as motors and LEDs?
a. Arduino
b. Microcontroller
c. Microprocessor
d. Raspberry pi
3
Lesson
Basic Programming Tools Used
1 in Microcontrollers for Robots
What’s In
Directions: Complete the following sentences by filling in the correct words to make
them meaningful. You can choose from the given words to help you finish
this task.
1. These are sensors used by robots to estimate their relative position to the
surrounding.
2. It is a sensor that acts as a microphone to detect the equivalent voltage of sound
and sound feedback.
3. It is a sensor that allows the robot to become aware of its surrounding. It can
detect what objects are nearby without physical contact.
4. It is a sensor that broadcasts sound waves at high frequencies.
5. It is a sensor that allows the robot to interpret touch and feel motions.
Guide Questions:
4
What’s New
Now in this activity, we are going to do the same programming but remember
this is only for our activity. Below are the set of pictures that represent the different
commands we want our robot to perform.
STOP
5 mins 3 secs
3 mins 1 min
Turn Turn
STOP Left Right
90 90 Sit Down
5
Activity 1: By Encode!
Direction: Write the program of the given commands by connecting the correct
pictures in a series using an arrow line. Study the example it is done for
you.
Sample command: Walk for 5 minutes, then stop for 3 secs walk 1 minute then
stop.
Answer:
STOP STOP
3 secs
5 mins 1 min
1. Walk for 5 minutes then, stop for 3 secs then, turn 900 right then, stop for 3 secs
then, sit down then, stop.
2. Walk for 3 minutes then, stop for 3 secs then, turn 900 degrees left then, stop for
3 secs then, walk for 3 minutes then, stop.
3. Walk for 1 minute then, stop for 3 secs then, turn right, stop for 3 secs then walk
for 1 minute then, stop.
4. Walk for 1 minute then, stop for 3 secs then, sit down then, stop.
6
What is It
Types of Microcontroller
Different microcontrollers are used for different types of robots. PIC
microcontroller (PIC) means peripheral interface controller. It is a kind of
microcontroller whose components are used in the development of electronics,
computer robotics, and similar devices.
ARM microcontroller (ARM) stands for advanced reduced instruction set
computer (RISC) machine. It is one of the most popular programming digital
embedded systems in the world. Because of its low cost and high-performance device,
this has been used in a wide range of applications such as Industrial Instrument
control systems, wireless networking and sensors, and automotive body systems,
etc.
7
The 8051microcontroller was created by Intel way back in 1981. It was
considered a breakthrough in that era of processing due to the fact of being an 8-bit
microcontroller. It is made with 40 pins DIP (Dual inline package), 4kb of read only
memory (ROM) storage, and 128 bytes of random access memory (RAM) storage and
has a 216-bit timer. It consists of four parallel 8bit ports, which all are
programmable.
AVR microcontroller means Alf and Vegard's RISC Processor. It is a modified
Harvard architecture machine, where program and data are stored in a divided
physical memory system that is placed in different address locations.
MSP microcontroller, MSP stands for Mixed Signal Processor, the MSP is
designed for low cost and low power dissipation embedded systems. The controller's
appearance is directly related to the 16-bit data bus and seven addressing modes.
Due to the decreased instruction procedures, it allows a shorter, denser
programming code to be written for fast performance.
Sometimes a microcontroller is intended to be programmed in a specific code
or language. Examples of these programmed codes are written for Arduino
microcontrollers, which use Arduino software. Basic Stamp microcontrollers use
PBasic program language. Basic Atom microcontrollers integrate with Basic Micro
codes and Javelin Stamp from Parallax is operated by Java for its basic programming
code. Raspberry Pi is another microcontroller that is always compared to the
Arduino. The Raspberry Pi is more of a computer in terms of its processing qualities,
which makes it a lesser choice for some.
A variety of programming languages can be used to program microcontrollers
to perform tasks like moving forward to picking up objects. Here are some of them:
Assembly is a specific style of programming for it should only be used when
you need absolute instruction-level control of your code. It is just one step away from
becoming machine code and as such, it is very laborious to program.
Basic is a program system that is one of the widely used programming
languages in educational robotics. It has evolved into Basic Micro, BasicX, and
Parallax, which are programming languages used by robots.
8
The C/C++ is one of the most
popular program languages due to its
versatility and high-level functionality
while keeping a certain amount of low-
level control. This is an example of a
function program using C++.
Java is widely used as a
computer system program. It is an
upgraded version of C and gives a
greater number of safety features vital
to attain low-level control. Some
manufacturers like, Parallax makes
microcontrollers specifically for use
with Java.
Source: https://rb.gy/jk1cgd
Figure 2: A sample C++ program language.
Source: https://rb.gy/rjrd0x
Figure 3: A sample Arduino program language.
Source: https://rb.gy/pdwpzs
Figure 4: A sample python program language.
9
Another version of
Python is used in
programming the NAO
interactive robot. It uses
plenty of program languages
like C++, MATLAB, and JAVA
to name a few. It integrates
code, pictures, and animation
to make the NAO robot move.
Below is a sample program for
the NAO robot.
Source:https://rb.gy/lobh8w
Figure 5: The python version program language for
the NAO humanoid robot.
What’s More
application parallel
automotive performance
dissipation peripheral
Intel processor
microcontroller programming
Different (1)_______ are used for different types of robots. PIC microcontroller
means (2)________ interface controller. It is a kind of microcontroller whose
components are used in the development of electronics, computer robotics, and
similar devices. ARM microcontroller stands for Advanced RISC Machine. It is one of
the most popular microcontrollers programming digital embedded systems in the
world. Because of its low cost and high-(3)________ device, this has been used in a
wide range of (4)___________such as Industrial Instrument control systems, wireless
networking and sensors, and (5)__________ body systems, etc.
The 8051microcontroller was created by (6)_________ way back in 1981. It was
considered a breakthrough in that era of processing due to the idea of being an 8-bit
microcontroller. It is made with 40 pins DIP (Dual inline package), 4kb of ROM
storage, and 128 bytes of RAM storage and has a 216-bit timer. It consists of four
(7)_________ 8bit ports, which all are programmable.
10
AVR microcontroller means Alf and Vegard's RISC Processor. It is a modified
Harvard architecture machine, where program and data are stored in a divided
physical memory system that is placed in different address locations.
MSP microcontroller, MSP stands for Mixed Signal (8)________, the MSP is designed
for low cost and low power (9)__________ embedded systems. The controller's
appearance is directly related to the 16-bit data bus, and seven addressing modes,
and the decreased instructions set, which allows a shorter, denser (10)_________ code
for fast performance.
Guide Questions:
1. In your own words, how will you describe a microcontroller?
2. What is the role of a microcontroller in robot programming?
3. In your opinion, can robots think on their own? Explain further.
11
Activity 2: Look at us!
Direction: Analyze the two (2) program codes shown below and answer the following
guide questions.
Code A Code B
Source:https://rb.gy/buqbyi Source:https://rb.gy/ec9yjy
Figure 6: Sample code A Figure 7: Sample code B
Guide Questions:
12
Activity 3: Match me!
Directions: Study the statement in Column A that best describes the word in Column
B.
Column A Column B
13
Guide Questions:
1. Do you think that robots can also write their own code? Explain further.
2. Would you agree that we should give robots the autonomy to write their own
programs? Explain further.
3. In your opinion, can robots be more helpful to us if they can think on their own?
Explain further.
Directions: Write TRUE if the statement is correct but if it’s false, write the correct
answer to make the whole statement true.
3. The 8051microcontroller consists of eight parallel 8bit ports, which all are
programmable.
14
What I Have Learned
After learning about microcontrollers and their program languages, choose the
word inside the parenthesis that will make the statement meaningful.
5. Python is one of the most (disliked, popular) scripting languages out there. It is
very simple to learn and can be used to put programs together very fast and
efficiently.
15
What I Can Do
In this activity, you will try and create your program language to be encoded
to your robot and perform a series of tasks and hurdle obstacles. This is a course
from the defense advanced research projects agency (DARPA) Robotics Challenge in
2015. Your robot will need to traverse this obstacle course by using the code that
you will create. The code you will create can be anything you want. You can use any
symbol, letter, number, or picture that will be interpreted by the robot as a command
for it to follow. Write your code in the numbers that indicate each task as seen in the
diagram.
Source:https://rb.gy/6jmnyu
16
Program code table:
Task Your program code Task Your program code
1) Drive utility 6) Turn a valve
vehicle 3600
Guide Questions:
17
Assessment
Directions: Read each question carefully. Choose the letter of the correct answer.
18
7. How many dual inline package (DIP) pins do the 8051microcontroller have?
a. 30
b. 40
c. 50
d. 60
8. Which component is used in computer keyboards, monitors, printers, copiers, fax
machines, and telephone systems.
a. ARM
b. electronics
c. memory
d. microcontrollers
9. Which of the following is used in a range of applications such as industrial
instrument control systems, wireless networking sensors, and automotive
body systems?
a. ARM
b. AVR
c. MSP
d. PIC
10. Which program system is widely used as a programming language in educational
robotics?
a. Arduino
b. Basic
c. Java
d. Parallax
19
Additional Activities
Source: rb.gy/klgeen
Figure 9: The microcontroller crossword puzzle.
Across
2. It stands for the ‘M’ in RAM.
4. It created the 8051 microcontrollers.
7. It is an integrated circuit chip found in personal computers and laptops.
8. It stands as the ‘P’ in the PIC microcontroller.
Down
1.It acts as the brain of the robot.
3.It serves as the power supply of the microcontroller.
5.It is a programming language used in educational robotics.
6. It stands as the ‘S’ in the MSP microcontroller
20
Guide Questions:
1. If you are going to program your robot which programming language are you going
to use? Explain further.
21
22
What’s More (Act.1) What I Know Activity 2:Look at Us!
1.microcontrollers 1.a 6.d Answer mat vary
2.peripheral 2.d 7.b
3.performance 3.c 8.b
4.application 4.c 9.b
Activity 3: Matching Type
5.automotive 5.d 10.b
6.Intel Guide Question Guide Question
7.parallel Answers may vary. 1.e 6.c Answer may vary
8.processor 2.j 7.f
9.dissipation Assessment 1 3.g 8.i
10.programming 1.d 4.a 4.b 9.d
2.b 5.a 5.a 10.h
3.d
What’s In Guide Question:
What I Have Learned 1.a Answer may vary
1.microcontroller 6.upgraded 2.d
2.perform 7.eduactional 3.c
3.brain 8.processing
4.c
4.components 9.forward
5.d
5.popular 10.digital
What I can do: Assessment 3 (Modified TRUE or FALSE)
Answer may vary 1.True
2.True
Assessment Guide Question: 3.four
1. D Answer may vary 4.less
2. b 5.True
3. b
4. b What’s New
5. b
6. a
7. b 1
8. d
9. a 2
10. b
3
Additional Activities: (Act. 1)
Across 4
Y 2. memory
4. Intel
7. microprocessor
8. peripheral
Down
1.microcontroller
3. battery
5. basic
6. signal
Answer Key
References
Cbenson. 2018. ”How to Make a Robot”, How to Make a Robot-Lesson
10:Programming Your Robot, robotshop.com, Accessed 4/2/2021,
https://www.robotshop.com/community/tutorials/show/how-to-make-a-
robot-lesson-10-programming-your-robot
23
24