0% found this document useful (0 votes)
97 views

Electronics Module G10 Q4 Week 5 6 PDF

This document provides information on tools needed for robot construction including mechanical tools like hammers, saws, and drills as well as electronic tools like soldering irons. It discusses specific tools for working with metal, plastic, and electronics. Safety equipment like goggles are also mentioned.
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)
97 views

Electronics Module G10 Q4 Week 5 6 PDF

This document provides information on tools needed for robot construction including mechanical tools like hammers, saws, and drills as well as electronic tools like soldering irons. It discusses specific tools for working with metal, plastic, and electronics. Safety equipment like goggles are also mentioned.
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/ 27

WHOLE BRAIN LEARNING SYSTEM

OUTCOME-BASED EDUCATION

GRADE
Science, Technology and Engineering (STE) Program

ELECTRONICS 10

LEARNING QUARTER 4

MODULE WEEK
5-6

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


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

QUARTER 4
WEEK 5-6

Programmable Tools, NXT Sensors,


and Blocks Used in the NXT
Programming Environment

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 provide you understanding on the knowledge, skills and desirable attitudes required in
the basic robot construction.

In order to benefit much from this module, you should learn about Programmable
Tools, NXT Sensors, and Blocks used for NXT Programming Environment.

Most Essential Learning Competencies:

A. Identify the different programming tools for constructing a robot.


B. Enumerate the different NXT Sensors used for robot construction.
C. Enumerate the blocks used in the NXT programming environment.

Lesson 1 Programming Tools


Lesson 2 NXT Sensors
Lesson 3 Blocks Used in the NXT Programming Environment

What I Know

Directions: Read each statement carefully. Choose only the letter of the correct answer.

1. It is a very useful tool for assembling electronic circuits and connecting copper wires
together.
A. Breadboard C. RJ45 Connector
B. Digital Multimeter D. Soldering Iron

2.It generates different shapes of signals.


A. Digital Multimeter C. Signal Generator
B. Oscilloscope D. Variable Power Supply

3. It is used on UTP network cables.


A. Breadboard C. RJ45 Connector
B. Digital Multimeter D. Soldering Iron

4. It gives your robot a sense of touch.


A. Light Sensor C. Touch Sensor
B. Sound Sensor D. Ultrasonic Sensor

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


5. It lists the function blocks that can be dragged/dropped into the work area.
A. Configuration Panel C. Palette
B. Controller D. Work Area

Lesson
Programming Tools
1
What’s In

CROSSWORD PUZZLE
Directions: Look for the words related to the Blocks used in the NXT Programming
Environment. Write your answers on a separate sheet of paper.

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

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


What’s New

Robots are already doing so much for us, and they are only going to be doing more in
the future. While even basic robotics programming is a tough field of study requiring great
patience, it is also a fascinating and immensely rewarding one.

What is It

You cannot build a robot without at least a few tools. This module will cover some of
the tools and equipment that will be useful.
MECHANICAL TOOLS
For building your robot you will need some tools to form the body.
1. Small vise: This is a device consisting of two parallel jaws for holding a workpiece; one
of the jaws is fixed and the other movable by a screw, a lever, or a cam.
2. Hammer: A hammer is one of the standard tools you will need.
3. Screwdrivers & Wrenches: Two spanners of equal size are required for lock nutting.
4. Saw: Metal and wood saws. Miter saws can be very handy but are pretty expensive. A
miter box might suffice for many purposes.
5. Square, measuring tape, scriber, and other marking out tools.
6. Vernier calipers: Allow very accurate marking out and measurement. Also, they can be
used to check thread pitch on machine screws without a dedicated pitch gauge.
7. Files: They are used especially when working with metal, as rough metal edges are sharp.
8. Centre Punch: Essential for accurate drilling of holes in metal to prevent the drill skating
over the surface.
9. Drill Press: (small tabletop versions suffice) is very handy for drilling accurate holes. Can
also provide the low speeds for drilling large holes in metal, which hand drills cannot do
easily.
10. Hobby Tool: Useful for many purposes.
11. Sharp utility knifes: Mostly used when working with plastics.
12. Hot glue guns: Handy for quickly mounting parts. Not too strong bound, but useful for
many applications.
13. Arc Welder: Only useful when working with thick steel on large projects (use a gas
welding torch for thin metal; arc welders tend to burn holes right through the workpiece).
Aluminum cannot be welded with ordinary welders. (Unless you have a MIG/MAG or TIG
welder available)
14. Paint stripper/Electric Heat Gun: Like a hairdryer on steroids. Useful for bending
plastics, also applying heat-shrink tubing to electric cables at low power.
15. Safety Goggles: You only get one pair of eyes, and machine tools are potentially
dangerous. Safety goggles are essential for using anything other than hand tools.

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


