Grade 4 Matter and Energy
Lesson Summary: Students will create a sound visualizer simulation.
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
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
C2. demonstrate an understanding of
light and sound as forms of energy
that have specific characteristics and
Specific Expectations
A2.1 write and execute code in
investigations and when modelling
concepts, with a focus on testing,
debugging, and refining programs
A2.2 identify and describe impacts of
coding and of emerging technologies
on everyday life
A3.3 analyse contributions to science
and technology from various
C2.4 describe properties of sound,
including that sound travels through
a medium as a wave and that sound
can be absorbed or reflected and
C2.5 explain how vibrations cause
sound waves
C2.6 describe how different objects
and materials interact with light and
sound energy
C2.8 identify sensory organs and
devices that make use of the
properties of light and sound
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 sequential, concurrent,
repeating, and nested events
C3.2 read and alter existing code,
including code that involves
sequential, concurrent, repeating,
and nested events, and describe how
changes to the code affect
the outcomes
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
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
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
Breaking Down the Coding Expectations in Science & Technology:
In the Grade 4 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 producing
different types of output for a variety of purposes
A2.2 identify and describe impacts of coding and of emerging technologies on everyday life, including skilled
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 producing output, which is any information
given by the computer to the user
show how coding impacts our lives
Both expectations will be addressed through the project.
Learning Goals: We are learning to write code to create a sound visualizer simulation
Success Criteria:
1. I can use the pen feature to create the effect of drawing
2. I can use variables to store information
3. I can use operators to create equations
4. I can use user input to influence my code
STEM Profile:
Being deaf means that you are partially or entirely unable to hear. More than 5%
of the world is partially or entirely deaf! Cochlear implants are small electronic
devices that can improve the hearing of some people with some hearing loss.
In 1975, Ingeborg Hochmair and her partner, Erwin Hochmair, created the first
ever micro-electronic multi-channel cochlear implant, which is a special kind of
cochlear implant that not only helps the user to hear sounds, but also improve
their understanding of speech. Coming from a family of scientists, Ingeborg
Hochmair is an electrical engineer who was inspired to use her love of science to
help make a difference in the world, showing how science can be used to help
others when you try.
Like Ingeborg, we will be using our knowledge of sound to help others
understand how it really works.
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. Introduce the idea of output. To fully understand this concept, we must also understand the idea of input. Input is
something given to the program by the user, while output is something given to the user by the program. A simple
analogy is that of a vending machine, with the input being the money that is put in and the output being the food
item that the vending machine releases. In this lesson, the input will be the sound of the users voice and the output
will be the on screen visualization
Discussion: Can students think of other real-life examples of input and output?
3. For this project, students also need to understand the concept of variables, which are values in our code that store
data or information. They can change (or vary) depending on what information is moved into and out of them.
There are two main variables in our code. The position variable will hold the x coordinate where our dot is
positioned. The loudness variable is one already built into Scratch. It holds information on how loud a sound is,
based on what the microphone picks up.
Creating Our Project:
This sample code demonstrates how the project might work. 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. This particular project makes use of
the microphone so in order for it to work, students will need to use a device with a functioning microphone. They will
also need to approve the microphone settings and make sure that the microphone source is correct.
Part 1: Project Setup
1. Delete the automatically added sprite. Use the option to create your own sprite with the paint editor. Your sprite
should just be a small dot (i.e., use the paintbrush set to size 10 to draw a single small dot, approximately in the
middle of the paint area).
2. Use the Add Extension button in the bottom, left-hand corner of the screen to add the Pen Extension in order to
use its features.
Part 2: Starting Position & Variables
3. Add in the When Green Flag Clicked block from the yellow Events menu and add the Erase All block from the Pen
extension menu. This will ensure that each time you restart the code all previous lines drawn on screen are erased.
Use the Go To X () Y () block to set your position to the very left of the screen, using the coordinates of (-240, 0).
4. In the orange Variables menu, press “Make A Variable” and set the name to something like “current”; then, use the
Set (variablename) to () block to set the variable you just created to 0. A variable is used to store data that can vary
throughout your code and be referred to in other code blocks in order to control the outcome of your code. In this
sound visualizer project, this variable will be used to track our position along the x axis to allow the sound
visualization to progress across the screen.
5. Add the Pen Down block from the Pen extension menu. This will allow the sound visualization to actually be drawn
using the pen feature. Pen down to start drawing.
Part 3: Drawing the Sound Visualizer
6. Use the Repeat () block and set it to repeat 480 times. The number 480 has been chosen to represent the entire
width of the screen from edge to edge (240 to the left of the y axis, 240 to the right of the y axis). This will allow our
sound visualizer to use up the entire screen. All blocks in future steps will be put inside of this repeat block.
7. Add the Set Pen Color To (#) block from the Pen extension menu. In the blue Sensing menu, drag out the Loudness
block. Use this block to replace the numerical value currently stored in the Set Pen Color To () block. This will mean
that you end up with a block that reads Set Pen Color To (Loudness). The Loudness block allows Scratch to use the
microphone to detect sounds and use the value assigned to the loudness in other areas of the code. In this case,
we will use the Loudness value to change the colour of the sound visualizer depending on how quiet/loud the sound
is (i.e., with red representing quietest, purple representing loudest).
8. Add the Go To X () Y () block. In the green Operators menu, drag out the () () block and place it inside of the space
for the X value in the Go To X () Y () block. The operators blocks allow users to compare values and perform
a. Go into the orange Variables menu, drag out the round block that includes the name of the variable you
created in step 4 (i.e., current) and place it inside of the first blank space in the () () block.
b. In the second blank space of the () () block, write the number 240. This will create the equation “current”
240 inside of the X value of the Go To X () Y () block. We will use this comparison to change our position
along the x axis each time the loop runs through a full cycle, which will allow the sound visualizer to move
across the screen over time. This will require an additional block of code, which will take place in Step 11.
c. Keep the Y value in Go to X () Y () set to 0.
9. To create the actual visualization to represent the loudness, we will need to change the Y value in both the upward
and downward direction.
a. Add the Change Y By () block. In the blue Sensing menu, drag out the Loudness block and place it in the
blank space for the Y value. This will create the “up” motion for the sound visualizer.
b. Use the Set Y to () block and set the Y value to 0 to bring the sound visualizer back to the centre point.
c. Add another Change Y By () block. In the green Operators menu, drag out the () * () block and place it in
the blank space for the Y value.
i. In the first blank space of the () * () block, place the Loudness block from the blue Sensing menu.
In the second blank space of the () * () block, set the value to -1. This will translate the loudness
value into a negative number, allowing the sound visualizer to move below the x axis, creating a
full visualization effect. See Figures 1 and 2 for a comparison.
Figure 1: Sound visualizer without negative values
Figure 2: Sound visualizer with negative values.
10. From the orange Variables menu, add in a Change () by () block and set it to the variable you created in Step 5 (i.e.,
current). Set the second value to 1. This will serve as the second half of the effect we are trying to create from Step
9. This will increase our variable “current” by 1 each time the loop completes a cycle, which will create the effect of
the sound visualizer moving across the screen.
1. To dive deeper into their code, students may consider the following challenges to take their projects to the next
a. Use the Pick Random () to () block to randomize the colour used in sound visualizer.
b. Try reversing the direction of the sound visualizer to go from the top to the bottom of the screen instead
of left to right (think about how you would need to change the x and y values accordingly)
c. Consider using the Set Pen Size to () in combination with Loudness to change the shape and size of the
sound visualizer.
2. To go deeper into learning about Ingeborg Hochmair and sound, consider the following books and videos:
a. Ingeborg Hochmair & Erwin Hochmair - Cochlear implant to restore hearing from European Patent Office
b. What is Sound? | Physics for Kids from SciShow Kids
c. What is Sound? | The Dr. Binocs Show | Learn Videos for Kids from peekaboo Kidz
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
Peer Assessment
o Two Stars and a Wish
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?
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?
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
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?