Grade 8 Structures & Mechanisms
Lesson Summary: Students will create an interactive simulation that demonstrates mechanical advantage.
Curriculum Expectations: These expectations are intended to highlight the many ways in which this lesson could support
the curriculum. It is neither expected nor necessary for teachers to address all of these expectations at once. Teachers
are encouraged to select the most relevant expectations based on their unique context and intentions for the lesson.
Science & Technology
Mathematics
Language - Writing
Overall Expectations
A2. use coding in investigations and
to model concepts, and assess the
impact of coding and of emerging
technologies on everyday life and in
STEM-related fields
A3. demonstrate an understanding of
the practical applications of science
and technology, and of contributions
to science and technology from
people with diverse lived experiences
D2. demonstrate an understanding of
different types of systems and the
factors that contribute to their safe
and efficient operation
Specific Expectations
A2.1 write and execute code in
investigations and when modelling
concepts, with a focus on automating
large systems in action
A2.2 identify and describe impacts of
coding and of emerging technologies,
such as artificial intelligence systems,
on everyday life, including skilled
trades
A3.3 analyse contributions to science
and technology from various
communities
D2.4 use the scientific
terms displacement, force, work, ener
gy, and efficiency to describe
everyday experiences
D2.5 demonstrate an understanding
of the relationships between work,
force, and displacement in simple
systems
D2.6 explain the relationship
between input and output forces and
determine the mechanical advantage
of various mechanical systems,
including simple machines
Overall Expectations
C3. solve problems and create
computational representations of
mathematical situations using coding
concepts and skills
Specific Expectations
C3.1 solve problems and create
computational representations of
mathematical situations by writing
and executing code including
code that involves the analysis of
data in order to inform and
communicate decisions
C3.2 read and alter existing code
involving the analysis of data in order
to inform and communicate
decisions, and describe how changes
to the code affect the outcomes and
the efficiency of the code
Overall Expectations
1. Generate, gather, and organize
ideas and information to write for an
intended purpose and audience
2. draft and revise their writing, using
a variety of informational, literary,
and graphic forms and stylistic
elements appropriate for the purpose
and audience;
Specific Expectations
1.1 identify the topic, purpose,
audience, and form for writing
1.2 generate ideas about a potential
topic, using a variety of strategies and
resources
1.3 gather information to support
ideas for writing in a variety of ways
and/or from a variety of sources
1.4 sort ideas and information for
their writing in a variety of ways
2.1 write short texts using a variety of
forms
2.3 use words and phrases that will
help convey their meaning as
specifically as possible
2.4 vary sentence structures and
maintain continuity by using joining
words (e.g., and, or) to combine
simple sentences and using words
that indicate time and sequence to
link sentences
3.4 use punctuation to help
communicate their intended
meaning, with a focus on the use of:
quotation marks to indicate direct
speech; commas to mark
grammatical boundaries within
sentences; capital letters and final
punctuation to mark the beginning
and end of sentences
3.8 produce pieces of published work
to meet identified criteria based on
the expectations related to content,
organization, style, use of
conventions, and use of presentation
strategies
Breaking Down the Coding Expectations in Science & Technology:
In the Grade 8 Science & Technology curriculum, there are 2 coding related expectations:
A2.1 write and execute code in investigations and when modelling concepts, with a focus on automating large
systems in action
A2.2 identify and describe impacts of coding and of emerging technologies, such as artificial intelligence
systems, on everyday life, including skilled trades
To paraphrase these expectations and express them in plainer language, students are being asked to:
write code to demonstrate a science-related concept, focusing on writing code that includes elements of
automation
show how coding impacts our lives
Both expectations will be addressed through the project.
Learning Goals: We are learning to write code to create an interactive simulation that demonstrates mechanical
advantage.
Success Criteria:
1. I can use conditionals to respond to data in my code
2. I can use user input to influence the progression of my code
3. I can use variables to store and process data in my code
4. I can represent the relationship between input and output forces on mechanical advantage
STEM Profile:
A systems engineer is someone who studies and designs how to design, integrate
and manage complex systems. This is used across many different fields, but is
commonly used in aerospace engineering.
Ave Kludze is a Ghanaian-American who is a senior Spacecraft Systems Engineer
at NASA. Although he never achieved his childhood dream of becoming a pilot,
he is now developing and flying spacecraft for NASA using his knowledge of
complex systems. Lovingly known as “Africa’s Rocket Man”, he wants to share
his childhood love of science with more youth across the African continent.
Like Ave, we will be exploring systems in action to better understand how they
work and what forces are at play. Let’s get started!
Minds On:
1. Students will have different experience levels when it comes to coding.
a) If students have never experienced coding before, please watch the “What is Coding?” video.
b) If students have experienced coding before, have a quick discussion in which students share their definition
of coding. Some responses to look for include:
i. Coding is the language that computers speak
ii. Coding is how we talk to computers or get computers to do what we want
iii. Coding is the instructions that we give to a computer
2. In small groups or as a whole class, brainstorm with students to generate ideas and key concepts that should be
represented in their simulation. Some sample prompts include:
o What is force? What is mechanical advantage?
o How are force and mechanical advantage at play in a simple machine like a lever?
o How does the location of the fulcrum affect the forces and mechanical advantage in a lever?
Planning Our Project:
Introduce the idea of a flowchart, a type of diagram that shows the sequence of steps involved in performing an
algorithm, with specific symbols used to represent different control structures. The symbols used in a flowchart are:
Oval - used to show the beginning and end of the program
Parallelogram - used to represent input or output
Rectangle - used to show processing (i.e., calculating or
manipulating data)
Diamond - used to show decisions (i.e., conditionals)
Lines and arrows - used to connect the shapes to show the
direction of the steps and to represent loops
Text and labels - included with shapes, as necessary.
Since every student’s project will be different, so will the flowcharts that they
create and the tools or technologies from which they can choose to create
their flowcharts (i.e., pen and paper, dedicated apps and websites for
creating flowcharts). A sample flowchart has been provided below to give a
general sense of what the end product may look like.
Creating Our Project:
The sample code demonstrate how the project might work and please note that there is code written in all three sprites
and the stage. For your reference, Scratch determines where to display sprites and controls movement using a Cartesian
coordinate system, with (0,0) being the center of the screen and it may be helpful to pre-teach this concept, if it is one
with which students are unfamiliar.
Part 1: Create the Title Screen & Start Button
1. Create a backdrop using the paint editor that will serve as a title slide with instructions on how the simulation will
work (i.e. to press the spacebar to test if the mechanical advantage is sufficient to lift the object). Also create a
blank backdrop that will be used after the start screen.
2. In the stage, use the When Green Flag Clicked block and the Switch Backdrop To () block to ensure that at the start
of the simulation users always begin on the title slide.
3. Delete the default Cat sprite and create a new sprite that will serve as the start button for the game. You can:
a. Use the “Choose a Sprite” option and select one of the pre-designed button sprites available in Scratch.
b. Upon adding the sprite, edit the costume of that sprite using the text tool to add a word or phrase like “Start”.
4. In the code for the start button, use the When Green Flag Clicked block and the Show block so that the button will
always appear at the start of the simulation.
5. Still in the code for the start button, add the When This Sprite Clicked event block, the Switch Backdrop To () block,
and the Hide block. Set the Switch Backdrop To () block to match the name of your blank backdrop. This will make
it so that clicking the start button will cause the simulation to advance and the start button to disappear once the
simulation begins.
Part 2: Create the Lever/Object to Be Lifted and the Fulcrum
1. Create a custom sprite using the paint editor that will serve as both the lever and the object to be lifted. Use the
rectangle tool to create a long, thin rectangle that will cover most of the screen. Add some kind of object near the
right-hand side of the rectangle to serve as the object that will appear to be lifted.
2. Use the pre-designed Ball sprite available within Scratch to serve as the fulcrum. Resize the sprite in the Sprite Pane
if necessary to compliment the size of your lever sprite.
Part 3: Create the Variables
1. Create 4 new variables in the orange Variables menu, named: Force In, Force Out, Fulcrum Location, and Mechanical
Advantage, and deselect the checkbox next to the Force Out variable so it does not appear on screen.
2. Right click on the Force In and Fulcrum Location variables as they appear on the stage and change them both to a
sliding variable. The Mechanical Advantage variable should NOT be changed to a slider.
3. Right click on the Fulcrum Location variable again to change the slider range.
a. The range will need to be set depending on the length of the “lever” you created in Part 2.
b. You can click and drag the Fulcrum sprite to determine the coordinates of each end of the lever.
c. To make the simulation look more realistic, your Fulcrum Location variable should be set to 10 less than
the X coordinates of each end of the lever (i.e., in the sample code provided, the lever ends are at
approximately -180 and 180, so the Fulcrum Location slider range is set to -170 and 170).
Part 4: Set the Variable Values
1. In the stage, add a Forever loop under the Switch Backdrop To () block that should already be there from Part 1.
The next steps should all be inside of that loop.
2. To allow the fulcrum to move almost to the end of the lever (but not quite), as well as to compare the input and
output lengths of the lever to determine mechanical advantage, use a Set () to () block from the orange variables
menu and set the variable name to Mechanical Advantage.
a. In the blank space, add a () / () block.
b. In the first and second blank space of the () / () block, add () + () and a () () blocks, respectively.
c. In the () + () block, add the block for the Fulcrum Location variable into the first blank space. Type the
number 175 in the second blank space.
d. In the () () block, type the number 175 in the first blank space. Add the Fulcrum Location variable in the
second blank space.
e. You should end up with the statement: Set Mechanical Advantage to (Fulcrum Location) + 175 / 175 -
(Fulcrum Location)
f. The numbers 175 and -175 were used based on both the length of the level sprite in the sample code and
the fact that the Fulcrum Location variable has a maximum range of -170 and 170. You may need to adjust
these numbers based on the size of the sprites in your own project.
3. Use another Set () to () block from the orange variables menu and set the variable name to Force Out.
a. Inside the blank space add a () * () block
b. Add the block for the Mechanical Advantage variable in the first blank space.
c. Add the block for the Force In variable in the second blank space.
d. You should end up with the statement: Set Force Out to Mechanical Advantage & Force In
e. This section will determine the output force based on the input force chosen by the user with the variable
slider and the mechanical advantage calculated in the previous step.
Part 5: Program the Fulcrum
1. To make it so that changing the value of the Fulcrum Location variable, using the slider, will cause the actual fulcrum
sprite to move accordingly, add a When Green Flag Clicked block and place a Hide block underneath to ensure that
the sprite does not appear on screen during the title slide.
2. Add a When Backdrop Switches To () block and set it to the name of your blank backdrop.
3. Add a Show block and a Forever block.
4. Inside the Forever block, add a Go To X () Y () block.
a. Set the X coordinate to the Fulcrum Location variable.
b. Set the Y value to a coordinate that is underneath your lever sprite so that it still appears to be touching
the lever (i.e., in the sample code, this value is -100).
Part 6: Program the Lever & Object
1. Add a When Green Flag Clicked block and place a Hide block underneath to ensure that the sprite does not appear
on screen during the title slide.
2. Add a When Backdrop Switches To () block and set it to the name of your blank backdrop.
3. Add a Show block and a Go To X () Y () block. Set the coordinates to the desired position of your sprite. In the sample
code, this is Go To X (0) Y (-35).
4. Add a Point in Direction block and set to 90.
Part 7A: Check if Enough Mechanical Advantage (cont’d from part 6)
1. To allow the user to continuously change the values of the Force In and Fulcrum Location variables, add a Forever
block.
2. To provide users with enough time to adjust the sliders for the variables and then check to see if there is sufficient
mechanical advantage, add an If () Then block inside of the Forever block.
3. Inside the blank space to declare the condition, add a Key () Pressed? Block (i.e., In the sample code, this is set to
evaluate if the space key is being pressed)
4. All subsequent code will be inside of this block.
Part 7B: Not Enough Mechanical Advantage
1. Add an If () Then Else block. Inside the blank space to declare the condition, add a () < () block.
a. Fill the first blank space with the Force Out variable
b. Set the second blank space to a number of your choosing. This is the “weight” that we are assigning to the
object being lifted by the lever and will be used to determine whether or not the object will be lifted based
on the Force In and Fulcrum Location variable values being set by the user and the calculated mechanical
advantage (i.e., in the sample code, this number is set to 150)
2. Inside of the If Then section of the If () Then Else block from the previous step:
a. Add a Point in Direction block and set it to 90.
b. Add a Say () for () Seconds block. Write a message telling the user that they do not have enough mechanical
advantage to lift the object and to try again.
Part 7C: Enough Mechanical Advantage
1. Inside of the Else section of the If () Then Else block from Part 7B, Step 8:
a. Add a Turn Left () Degrees block. Set it to approximately 15 degrees.
b. Add a Change Y By () block and add a () / () block inside of the blank space.
i. Set the first blank space of the () / () block to the Fulcrum Location variable.
ii. Set the second blank space to -4.
iii. You should end up with a block that reads: Change Y By Fulcrum Location / -4.
iv. This block will cause the lever to appear to “lift” if sufficient mechanical advantage is available. By
setting the change in position relevant to the value of the Fulcrum Location, it will ensure that the
lever sprite does not appear to ‘float’ above the Fulcrum sprite. You may need to adjust these
numbers to find the right fit for your project (i.e., a smaller negative number such as -2, -3, -4)
c. Add a Say () for () Seconds block and write a message congratulating the user for having sufficient
mechanical advantage to lift the object.
d. Add a Turn Right () Degrees and set it to the same value you used in Step 10A (i.e., 15 in this example).
e. Add the same block from Step 10B, but change the final value to the same number but as a positive integer
(i.e., if -4 was used, then this value should be +4). You should end up with a block that reads: Change Y by
Fulcrum Location / +4.
f. These final two blocks will ensure that the lever goes back down to its original state after the successful
message has appeared on screen so that the user can continue to use the simulator without having to
restart the code.
Extensions
Investigate how changing the “weight” assigned to the object in Part 7B, Step 8 affects how the code will run.
Add another sprite to simulate the effect of a person “pushing down” on the lever.
Consider adding sound effects to the simulation using the pre-loaded sounds in Scratch or use the Sound Editor
to record their own sounds. The Start Sound () and Play Sound () Until Done blocks will allow students to insert
those files into their code.
To learn more about Abe Kludze and force and mechanical advantage, consider the following books and videos:
o Ave Kludze, Ghanaian rocket scientist at NASA from Minister Faust
o Bill Nye and Mechanical Advantage from GeorgeBuford
o mechanical advantage explained (lever, block and tackle, inclined plane) from cg-physics-global
o The mighty mathematics of the lever - Andy Peterson and Zack Patterson from TED-Ed
Sharing Our Work/Consolidation: Students can share Scratch projects using these steps.
1. Students should be provided with time to share their projects with others and to engage in self and peer
assessment. This can be done in a variety of different formats, including a gallery walk, whole class presentation, or
“trading” their project with another student. Students can provide feedback in a variety of ways, including written
and verbal. A variety of feedback options and templates are available in Appendix A.
2. An important aspect of assessing student understanding is focusing on the process, not the product. While it is
important to have a final product that functions as intended, students are often asked to produce something within
a limited time frame; therefore, it may be the case that, given more time, a student would be able to produce a
fully functional product.
To assess learning, teachers can conference with students throughout the creation of their projects using the
anecdotal prompts in Appendix B and documenting these discussions using an anecdotal observations chart.
Teachers are encouraged to consider the troubleshooting strategies used by students throughout the project, their
ability to explain how their project works, and what they might do differently in the future.
3. A rubric can be used to evaluate the final product. This and other assessment and evaluation tools can be modified,
as needed.
Low -Tech/No-Tech Modifications:
While it is ideal to have one device per student, this is not the reality for many classrooms. If you are planning to
have students work in groups, consider a maximum group size of 2 students to ensure as much “hands-on” time
with coding as possible. If access to devices is limited, you may wish to implement this lesson as part of a station
rotation within your classroom or use another strategy to work with small groups.
If you have no access to devices, you can:
o print images of the Scratch blocks in the folder at this link, cut them out and have students create their
code with paper blocks instead.
o You may also wish to print out images of the background scenes and characters to further support students
Appendix A: Self and Peer Feedback
Student Self Assessment
o Thumbs Up
o WIN
Peer Assessment
o Two Stars and a Wish
o TAG
Appendix B: Anecdotal Prompts
Throughout the time when students are creating their projects, teachers are encouraged to circulate and conference
with students to discuss their projects and progress. The process is just as, if not more, important than the final product
when it comes to coding, so this is key to truly understanding a student's understanding.
Key Concepts
Students should be able to identify, name, and explain key coding concepts in their own words; for example, sequence
can be described as “the order in which you write your code matters”. Conditionals can be described as “if-then
statements that give your computer options to choose from.” The wording may be unique to each student, but they
should be able to explain the concept.
Suggested Prompts:
1. Can you tell me what you know about ______?
2. Can you show me where in your code you used _____? How does it work?
Application
There may be times when students “stumble” into the “right” answer in their code without fully understanding how
they got there, while another student may have a project that isn’t working the way they intend, but they know exactly
why and are able to very clearly articulate the steps they would take to fix the issue, if they had more time. Just because
a student’s project is not working exactly as they want it does not necessarily mean that they don’t understand so it is
important to take the time to discuss with students.
Suggested Prompts:
1. Can you tell me what this section of your code does?
2. It seems like this section of code isn’t working the way you want it to. Why do you think that might be? How
might you fix it?
3. What would happen if you made _____ change?
Troubleshooting/Debugging
In the world of code, a lot of mistakes are going to be made. Not only is this completely normal (and it happens to
professional computer programmers all the time), but it is actually HOW we learn to code. To move from making the
mistake into learning from it, students need to develop and utilize effective troubleshooting strategies. If a student just
sits there staring at their code for a week trying to figure out an issue without ever asking for help, they are not
demonstrating effective troubleshooting strategies. Effective troubleshooting strategies that students may demonstrate
include:
Reading their code out loud to themselves to attempt to identify errors
Sharing their code with a peer to ask for help in identifying an error
Dealing with frustration by taking a break from their code
Searching the web for answers to their questions
Suggested Prompts:
1. Can you tell me about a time where your code wasn’t working the way you wanted it to? What did you do to
fix it?
2. It seems like this section of code isn’t working the way you want it to. Why do you think that might be? How
might you fix it?
3. What are some mistakes you made when creating your project? What would you do differently next time?