Skip to content
Learning Site
Home

About

  • About Robotical
  • Case Studies
  • Meet the Team
  • Blog
  • Contact Us

Our Products

  • Marty the Robot
  • Axiom
  • Cog

Teach

  • Lessons & Resources
  • Marty for Educators
  • Funding & Grants
  • Professional Development
  • Why Teach STEM?
  • Coding Environments
  • Student Led Learning

Let's Code

  • Marty the Robot
  • Code Online
  • Marty Apple App
  • Marty Android App
  • Update your Marty
  • Cog
  • Code Online
  • Cog iOS App
  • Cog Android App
  • Axiom
  • Axiom Science

Support

  • Marty Get Started
  • Cog Quick Start Guide
  • Axiom Science Quick Start Guide
  • Support & FAQs
  • Marty V2 User Guides
  • Marty V1 Resources
  • Request Support
  • Request Top-Up Training

Shop

  • Marty the Robot and Physical Computing
  • Class Packs
  • Add Ons & Extras
  • Account
  • Shipping, Returns & Cancellations
  • Distributors
HomeLessonsUnits of workCurriculum standardsTutorials

Information

  • Lessons & Resources
  • Knowledge Base & User Guides
  • About Us
  • Shipping, Returns & Cancellation
  • Privacy Policy
  • Learning site privacy
  • Terms of Service
  • Partner Hub

Support & Help

  • Support & Help Center
  • Getting Started with Marty V2
  • Getting Started with Marty V1

Learning, Resources & Guides

  • Marty V2 Lessons Site
  • Marty V1 Lessons Site

Contact Us in the UK

Stanhope House,12 Stanhope Place,Edinburgh,United Kingdom,EH12 5HH
(+44) 0131 564 0922
hello@robotical.io
Contact Us

Contact Us in the US

2810N Church St, PMB 61694,Wilmington,Delaware,USA19802-4447
(+1) 833 886 1661
hello@robotical.io
Contact Us

Why not join our mailing list?

For News, New Products and Special Offers

Join mailing list

Copyright 2016-2026 © Robotical Ltd

All lessons
Marty app
CurrentPrevious

3.05: Functions and the Noise Sensor

Use Marty's noise sensors to trigger a response when a change occurs

3.05: Functions and the Noise Sensor
Age / stage
11 - 13
Estimated time
45 minutes
Difficulty
Advanced
Products
Marty V2

On this page

  1. Lesson overview
  2. Before you begin
  3. Warm-up
  4. Get learning
  5. Further challenge ideas
  6. Cool down
  7. Additional reading
  8. Curriculum standards

Additional reading

Reminders for where a noise sensor might be used:

  • Noise sensor for Marty
  • In a workplace reliant on computers
  • Applications for sound sensors (about halfway down the page)
  • Sensor use in hospitals
  • 2.23 Noise Sensors and Parallel Programming

Curriculum standards

25
Choose your curriculum to see the relevant standards.

25 of 25 linked standards shown.

Australian CurriculumAustralia4
Curriculum areaLinked standards
Digital Technologies, Design & technologies: Design & Technologies
Digital Technologies, Design & technologies: Digital Technologies

Select a code to read the full standard.

Digital Technologies, Design & technologies: Design & Technologies

  • ACTDEK031Analyse how motion, force and energy are used to manipulate and control electromechanical systems when designing simple, engineered solutions
  • ACTDEP039Use project management processes when working individually and collaboratively to coordinate production of designed solutions

Digital Technologies, Design & technologies: Digital Technologies

  • ACTDIP030Implement and modify programs with user interfaces involving branching, iteration and functions in a general-purpose programming language
  • ACTDIP031Evaluate how student solutions and existing information systems meet needs, are innovative, and take account of future risks and sustainability
CSTA Education StandardsUSA2
Curriculum areaLinked standards
General standards

Select a code to read the full standard.

  • 2-AP-11Create clearly named variables that represent different data types and perform operations on their values.
  • 2-AP-14Create procedures with parameters to organize code and make it easier to reuse.