ELECTRONIC TOOLS
Soldering Iron
The soldering iron is a very useful tool for assembling electronic circuits and connecting
copper wires together.
For electronic circuits you will need a light soldering iron (~25W) with a small point
(shaped like a pencil point). Especially SMD components require small points (or even better:
special SMD soldering points).
Soldering electronic components is done with "soft soldering": with a low temperature
(less than 300°C). Usually for electronics the melting point of the solder lays around 238°C.
When buying solder choose for a solder wire (60% lead, 40% tin) with non-corrosive flux.
(There is also "eutectic solder" - 63% lead, 37% tin, which transitions from liquid to solid
immediately, with no plastic state in between.) Take the thinnest wire you can find (<=1mm).
For connecting metal wires, you will need something more powerful (30W-100W) like
a soldering pistol, but an ordinary soldering iron would do just as well. Note: not all materials
are as good to solder. Copper is easy to solder and has a reasonable strong bond. Aluminum
has a weak bond.
For stronger connections it is better to braze instead of soft soldering. Brazing involves
higher temperatures (typical between 450°C and 1000°C) and different flux ("Borax") and
solder (copper and zinc or silver alloys) it also requires a welding torch instead of a soldering
iron.
If you need even more strength, you could use welding. However, welding is only used
for heavy materials like steel alloys, and these are in most cases too heavy to be used in
robots (unless you are building a very big or industrial robot). Aluminum can be welded but it
is not as simple as welding steel alloys.
Breadboard

Figure 1. Breadboard
Source: https://en.wikibooks.org/wiki/Robotics/Design_Basics/Tools_and_Equipment
The boards allow you to build a temporary circuit in no time. Especially handy for
testing new circuits. Connections are made with either ordinary thin stiff wire with the insulation

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


removed at the ends or with special breadboard wires with stronger tips. Wires with crocodile
clamps are needed for hooking up signal generator, oscilloscope, DMM, etc. Larger boards
have connectors (typically banana plugs) for the power supply.
There are small breadboards with an adhesive strip at the bottom. These can be
mounted on an empty part of a microcontroller board and can be used to build small circuits.

• Note: when you build a sensitive analog circuit on a breadboard, it can behave
differently than when it is built as a PCB. This is because of parasitic components:
the wires connecting the components on the board act as a combination of a
resistor, capacitor, and coil (all with very low values). Keep in mind that in some
circumstances this can affect the working of a circuit. Usually this is only a problem
when working with low amplitudes and/or high frequencies.

Electronic Equipment

Figure 2. Digital Multimeter


Source: https://en.wikibooks.org/wiki/Robotics/Design_Basics/Tools_and_Equipment

• Multimeter: measures voltage, current & resistance. Many can measure transistor and
diode characteristics, frequency, and capacity. Some can measure temperature or light
intensity.
o Note: measuring voltage and current of an AC source is not as simple as measuring DC
levels. But since robots rarely use AC, this would be out of the scope.

• Oscilloscope: makes an electric signal visible. Very useful when working with more
complicated electronic circuits, especially analog signals, and data communication.
Oscilloscopes exist as stand-alone devices or as add-on modules for PCs. The latter
provides extra abilities like spectrum analyzing and recording of signals.

• Variable power supplies: power supplies with variable output. Either AC or DC. Either the
output voltage or current can be regulated, although most power supplies let you set a max
current.

• Signal generators: generates different shapes of signals (sine, square, saw and triangle),
with variable frequency (1Hz up to 100MHz) and amplitude.

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


