Micromelon Robotics
Platform
Resources
NewsAbout UsDownload
Support
Build Your Kit

Stay in the loop

New activities, teaching guides, and product updates delivered to your inbox.

Micromelon Robotics

Australian-made educational robotics for the next generation of innovators.

contact@micromelon.com.au

Company

  • About Us
  • Privacy Policy
  • Terms and Conditions

Products

  • Micromelon Rover
  • Code Editor
  • Robot Simulator
  • Junior
  • Python Library

Support

  • Resources
  • News
  • Rover Repairs
  • Contact
  • Build Your Kit

© 2026 Micromelon Robotics Pty Ltd. All rights reserved.

ABN 56 623 302 296

← Back to Resources
ActivitiesSimulator ActivitiesBeginner

Activity: Maze I

Coding Skills

BranchingIterationAlgorithm Design

Rover Concepts

UltrasonicIRMotors
Activity: Maze I

Navigate your Rover through a maze using the ultrasonic sensor to detect walls ahead and the IR sensor to check for walls to the side. This beginner approach introduces the fundamentals of maze solving with simple branching logic.

Setup

Construct mazes with any solid material that is tall enough for the Rover’s IR and ultrasonic sensors to detect. We use boxes or wooden blocks to create our walls. For this first level, keep pathways wide, at least 15 cm clearance on each side of the Rover to make it easier for students to get started.

Our Approach

This basic approach only uses the ultrasonic sensor and the left IR sensor.

Stage 1: Define the Wall Distance

Create a variable named wall that represents the distance (in cm) from the side of the Rover to the maze wall when the Rover is placed in the middle of a maze path.

Stage 2: Check Forward

With an IF / ELSE IF / ELSE block, first check if the Rover can move forward. If the ultrasonic sensor doesn’t detect anything closer than the wall value, move forward. Otherwise, there’s a wall in the way and it has to decide where to turn.

Stage 3: Turn Left or Right

The ELSE IF branch checks if the left IR sensor detects a wall. If not, the way is clear and the Rover turns left. If it does detect a wall, the ELSE case runs and the Rover turns right. Place the whole IF/ELSE IF/ELSE block in a While True loop so the behaviour repeats indefinitely.

Example code, basic maze-solving algorithm

Example code, basic maze-solving algorithm

Continue Learning

Activity: Maze IIRelated resourceActivity: Maze IIBuild on your maze-solving skills by using both IR sensors and the ultrasonic sensor together to handle more complex maze layouts.

Activity: Maze IIIRelated resourceActivity: Maze IIIMaster maze solving with precise gyroscope turns, wall-following algorithms, and functions to create an efficient maze navigator.

← Return to Resources