Curriculum for ExcellenceScotland12
Curriculum areaLinked standards
Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing
Literacy & English: Listening and Talking
Literacy & English: Reading
Literacy & English: Writing
Technologies: Computing Science
Technologies: Craft, Design, Engineering and Graphics

Select a code to read the full standard.

Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing

  • HWB 0-11a / HWB 1-11a / HWB 2-11a / HWB 3-11a / HWB 4-11Social wellbeing
  • HWB 0-14a / HWB 1-14a / HWB 2-14a / HWB 3-14a / HWB 4-14aSocial wellbeing

Literacy & English: Listening and Talking

  • LIT 3-02aTools for listening and talking
  • LIT 3-05a / LIT 4-05aFinding and using information
  • LIT 3-07aUnderstanding, analysing and evaluating

Literacy & English: Reading

  • LIT 3-15a / LIT 4-15aFinding and using information

Literacy & English: Writing

  • LIT 3-20a / LIT 4-20aEnjoyment and choice
  • LIT 3-23aTools for writing
  • LIT 3-28aCreating texts

Technologies: Computing Science

  • TCH 3-14bUnderstanding and analysing computing technology
  • TCH 3-15aDesigning, building and testing computing solutions

Technologies: Craft, Design, Engineering and Graphics

  • TCH 3-12aApplication of Engineering
England's National CurriculumEngland2
Curriculum areaLinked standards
Computing, Design and Technology: Computing
Computing, Design and Technology: Design and Technology

Select a code to read the full standard.

Computing, Design and Technology: Computing

  • ✔️Understand what algorithms are; how they are implemented as programs on digital devices; and that programs execute by following precise and unambiguous instructions

Computing, Design and Technology: Design and Technology

  • ✔️Design purposeful, functional, appealing products for themselves and other users based on design criteria
ISTEUSA3
Curriculum areaLinked standards
International Society for Technology in Education (ISTE)

Select a code to read the full standard.

International Society for Technology in Education (ISTE)

  • 4aStudents know and use a deliberate design process for generating ideas, testing theories, creating innovative artifacts or solving authentic problems.
  • 5cStudents break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving.
  • 6bStudents create original works or responsibly repurpose or remix digital resources into new creations.
TEKSUSA2
Curriculum areaLinked standards
Middle School Technology Applications: Grade 6 to Grade 8

Select a code to read the full standard.

Middle School Technology Applications: Grade 6 to Grade 8

  • 1.CCreativity and innovation. The student uses creative thinking and innovative processes to construct knowledge, generate new ideas, and create products. The student is expected to: explore complex systems or issues using models, simulations, and new technologies to make predictions, modify input, and review results;
  • 6.DTechnology operations and concepts. The student demonstrates a thorough understanding of technology concepts, systems, and operations. The student is expected to: understand and use software applications, including selecting and using software for a defined task;

Resources

Learner resources

  • Workbook for Noise SensorsFile links loading

Educator resources

  • Teacher GuideFile links loading
  • Presentation for Functions and the Noise SensorFile links loading

Lesson overview

In this lesson learners extend their use of noise sensors and their awareness of functions and variables. The program will use a variable and will move Marty in different ways, depending on the stored value. The opportunity to use nested conditional statements and loops also exists.

Please read the knowledge base article about the noise sensor addon, before engaging with this lesson.

Learning objectives

  • I can read and use the input from a sensor
  • I can create a variable that stores the value from a sensor
  • I can write a function that is triggered by a condition

Key vocabulary

  • sensor
  • loop
  • wait block
  • function
  • variable

Prior learning

Experience using sensors, functions and variables

Before you begin

Equipment

  • Marty the Robot V2
  • Marty Workbook
  • Tablets
  • Access to the Blocks editor
  • Noise Sensor add on for Marty v2

Warm-up

Get learning

Extend

Challenge learners to have actions approximate the level of noise in the classroom:

  • Have Marty move a limb to display the level of noise in the classroom (the code in the teacher guide is broken down to explain how this is done)