• Logic probe: pen-like devices that detect logic levels (either TTL or CMOS). Most can detect
pulse signals. Very handy when working with digital electronic circuits.

• Frequency meters: measures the frequency of a signal. Can also be used as a pulse
counter. Oscilloscopes can be used for measuring frequency, and storage scopes can
freeze a waveform onscreen allowing pulses to be manually counted, but frequency
meters are a good investment if this needs to be done very often.

• LEDs: An underrated test device for digital circuits. LEDs are far better than voltmeters for
digital circuits in some situations, as you can see many input and output values
concurrently, without connecting a multitude of voltmeters or constantly checking
everything with a logic probe. In particular, they can instantly show the status of several
logic signals simultaneously, impossible with a logic probe. Good breadboard building
practice also includes an LED for each breadboard to show it is powered up correctly - this
can help avoid the potentially frustrating situation of faultfinding a logic circuit that is
actually sound but has an intermittent or noisy power supply. It's also an excellent indicator
if a component is short-circuiting at any time during operation, as the LED will likely dim or
go out.

Connectors
- Insulation Displacement Connectors (IDC)
Assembling parallel ribbon cables from ribbon and the IDC connectors:
Practical Tips:
1. Note that IDC ribbon cable is usually not provided with multicolored or ‘rainbow’ insulation,
but with single-color insulation — usually grey or white. However, it also has a stripe of
colored ink or paint (red or black) down one side, to guide you with connector orientation.
If you need to strip away some of the wires of a multi-way cable to suit the IDC connectors
you are using, remove them from the side furthest from the ink stripe so it’s still present on
the cable.
2. It’s usual to fit IDC connectors to the cable so their pin 1 end is on the stripe side of the
ribbon. This also helps guide you when you are mating the cable connectors with those on
the equipment, knowing that the stripe corresponds with pin 1.

2. Before clamping an IDC connector to a ribbon cable, make sure that the cable grooves are
aligned with the contact jaw tips and that they are also aligned with the scallops molded
into the underside of the clamping strip.

3. Make sure too that the connector pin/jaw axis is as close as possible to 90° with respect to
the ribbon cable wire axes. If the connector/ribbon angle is not close to 90°, some
connections may not be made properly. If the connector is being fitted at the end of a ribbon
cable, cutting the end of the ribbon cleanly square first will allow you to use it as a guide.

4. Try to squeeze the IDC connector and its clamping strip together as evenly as possible, so
they remain as close as possible to parallel with each other during the operation. This too
ensures that all joints are made correctly. The easiest way to squeeze them together evenly
is by using a small machine vice or a special compound-action clamping tool.

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


5. If an IDC connector has a second cable clamping strip, do not attempt to fit this as part of
the main assembly. Assemble the main parts of the connector first on the ribbon cable, and
only then fit the second clamping strip.

6. When you are bending the ribbon cable around before fitting the second clamping strip, do
not pull it hard. This may loosen some of the connections inside the IDC connector. Just
bend the ribbon around gently — a small amount of slack won’t do any harm and may in
fact protect the IDC connections from strain.

Practical Uses:
A common IDC cable in use is an IDC D9 socket to IDC 2 by 5 header socket. This
cable is often used to connect a PC serial (RS232) port to a microcontroller development
board. On the board there will be a 2 by 5 pin header.

RJ45 Network Connector

Figure 3. RJ45 Connector


Source: https://en.wikibooks.org/wiki/Robotics/Design_Basics/Tools_and_Equipment

These are the connectors used on UTP network cables. A smaller version (RJ11) is
used for telephones. You need a crimping tool to attach the connector to the cable. These
connectors are very useful for hooking up different PCB with each other. A good use for RJ45
connectors is for making serial (RS232) programming cables for small embedded systems
(many credit card terminals use a DB9 to RJ45 cable to download software from a PC during
development). If you are building small, embedded controller boards an RJ45 can be a handy
connector size to use.

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


Lesson
NXT Sensors
2
The Touch Sensor gives your robot a sense of touch. The Touch Sensor detects when
it is being pressed by something and when it is released again.

