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

Step 2 of 5

3: Marty Sensing the Environment

Step 2 of 5: 2.16: Ground Detection - Safety First

  1. 22.16: Ground Detection - Safety First
Marty app
CurrentPrevious

2.16: Ground Detection - Safety First

Use Marty's IR sensors to prevent him walking off the edge of a surface!

2.16: Ground Detection - Safety First
Age / stage
8 - 10
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

The include file describing the IR sensor shields will support you using the ground sensor, depending on which batch of Marty V2 you have.

Curriculum standards

17
Choose your curriculum to see the relevant standards.

17 of 17 linked standards shown.

Australian CurriculumAustralia3
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

  • ACTDEP025Generate, develop and communicate design ideas and processes for audiences using appropriate technical terms and graphical representation techniques

Digital Technologies, Design & technologies: Digital Technologies

  • ACTDIP031Evaluate how student solutions and existing information systems meet needs, are innovative, and take account of future risks and sustainability
  • ACTDIP032Plan and manage projects that create and communicate ideas and information collaboratively online, taking safety and social contexts into account
CSTA Education StandardsUSA2
Curriculum areaLinked standards
General standards

Select a code to read the full standard.

  • 1B-AP-11Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
  • 1B-AP-13Use an iterative process to plan the development of a program by including others' perspectives and considering user preferences.
Curriculum for ExcellenceScotland6
Curriculum areaLinked standards
Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing
Literacy & English: Listening and Talking
Literacy & English: Writing
Technologies: Computing Science

Select a code to read the full standard.

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

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

Literacy & English: Listening and Talking

  • LIT 2-02aTools for listening and talking
  • LIT 2-07aUnderstanding, analysing and evaluating

Literacy & English: Writing

  • LIT 2-23aTools for writing

Technologies: Computing Science

  • TCH 2-14bUnderstanding and analysing computing technology
  • TCH 2-15aDesigning, building and testing computing solutions
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
ISTEUSA2
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)

  • 4cStudents develop, test and refine prototypes as part of a cyclical design process.
  • 5cStudents break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving.
TEKSUSA2
Curriculum areaLinked standards
Elementary Technology Applications: Grade 3 to Grade 5

Select a code to read the full standard.

Elementary Technology Applications: Grade 3 to Grade 5

  • 4.BCritical thinking, problem solving, and decision making. The student applies critical-thinking skills to solve problems, guide research, and evaluate projects using digital tools and resources. The student is expected to: (B) collect, analyze, and represent data to solve problems using tools such as word processing, databases, spreadsheets, graphic organizers, charts, multimedia, simulations, models, and programming languages;
  • 6.CTechnology operations and concepts. The student demonstrates knowledge and appropriate use of technology systems, concepts, and operations. The student is expected to: navigate systems and applications accessing peripherals both locally and remotely;

Resources

Learner resources

  • Workbook for Ground DetectionFile links loading

Educator resources

  • Teacher GuideFile links loading
  • Presentation for Ground DetectionFile links loading
3: Marty Sensing the Environment
Unit overview
12.06: What's in Marty's Way?
32.21: Estimating with Distance Sensors
42.22: Light Sensors and Conditional Statements
52.23: Noise Sensors and Parallel Programming
Previous step2.06: What's in Marty's Way?
Next step2.21: Estimating with Distance Sensors

Lesson overview

We previously used Marty's IR sensors to detect obstacles in his path, however they can also be used in other ways! In this lesson we explore how IR sensors can be used to detect whether Marty has his feet on solid ground or is at risk of falling over an edge!

Learning objectives

  • State a clear reason how ground sensors can improve a robot.
  • Write code to stop Marty at an edge.

Key vocabulary

  • Infrared
  • Sensor
  • Sense
  • Edge detection
  • Logic

Prior learning

Sufficient confidence with loops and conditional statements; knowledge of sensors

Before you begin

Equipment

  • Marty the Robot V2
  • Marty Workbook
  • Tablets
  • Access to the Blocks editor
  • A table or raised platform with an edge

Technical information

Before beginning this lesson, it is important that the ground or colour sensor be properly configured in the Marty the robot app, please click here to revise the knowledge base for the colour sensor and here for the IR sensor . Additionally, this lesson will involve Marty walking to the edge of a surface. It is strongly recommended that the surface be a book on the floor or on a desk that allows enough space for Marty to fall and not fall very far.

