Electronics Module G10 Q4 Week 5 6 PDF
Electronics Module G10 Q4 Week 5 6 PDF
OUTCOME-BASED EDUCATION
GRADE
Science, Technology and Engineering (STE) Program
ELECTRONICS 10
LEARNING QUARTER 4
MODULE WEEK
5-6
QUARTER 4
WEEK 5-6
Development Team
In order to benefit much from this module, you should learn about Programmable
Tools, NXT Sensors, and Blocks used for 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
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
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.
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
• 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
• 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.
• 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.
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.
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.
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.
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:
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.
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.
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.
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
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.
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.
“Motor” block
“Sound” block
“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.
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 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
“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
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.
Source: https://www.generationrobots.com/en/content/61-nxt-g-programmation-lego-
mindstorms-nxt?code_lg=lg_fr
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
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
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:
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.
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
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.
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.
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:
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.
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.
Directions: Read each statement carefully. Choose the letter of the correct answer.
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
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/