Suggestions: You can use the Touch Sensor to make your robot pick up things: a
robotic arm equipped with a Touch Sensor lets the robot know whether or not there is
something in its arm to grab. Or you can use a Touch Sensor to make your robot act on a
command. For example, by pressing the Touch Sensor you can make your robot walk, talk,
close a door, or turn on your TV.

The Sound Sensor can detect both decibels [dB] and adjusted decibel [dBA]. A decibel
is a measurement of sound pressure.

dBA: in detecting adjusted decibels, the sensitivity of the sensor is adapted to the sensitivity
of the human ear. In other words, these are the sounds that your ears are able to hear.

dB: in detecting standard [unadjusted] decibels, all sounds are measured with equal
sensitivity. Thus, these sounds may include some that are too high or too low for the human
ear to hear.

Figure 4. Touch Sensor Figure 5. Sound Sensor


Source: http://www.legoengineering.com/nxt- Source: http://www.legoengineering.com/nxt-
sensors/ sensors/

The Sound Sensor can measure sound pressure levels up to 90 dB – about the level
of a lawnmower. Sound pressure levels are extremely complicated, so the Sound Sensor
readings on the MINDSTORMS NXT are displayed in percent [%]. The lower the percent the
quieter the sound. For example:

• 4-5% is like a silent living room


• 5-10% would be someone talking some distance away
• 10-30% is normal conversation close to the sensor or music played at a normal
level
• 30-100% are people shouting or music being played at a high volume

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


The Light Sensor is one of the two sensors that give your robot vision [The Ultrasonic
Sensor is the other]. The Light Sensor enables your robot to distinguish between light and
dark. It can read the light intensity in a room and measure the light intensity of colored
surfaces.

Suggestions: You can use the Light Sensor to make a burglar alarm robot: when an
intruder turns on the light in your room the robot can react to defend your property. You can
also use the Light Sensor to make a line-following robot or a robot that can sort things by color.

Figure 6. Light Sensor Figure 7. Ultrasonic Sensor


Source: http://www.legoengineering.com/nxt- Source: http://www.legoengineering.com/nxt-
sensors/ sensors/

The Ultrasonic Sensor is one of the two sensors that give your robot “vision” [The Light
Sensor is the other]. The Ultrasonic Sensor enables your robot to see and detect objects. You
can also use it to make your robot avoid obstacles, sense and measure distance, and detect
movement. The Ultrasonic Sensor measures distance in centimeters and in inches. It is able
to measure distances from 0 to 255 centimeters with a precision of +/- 3 cm.

The Ultrasonic Sensor uses the same scientific principle as bats: it measures distance
by calculating the time it takes for a sound wave to hit an object and return – just like an echo.
Large sized objects with hard surfaces return the best readings. Objects made of soft fabric
or that are curved [like a ball] or are very thin or small can be difficult for the sensor to detect.

* Note that two or more Ultrasonic Sensors operating in the same room may interrupt each
other’s readings.

Figure 8. Servo Motor / Rotation Sensor


Source: http://www.legoengineering.com/nxt-sensors/

Each motor has a built-in Rotation Sensor. This lets your control your robot’s
movements precisely. The Rotation Sensor measures motor rotations in degrees or full
rotations [accuracy of +/- one degree]. One rotation is equal to 360 degrees, so if you set a
motor to turn 180 degrees, its output shaft will make half a turn.

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


Lesson
Blocks Used in the NXT
3 Programming Environment
NXT-G v2.0 is a graphical programming environment that comes bundled with the
NXT. With careful construction of blocks and wires to encapsulate complexity, NXT-G can be
used for real-world programming. Parallel "sequence beams" are actually parallel threads, so
this software is quite good for running a handful of parallel sense/respond loops (example:
wait 60 seconds, play a "bonk" sound at low volume if battery is low, loop), or blending
autonomous control with Bluetooth or other "remote control". The language supports virtual
instruments for all Lego branded and most 3rd party sensors/components. Version 2.0
contains new tutorial challenges, a remote control, custom graphics and sound designers, and
new Lego color sensor support.

What is the interface of NXT-G like?


The figure below shows the NXT-G development environment.

Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-
mindstorms-nxt?code_lg=lg_fr