Challenge learners to use an additional variable(s), that way a different action can occur whether the current level of classroom noise is louder or quieter than it was on the last pass of the function.

Consider including parallel code for example, sounds or actions from add-ons, depending on values from the variable that stores the noise sensor values.

Cool down

Activity

Warm up

Begin by revising the purpose of function blocks. Have learners recall ideas from the recent lesson on the light sensor that featured function blocks. Ideas may include that function block tend to have only one purpose, different parts of a program can call the same function block, functions can call other functions. Inform learners that today they are going to be using sensors again, this time, a different level of noise is going to result in a different action.

Have learners think of events in their lives where actions change depending on the level of noise in an environment: your neighbours may react differently, or may not react, depending on the level of noise; a teacher may respond differently depending on the noise in the classroom; a sportsperson or team might respond differently depending on the level of noise coming from the crowd, think of golf, snooker or football.

Share the objectives and success criteria from the presentation.

Have learners think of a person's response to noise based upon the situation. When is it good to be noisy, when it is good to be quiet? How do we react differently to different noise levels?

Have Marty carry out the code in the video from the presentation, which involves multiple function blocks with different actions occurring, depending on the level of noise. The code is described in the teacher guide.

Watch on YouTube

Inform learners that the code that causes Marty to run relies on a variable. Ask which values might be stored as a variable, in this instance. Examples could include, the level of noise, the limits for the movement to occur. Ask if the learners noticed that the movements changed as the program ran, could they identify a change that occurred in the program to trigger a different movement? Answers might include that the noise level changed. (The levels on the noise indicator in the video are not perfectly aligned to the sound, due to video editing that occurred.)

Activity

Get Learning

Remind learners of the noise sensor block so they can find a good range to use for measuring levels in the classroom. By clicking the tick box beside the noise sensor block, in the sensing section, learners can see a live display of the noise in the classroom. The values learners see can give them an idea of what quiet and noisy sounds like, they should record this to be the range of what Marty should use to react to the noise.

Show the second video, of a basic movement with Marty responding to a noise. Also highlight that the action happens once and then stops. How can we address this? Loops, maybe, but where would the loop go?

Watch on YouTube

Give learners the time to work within their groups to plan what blocks they would use to allow for different movements based upon the noise sensed. Draw attention to the fact that unless you can somehow change the noise sensor value, Marty will only ever carry out one action. That would be boring for both you and Marty. The noise sensor will need to be used regularly, but it will also need to be stored so that it can be accessed at different times, in the program.

Time for Practice

Learners need to plan for how to recognise a change in the level of noise and incorporate function blocks to make sure a range of different sound levels are considered.

Encourage regularly testing their code once they finish planning their work. Without periodically checking that the code is doing what is intended, work and time can be wasted because of the need to debug large blocks of code. This is another reason why having function blocks is a good idea: you can more easily spot where the bug is, if it occurs within a small function, when compared with a much larger block of code.

Support

Have physical code cards available for learners to use, when building their scripts:

  • if/then and if/then/else blocks
  • loops
  • noise sensor blocks
  • operator blocks: <, >, =
  • a variety of movement blocks
  • function blocks

Have a print out of the basic function statements, using the noise sensor.

Encourage pseudocode to clearly outline what you want to happen based on certain results.

Activity

Cool Down

Bring learners back together to discuss the challenges they faced and overcame. Have groups model their creations and explain what is happening, when. Encourage other groups to ask questions to deepen the understanding of the processes.

Take time to have group code displayed to the class, encourage observational questions from peers.

Suggested questions you might ask:

  • How did you effectively use variables?
  • Where did you include function blocks to carry out all of the actions?
  • How did you decide to exit a function?
  • Did anything interfere with the classroom noise? (It may be that Marty was picking up his own noise and responding to this)
  • Did anyone find a way to have Marty only listen to the classroom noise?

Carry out any end of lesson routines.

Log off devices and clear everything away.