Code a guard dog
Let’s get the Edison robot to patrol a room, like a guard dog, sounding an alarm if it detects a potential problem!
Get the materials for this lesson
You will also need to use the EdBlocks programming app.
About this lesson
Recommended time
55 minutes
Difficulty
Beginner
Prerequisites
None
Grade levels
Year 2 – Year 6

Introduce the key computational concepts of loops and conditionals using Edison robots and the block-based programming language EdBlocks. This lesson utilises the Edison robot’s infrared (IR) light sensors through a set of progressive programming tasks. Students apply sequential programming and decomposition to the challenges while exploring how robots can sense and react to the world.
This 1-hour lesson is designed to allow students to work independently as they discover:
- What is infrared light?
- How does Edison use infrared light?
- What are loops?
- How can Edison patrol, detect and alert?
Celebrate student success!
Recognise your students’ achievements in taking on an Hour of Code challenge with Edison robots by presenting them with a certificate of completion.
Is this your first time using Edison?
If this is your first time using Edison or EdBlocks, there are a few extra things you need to know. This Getting started with Edison and EdBlocks set will help you get the most out of Edison, EdBlocks and this activity. Inside you will find:
- step-by-step help for setting up your robots and programming devices plus
- a hands-on introduction activity for students.