• The palette lists the function blocks that can be dragged/dropped into the work area;
• The work area is where your program is designed;
• The configuration panel presents the settings that you can adjust when you select a
block in the work area;
• The controller is used to compile the program and transfer it to the robot (by USB
connection or Bluetooth);
• The Robot Center is the place where the tutorials are to be found allowing you to build
and program one of the 4 main categories of robot that can be constructed using Lego

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


Mindstorms NXT (vehicles, robot arms, animals and humanoids). These tutorials
behave like videos, allowing you to produce your first programs step by step in a very
instructive way. A second tab is available in this space, giving access to the Lego portal
where you will be able to visit forums, download additional sounds for your robot, etc.;
and
• The online help contains all the support you need to use the interface.

Programming Principles of NXT-G

Programming using NXT-G is entirely graphical. No programming knowledge is


required to produce advanced programs using NXT-G. Strictly speaking, you will not create
any lines of code using NXT-G. By default, the work area only shows a starting point. From
this starting point, you drag and drop one of the boxes from the palette. The blocks are added
one after the other on an axis termed the sequence beam.

Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-
mindstorms-nxt?code_lg=lg_fr

Blocks that are not connected to a sequence beam are not taken into account by the
program. It is possible to build a design running more than one program sequence in parallel.
To do this, additional sequence beams can be created from the starting point, as shown in the
following figure.

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


Source: https://www.generationrobots.com/en/content/61-nxt-g-
programmation-lego-mindstorms-nxt?code_lg=lg_fr

The Blocks Available in NXT-G

NXT-G is supplied with 35 blocks. Additional blocks can be downloaded from the
internet, and you can also create your own block. When a non-standard sensor is purchase
(e.g., the CMUCam webcam), the sensor is supplied with a CD containing an additional block
making it possible to configure and interact with the sensor.

The blocks can be divided into 7 main families, as per the NXT-G help.

1. Common blocks
2. Action blocks
3. Sensor blocks
4. Flow blocks
5. Data blocks
6. Advanced blocks
7. Customized blocks

It is easy to see from this list that the palette of programs that can be created using
NXT-G is very large. Let us take a quick look at the blocks available.

Block Description
“Display” block

This NXT-G block is used to display a text on the LCD screen of the NXT
intelligent brick.

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


“Loop” block
This NXT-G block is used to create a loop in your program, thus allowing you
to repeat the same series of actions several times, while certain conditions
are not met.

“Motor” block

This NXT-G block is used to activate a servo motor. It is possible to indicate


the direction, speed and duration of rotation.

“Sound” block

This NXT-G block is used to play a sound (a beep, a series of different


recorded tones or a sound file) from the NXT intelligent brick.

“Switch” block

This NXT-G block is used to create conditions in your program and thus only
perform certain actions if specific conditions are met.

“Rotation
sensor” block

This NXT-G block is used to determine the number and/or angle of rotation
performed by a servo motor.

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


“Ultrasonic
sonar sensor”
block

This NXT-G block is used to interact with the ultrasonic sonar sensor and thus
detect obstacles and their distance from the robot.

“Light sensor”
block
This NXT-G block is used to interact with the light sensor and thus determine
the quantity of light received by the sensor.

“Sound sensor”
block

This NXT-G block is used to interact with the sound sensor and thus
determine the intensity of the sound reaching the sensor.

“Touch sensor”
block

This NXT-G block is used to interact with the touch sensor and thus determine
if the sensor has been pressed or released.

“Compare”
block

This NXT-G block is used to make logical comparisons in your program.

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


“Maths” block

This NXT-G block is used to carry out basic calculations such as addition,
subtraction, multiplication and division.

“Bluetooth
receive
message” block
This NXT-G block is used to process messages received by Bluetooth. There
is also a block allowing you to send messages via Bluetooth. Using Bluetooth
wireless communication technology, your robot can communicate with your
PC or other Lego Mindstorms NXT robots.

“Timer” block

This NXT-G block is used to manage a timer.

“Variable” block

This is a very useful NXT-G block that is used to create and manipulate
variables in your program.

Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-
mindstorms-nxt?code_lg=lg_fr

A First Program Using NXT-G