Warm-up

TimingActivityPossible adaptations
Timing—

Warm Up

Have the presentation ready with the Objectives and Success Criteria shared with learners. The first video features the Roadrunner and Coyote and a humorous consequence of what can happen to a character that is not properly sensing their environment.

Watch on YouTube

To help learners appreciate the purpose of a ground sensor, have them stand up and look down. Ask them what they see. learners may respond with shoes, socks, their feet, carpet, the ground, sand. Ask learners to close their eyes. Ask them what they feel. they may say the floor or ground, socks or shoes.

We know that things are there when we look down because we see them. We also know that things are there (below us) when our eyes are closed because we can feel them. We could say that we sense the ground through touch and sight. Have learners sit in their chairs and close their eyes. Have them raise their feet above the ground and ask them if they know if the ground is there. How do they know? Learners may say that they saw it when their eyes were open or they are on a chair and the chair is on the ground. They can't sense the ground but they know it is there. Suggest learners lower their feet for a second, for a rest, and open their eyes. People know things, machines don't. Have learners close their eyes and raise their legs again. Ask learners to slowly lower their legs to the ground and be ready to describe how it feels when their feet touch the ground. Have learners record their thoughts in the workbook. Suggest to learners that what just happened, now, is kind of like how Marty senses the ground.

Get learning

TimingActivityPossible adaptations
Timing—

Get Learning

In the lesson today, we are going to write code for Marty so that he can stay safe next to an edge; in this case, it will be a table edge, not a mountain edge. It might not prepare Marty for the hike in the video but should prevent the coyote's mistakes. The teacher guide describes the code that commands Marty to carry out these actions.

Watch on YouTube

Have learners discuss in groups what kind of robot they might expect to have a ground sensor or a situation where it might be wise to have the ability to detect the ground. If learners are a bit stuck, ask them why a ground sensor might be good if a robot was on the third floor of a building and wanted to leave the building; what if a robot was piloting a helicopter; what if a robot needed to climb a ladder; what if a robot was being used to rescue people in a building that was unstable?

Share with learners the images of the ground sensor and where to find the block in Blocks. Illustrate that the block for the groud sensor needs to be used with a conditional, or if, block: it does not snap to the other blocks like the movement blocks.

Possible adaptations—
Timing

Cool down

TimingActivityPossible adaptations
Timing—

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.

Suggested questions you might ask:

  • How did you incorporate both feet into the program?
  • What interesting actions did Marty perform at the edge?

Carry out any end of lesson routines.

Log off devices and clear everything away.

Possible adaptations—

Unit resources

Learner resources

  • 2.06 What's in Marty's Way.pdf
  • 2.16 Ground Detection - Safety First.zip
  • 2.21 Estimating with Distance Sensors.zip
  • 2.22 Light Sensors and Conditional Statements.zip
  • 2.23 Noise Sensors and Parallel Programming.zip

Show the second video of a hiker navigating a dangerous route. Reinforce that the hiker should not ever remove both clips of the harness, this is incredibly dangerous. The second video features a lot of sensing. In the clip, the hiker can see how far down it is, they can feel the wood under their feet and the tension from the cable when they lean back. Additionally, the hiker probably feels a lot of excitement.

Watch on YouTube
Possible adaptations—
—

Time for Practice

Share with learners where to find the ground sensor, what the ground sensor returns and the basic code of the ground sensor connecting inside a conditional statement (these images feature in the presentation). The video shows the result of basic code that has Marty walk to the edge of a surface, one step for each press of the green flag, and perform a different action if the ground sensor returns false. The image below shows the code that was used for Marty to stop at the edge of the box in the video.

Watch on YouTube

Ask learners what they think they could do to avoid having to click the green flag twice, it is hoped they will suggest a repeat block. Remind them of the blocks they have already used in their code, conditional blocks, repeat blocks, wait blocks, movement blocks, logic blocks. Encourage learners to make the code more interesting than just one action and stop and make sure that both the left sensor and the right sensor feature in the program.

Possible adaptations

Support

Further challenge ideas

Extend

Challenge learners to code Marty to respond to an edge without making use of logic blocks. They will need to think about compound if statements. An example is included in the teacher guide that explains how this works.