Grade 7 Earth & Space Systems
Lesson Summary: Students will create an interactive simulation that demonstrates the particle theory of matter.
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
E2. demonstrate an understanding of
heat as a form of energy that is
associated with the movement of
particles and is essential for many
natural processes within Earth’s
systems
Specific Expectations
A2.1 write and execute code in
investigations and when modelling
concepts, with a focus on planning
and designing programs
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
E2.1 use particle theory to explain
how heat affects the motion of
particles in a solid, a liquid, and a gas
E2.3 use particle theory to explain the
effects of heat on volume in solids,
liquids, and gases, including during
changes of states of matter
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 events influenced by a
defined count and/or subprogram
and other control structures.
C3.2 read and alter existing code,
including code that involves events
influenced by a defined count and/or
subprogram and other control
structures, 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 7 Science & Technology curriculum, there are two coding related expectations:
A2.1 write and execute code in investigations and when modelling concepts, with a focus on planning and
designing programs
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:
Prior to writing any code, students should plan the structure and logic of how their code will work
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 simulator that demonstrates the particle theory
of matter
Success Criteria:
1. I can effectively plan a program
2. I can use conditionals to create interactions between different sprites
3. I can collect and use input from the user to change the outcome of my program
4. I can use variables to store data, including input from the user
5. I can effectively simulate the behaviour of particles in solid, liquid, and gas states
STEM Profile:
Particle theory helps us understand the interaction between temperature and
states of matter. One great example of this is refrigeration! Refrigerators work by
extracting heat and using it to evaporate a refrigerant (which is a fluid that
undergoes a repeated phase transition from a liquid to a gas and back again) which
then creates a cooling effect.
Someone who used this knowledge to his advantage was Frederick McKinley Jones,
a Black American inventor who created mobile refrigeration technology! Our ability
to eat food from across the country (and even across the world!) is completely
dependent on this technology. Even more, the portable cooling units he designed
were especially important during World War II, as they were used to transport
blood, medicine, and food for use at army hospitals and on open battlefields. Throughout his career he received more
than 61 patents, 40 of which had to do with refrigeration technology.
Like Frederick, we will be exploring the particle theory of matter so we can better understand how it shapes the world
around us and can allow us to create amazing new inventions of our own!
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 for their simulations that will show
how particles behave and interact in different states of matter. Some sample prompts include:
o What are the differences between pure substances and mixtures?
o What are different kinds of pure substances?
o What are different kinds of mixtures?
o What are the differences between elements and compounds?
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:
For this project, teachers may wish to assign a different state of matter to each student or group or to model the creation
of a simulation for one of the three states of matter and then invite students to create a simulation for one of the other
two states of matter of their choice. The sample code for solids, liquids and gases demonstrate how the project might
work for each of the three states of matter. 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.
Option 1: Gas
Part 1: Set Up
1. Create a relevant backdrop using the paint editor and add instructions to the backdrop using the text tool, if desired.
2. Add a sprite (i.e., the “ball” sprite can serve as a representation of the particles) and delete all the costumes for that
sprite except for one. Use the paint bucket in the paint editor to set it to a solid colour to make interactions between
each particle sprite easier to detect.
3. In the orange Variables menu, click “Make a Variable”.
a. Name the new variable “Temperature” and select the checkbox so that the variable appears on screen.
b. When the variable appears on the project preview screen, right click it and select Slider. This will allow the
user to change the temperature in order to eventually impact the speed at which the particle sprites move.
c. You can reposition the variable on screen by clicking and dragging.
Part 2: Basic Particle Settings
1. In the area for the particle sprite, add the When Green Flag Clicked event block.
2. Use the Set () To () block from the variables menu and change it to match with the name of your temperature
variable. Setting it to a low number (i.e., 10) will make it so that when your code begins. the particles will already
be in motion.
3. Use the Set Size To ()% block to resize the particle sprite (i.e., if using the default ball sprite from Scratch’s pre-
designed sprites, a size of 50%-75% works well).
Part 3: Interactions Between Particles
1. Add a Forever loop from the control menu. Inside of the forever loop add the If on Edge, Bounce block to keep
particles within the limits of the screen.
2. Still inside of the forever loop, add an If () Then block combined with a Touching Color ()? block from the sensing
menu. Click on the pre-loaded colour and use the colour picker to select the exact shade of the particle sprite you
have created to ensure 100% accuracy.
3. Inside of the If () Then block, add the following blocks, which will make it so that when two particles bump into each
other, they turn in opposite directions and bounce away, creating the effect of an interaction:
a. Add the Turn () Degrees block and combine it with a Pick Random () to () block. Set the numbers to be
between 150 210. The direction of the turn does not matter.
b. Add the Move () Steps block and set it to approximately 10. You can play around with the number to see
what impact that has on your code, but a lower number (i.e., anywhere from 5 to 15) will make the
movement more realistic.
Part 4: Respond to Temperature Changes
1. Outside of the If () Then block but still inside of the Forever loop from part 3, add a Move () Steps block and insert
a () / () operator block.
2. Set the first blank space of the () / () block to the round block with your temperature variable name from the
variables menu. Set the second blank space to a value such as 10. This will make it so that as the temperature
variable is increased or decreased with the slider, the movement of the particle sprites will speed up or slow down
accordingly.
Part 5: Create Many Particles
1. Each particle sprite will have the exact same code. As a result, you can just duplicate the sprite you have already
created in order to make as many particles as you desire. To create a duplicate, right click on the icon of the sprite
in the sprite pane and select “Duplicate.” Remember that if you make any changes in a particle sprite you will need
to replicate those changes in all the other sprites.
Option 2: Solid
Part 1: Set Up
1. Create a relevant backdrop using the paint editor and add instructions to the backdrop using the text tool, if desired.
2. Add a sprite (i.e., the “ball” sprite can serve as a representation of the particles) and delete all the costumes for that
sprite except for one. Use the paint bucket in the paint editor to set it to a solid colour to make interactions between
each particle sprite easier to detect.
3. Create two versions of this sprite with different colours so you can visually tell the difference and be sure to name
them clearly. For the remainder of this lesson, they will be referred to as the “red particle” and “black particle” (but
you can choose any colour).
4. In the orange Variables menu, click “Make a Variable”.
a. Name the new variable “Temperature” and select the checkbox so that the variable appears on screen.
b. When the variable appears on the project preview screen, right click it and select Slider. This will allow the
user to change the temperature in order to eventually impact the speed at which the particle sprites move.
c. You can reposition the variable on screen by clicking and dragging.
Part 2: Create the Container Sprite
1. Use the paint editor to design a sprite to be some kind of fully enclosed shape (i.e., a box). The shape should be an
outline only with no fill colour and the recommended pen size for the line thickness is approximately 10. No code
is needed in this sprite.
Part 3: Settings for Red Particle
1. In the area for the particle sprite, add the When Green Flag Clicked event block.
2. Use the Set () To () block from the variables menu and change it to match with the name of your temperature
variable. Setting it to a low number (i.e., 10) will make it so that when your code begins. the particles will already
be in motion.
3. Use the Set Size To ()% block to resize the particle sprite such that approximately 10 12 particles can fit within the
container sprite (i.e., if using the default ball sprite from Scratch’s pre-designed sprites, a size of 50%-75% works
well).
4. Use a Forever loop and add the following blocks inside to create the effect of the particles vibrating back and forth:
a. Add a Change X by () block combined with a () / () operator block and set the first blank space of the () / ()
block to the round block with your temperature variable name from the variables menu. Set the second
blank space to a value such as 10. This will make it so that as the temperature variable is increased or
decreased with the slider, the movement of the particle sprites will speed up or slow down accordingly.
b. Use a Wait () Seconds block and set it to 0.1 seconds. This will create a slight delay between the left and
right movement so that it is visible to the viewer.
c. Use the same block as in step (a) above but change the value to -10 to cause a movement in the opposite
direction.
Part 4: Settings for Black Particle
1. The code for the black particle will be the same as for the red particle but with one subtle change. To copy the code
from one sprite to another, click and drag the code by the topmost block in the script (i.e., in this case, by the event
block) and drag it into the icon for the desired sprite in the sprite pane.
2. Once the code has been copied to the black particle, change the order of the +10 and -10 values (i.e., if in the red
sprite the order was +10 and then -10 then in the black particle, the order should be -10 and +10).
Part 5: Create Many Particles
1. Each red particle sprite and black particle sprite will have the exact same code, respectively. As a result, you can
just duplicate the sprites you have already created in order to make as many particles as you desire (i.e., in the
sample code, there are six of each for a total of 12). To create a duplicate, right click on the icon of the sprite in the
sprite pane and select “Duplicate.” Remember that if you make any changes in a particle sprite, you will need to
replicate those changes in all of the other sprites.
Part 6: Position Particles
1. Once you have created the desired number of particles, they need to be positioned in a structure that resembles
that of a solid, which can be done by clicking and dragging the sprites. As a result, all of the particle sprites should
be within the boundaries of the container sprite created in part 2 and positioned close together in columns and
rows, such that they appear to fill the container without directly touching each other or the edges of the container.
Option 3: Liquid
Part 1: Set Up
1. Create a relevant backdrop using the paint editor and add instructions to the backdrop using the text tool, if desired.
2. Add a sprite (i.e., the “ball” sprite can serve as a representation of the particles) and delete all the costumes for that
sprite except for one. Use the paint bucket in the paint editor to set it to a solid colour to make interactions between
each particle sprite easier to detect.
3. In the orange Variables menu, click “Make a Variable”.
a. Name the new variable “Temperature” and select the checkbox so that the variable appears on screen.
b. When the variable appears on the project preview screen, right click it and select Slider. This will allow the
user to change the temperature in order to eventually impact the speed at which the particle sprites move.
c. You can reposition the variable on screen by clicking and dragging.
Part 2: Create the Container Sprite
1. Use the paint editor to design a sprite to be some kind of fully enclosed shape (i.e., a box). The shape should be an
outline only with no fill colour. To best approximate the behaviour of particles in a liquid, a line should be drawn
horizontally across the container to simulate the surface of the liquid. The recommended pen size for the line
thickness is approximately 10 and no code is needed in this sprite.
Part 3: Basic Particle Settings
1. In the area for the particle sprite, add the When Green Flag Clicked event block.
2. Use the Set () To () block from the variables menu and change it to match with the name of your temperature
variable. Setting it to a low number (i.e., 10) will make it so that when your code begins. the particles will already
be in motion.
3. Use the Set Size To ()% block to resize the particle sprite (i.e., if using the default ball sprite from Scratch’s pre-
designed sprites, a size of 50%-75% works well) such that approximately 9 12 of the particle sprites could fit inside
the container sprite that you made and be small enough to minimize overlap between particle sprites.
4. Use Go To X () Y () to position your particle sprite within the container sprite. This may need to be edited later on,
once the duplicate particle sprites have been created.
5. Add the Turn () Degrees block and combine it with a Pick Random () to () block and set the numbers to be between
0 360 to randomly change the heading of each particle sprite. The direction of the turn does not matter.
Part 4: Interactions with the Container
1. Add a Forever loop from the control menu.
2. Inside of the forever loop, add an If () Then block combined with a Touching ()? block from the sensing menu and
set it to the name of your container sprite.
3. Inside of the If () Then block, add the following blocks, which will make it so that when a particle bumps into the
edge of the container, it will turn in the opposite direction and bounce away, creating the effect of the container
keeping the liquid inside:
a. Add the Turn () Degrees and set it to 180. The direction of the turn does not matter.
b. Add the Move () Steps block and set it to approximately 10. You can play around with the number to see
what impact that has on your code, but a lower number (i.e., anywhere from 5 to 15) will make the
movement more realistic.
Part 5: Respond to Temperature Changes
1. Outside of the If () Then block but still inside of the Forever loop from part 3, add a Move () Steps block and insert
a () / () operator block.
2. Set the first blank space of the () / () block to the round block with your temperature variable name from the
variables menu. Set the second blank space to a value such as 10. This will make it so that as the temperature
variable is increased or decreased with the slider, the movement of the particle sprites will speed up or slow down
accordingly.
Part 6: Create Many Particles
1. Each particle sprite will have the exact same code, except for a change in the position set in the Go To X () Y () block.
As a result, you can just duplicate the sprite you have already created in order to make as many particles as you
desire. To create a duplicate, right click on the icon of the sprite in the sprite pane and select “Duplicate.”
2. Once you have created the desired number of particles, they need to be positioned in a structure that resembles
that of a liquid, which can be done by clicking and dragging the sprites.
a. The particle sprites should be within the boundaries of the container and underneath the “surface line”
b. The particle sprites should be positioned such that they appear to fill the container
c. The particle sprites should be spaced out so that they are close together without directly touching each
other or the edges of the container sprite
3. Once you have repositioned the sprites, go into the code for each particle sprite and update the position in the Go
to X () Y () block to match with their current position using the coordinates that can be found for each sprite in the
sprite pane. This will ensure that each time you restart the code the particle sprites return to their original position.
Extensions
Students can use sounds to add additional effects to their projects
For an added challenge, students can create a single project that includes all 3 states of matter (i.e., uses button
presses from the user to determine which state of matter to show)
To go deeper into learning about Frederick McKinley Jones and the particle theory, consider the following books
and videos:
o I’ve Got an Idea: The Story of Fredrick McKinley Jones by Gloria Borseth Swanson
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?