The first program using NXT-G we are going to design here is relatively simple. It uses
the sound sensor and displays the sound level (as a percentage of the sensitivity of the sensor)
on the screen of the robot’s intelligent brick.

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


The final program using NXT-G is illustrated in the following diagram:

Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-
mindstorms-nxt?code_lg=lg_fr

We are going to build this program step by step.


Click on New in the File menu. This creates a new program with a blank work area.
For greater ease, use the entire palette (click on the second tab at the bottom left, in the
vertical tool bar).

Open the list of “Sensor” blocks and drag the sound sensor to the sequence beam as
shown in the figure below:

Source: https://www.generationrobots.com/en/content/61-nxt-g-
programmation-lego-mindstorms-nxt?code_lg=lg_fr

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


In the list of “Advanced” blocks, drag the “Number as text” block as shown in the
following step.

Source: https://www.generationrobots.com/en/content/61-nxt-g-
programmation-lego-mindstorms-nxt?code_lg=lg_fr

Now that you have got the idea, repeat this operation to place the following blocks in
order on the sequence beam:

• The “Variable” block, which you will find in the list of “Data” blocks. In the configuration
panel for this block, select the text type variable and ensure the “Write” button is
checked. This tells our program that the variable we are going to use is a write variable;
• The “Text” block, which you will find in the list of “Advanced” blocks;
• The “Display” block, which you will find in the list of “Action” blocks. From the drop-
down list shown in the configuration panel, select “Text”. This tells the block to expect
to display text data; and
• The “Wait” block, which you will find in the list of “Flow” blocks. This block is used to
indicate the time between two measurements (we will leave it at 2 seconds by default).

Put this entire sequence into a loop so that the program will repeat several times and
you will consequently obtain measurements at regular intervals. To do this, drag a “Loop”
block from the list of “Flow” blocks and then move all the blocks in the work area inside the
loop, keeping them in order and ensuring that they remain on the sequence beam, (remember
that a block that is not on a sequence beam attached to the start point will not be interpreted
by the program, although this will not generate an error).
By default, the loop is set to “Forever”. This means that the program will run indefinitely
until you stop it by pressing one of the buttons on the intelligent brick. If you wish, you can
change this by clicking on the loop and entering a set a number of display iterations in the

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


configuration panel for the loop block (the configuration panel updates automatically according
to the block you have just clicked on). If you only want to display 10 measurements, select
“Counter” in the drop-down list and enter 10 in the “Count” space that appears below.

At this stage, your program looks like the figure below.

Source: https://www.generationrobots.com/en/content/61-nxt-g-
programmation-lego-mindstorms-nxt?code_lg=lg_fr

You now need to link the blocks so that they pass data to each other.

To exchange information, the blocks use data wires. Data wires are used to pass data
from one block to another. The color of the data wire determines the type of data:

• Numerical data is transmitted by yellow wires.


• Logical data (Booleans) is transmitted by green wires.
• Text data is transmitted by orange wires.

If your wire is grey, this means that the input port is expecting a value of a type that is
not the type defined by the output port on the first block. This is termed a broken wire. Broken
wires are therefore errors in your program.

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


The following figure tells you a little more about data hubs and wires in NXT-G:

Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-
lego-mindstorms-nxt?code_lg=lg_fr

Now that you know now a little more and you have practiced opening data hubs and
drawing data wires between blocks, let’s finish our program.

Go back to the first figure in this paragraph and draw data wires between the correct
ports. Remember that a grey dotted data wire tells you that you have made a mistake. Only
colored wires are correct.

Here are a few comments on these data wires. We have numbered them for clarity.

Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-
mindstorms-nxt?code_lg=lg_fr

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


1. This first wire is used to send the sound level read by the sound sensor to the block
that will convert the numerical value into a text value. The first block therefore uses a
yellow wire (the value read is numerical). The block that transforms the number into
text is correctly expecting a yellow wire.
2. The second wire sends the measurement thus converted into text (consequently
resulting in an orange wire) to a text variable.
3. The variable populated in this way is stored in the memory (it is extracted from the
variable) by means of the text block and the orange wire.
4. Finally, the last data wire sends the variable read to the Display block, which will display
the value on the screen of the NXT intelligent brick.

