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
ActivitiesBeginner

Activity: Roaming Rover

Coding Skills

Iteration

Rover Concepts

UltrasonicMotors
Activity: Roaming Rover

Program the Rover to move around the room using the ultrasonic sensor to avoid running into obstacles. If the Rover detects an object, turn away from it and keep moving forward.

Activity Demonstration: Roaming Rover

Setup

A small obstacle course with flat surfaces like boxes and books works well for the Rover to detect. The ultrasonic sensor works best against flat, hard surfaces, angled or soft surfaces are harder to detect because the sensor relies on reflected sound waves.

Our Approach

Stage 1: Detect an Obstacle

Use an IF statement with a logic comparison to check if the ultrasonic sensor detects an obstacle in front of the Rover.

Stage 2: Turn or Drive Forward

Use the IF / ELSE block to turn when an obstacle is detected and drive forward when it isn’t, both with motor blocks.

Stage 3: Loop Forever

Wrap everything in a While True loop so the behaviour repeats forever.

Example code, obstacle-avoiding Rover

Example code, obstacle-avoiding Rover

Continue Learning

Activity: Puppy BotRelated resourceActivity: Puppy BotBranching and looping with the ultrasonic sensor.

Activity: Maze IRelated resourceActivity: Maze ILearn the basics of maze solving using the ultrasonic and IR sensors to detect walls and navigate simple paths.

The Ultrasonic SensorRelated resourceThe Ultrasonic SensorLearn what the ultrasonic sensor is, how it works, and how to code it on the Micromelon Rover.

← Return to Resources