Save your work and then test it on your Lego Mindstorms NXT robot by clicking on the
“Download and run” button in the center of the controller.

What’s More

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

1. YAPLISD CLOBK 6. TARIONTO SNEORS KCOLB


2. POLO KCOLB 7. TIGLH OSRENS BOCKL
3. OMROT BOLKC 8. DOUNS RONSRE LBOCK
4. DOUNS CLOBK 9. CHOUT ROSENS BCLOK
5. THICSW BOCLK 10. REPAMOC LBOCK

What I Have Learned

Programming involves more than entering in code, but it includes the decision as to
what features or robot behaviors are desired/needed.
NXT-G v2.0 is a graphical programming environment that comes bundled with the
NXT. With careful construction of blocks and wires to encapsulate complexity, NXT-G can
be used for real-world programming.

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


What I Can Do

ERROR CORRECTION TEST ITEM:

LEARNING COMPETENCY: (U)


Students are expected to be able to:

Most Essential Learning Competencies:


Lesson 1: Identify the different programming tools for constructing a robot.
Lesson 2: Enumerate the different NXT Sensors used for robot construction.
Lesson 3: Enumerate the blocks used in the NXT programming environment.

DIRECTIONS: The following test has been answered for you. However, there are incorrect
answers. Your job is to identify the errors and accomplish the table below the test sample by
following these steps:

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 the basic robot construction. 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 23.

Questions Answers
Sample: What is a very useful tool for Oscilloscope is a very useful tool for
assembling electronic circuits and connecting assembling electronic circuits and
copper wires together? connecting copper wires together.
1. What is a very useful NXT-G block that is 1. Touch Sensor Block is a very useful NXT-
used to create and manipulate variables in G block that is used to create and manipulate
your program? variables in your program.

2. What NXT-G block is used to make logical 2. Switch Block is used to make logical
comparisons in your program? comparisons in your program.

3. What NXT-G block is used to create 3. Compare Block PWM is used to create
conditions in your program? conditions in your program.

4. What NXT-G block is used to carry out 4. Ultrasonic Sensor Block is used to carry
basic calculations such as addition, out basic calculations such as addition,
subtraction, multiplication and division? subtraction, multiplication and division.

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


5. What is one of the two sensors that give 5. Sound Sensor is one of the two sensors
your robot a vision? that give your robot a vision.

6. What part of the NXT-G interface presents 6. Controller presents the settings that you
the settings that you can adjust when you can adjust when you select a block in the
select a block in the work area? work area.

7. What part of the NXT-G interface where 7. Palette is where your program is
your program is designed? designed.

8. What part of the NXT-G interface is the 8. Work area interface is the place where
place where the tutorials are to be found the tutorials are to be found allowing you
allowing you to build? to build.

9. What makes an electric signal visible? 9 Variable Power Supply makes an electric
signal visible.

10. What part of the NXT-G interface is used 10. Configuration Panel is used to compile
to compile the program and transfer it to the program and transfer it to the robot.
the robot?

Correction of
Identified Error Explanation of Correction
Error
Soldering Iron is a very useful tool for
Sample:
Soldering Iron assembling electronic circuits and connecting
Oscilloscope
copper wires together.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

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


Assessment

Directions: Read each statement carefully. Choose the letter of the correct answer.

1. It contains all the support you need to use the interface.


A. Controller C. Palette
B. Online Help D. Robot Center

2. It is used to compile the program and transfer it to the robot.


A. Controller C. Palette
B. Online Help D. Robot Center

3. This is a very useful NXT-G block that is used to create and manipulate variables in your
program.
A. Compare Block C. Switch Block
B. Motor Block D. Variable Block

4. This NXT-G block is used to make logical comparisons in your program.


A. Compare Block C. Switch Block
B. Motor Block D. Variable Block

5. This NXT-G block is used to create conditions in your program.


A. Compare Block C. Switch Block
B. Motor Block D. Variable Block

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


Answer Key

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


References
Online Sources:

https://en.wikibooks.org/wiki/Robotics/Design_Basics/Tools_and_Equipment

https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-mindstorms-
nxt?code_lg=lg_fr

http://www.legoengineering.com/nxt-sensors/

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) 26

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