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 ActivitiesAdvanced

Activity: Claw Attachment

Coding Skills

BranchingIterationAlgorithm Design

Rover Concepts

Colour
Activity: Claw Attachment

Use the claw to grab the Meloncube and perform delivery tasks in a warehouse scenario. Use the colour sensors on the robot to read colour codes for delivery instructions.

Setup

The initial activity can be to have an indicator line on the ground using tape, which the robot starts behind. The Meloncube can be placed 30cm in front of this line, and students can be tasked to grab the cube and bring it back over the line. Depots can then be introduced to create a warehouse scenario.

Any object can be used in place of our Meloncube, however, if you wish to use it you can download the print file below.

AccessoryMelonCubeA small 3D-printed cube for the claw to pick up and deliver.
PrintablesThingiverse

Depots are walled square areas for the rover to deposit a Meloncube in. The walls can be constructed from tape on the ground or solid materials in a 20cm x 15cm area. Use the diagrams below as a reference for the layout of the depots. A number can be allocated to each depot, and students can deliver the cube to each depot on demand.

Add coloured tape to the previous challenge to add more complexity. The tape could indicate which depot the cube must be delivered to. The rover can use the colour sensor to detect the colour of the tape and use the appropriate delivery instructions. A final extension challenge is leaving the cube in one of the depots and having the rover retrieve it and put it behind the indicator line.

1Basic Grab and Return
  • The rover starts behind the indicator line (black).
  • It drives forward to the Meloncube (red arrow), grabs it, then returns behind the line (green arrow).
2Depot Delivery
  • After grabbing the Meloncube, the rover delivers it to one of three numbered depots.
  • The rover receives a depot number and navigates to the correct depot to deposit the cube.
3Colour-Coded Delivery
  • A coloured indicator line (blue) replaces the black line.
  • The rover uses its colour sensor to read the colour and determine which depot to deliver to.
  • Each depot is marked with a coloured square (blue, red, or yellow).
4Retrieval Challenge
  • The Meloncube starts inside one of the depots (yellow depot in this example).
  • The rover must navigate to the depot, pick up the cube, and return it behind the indicator line.
  • The yellow indicator line shows the starting position for this challenge.

Our Approach

Constant: a variable that never changes while the code is running. In Python, we write these in all capitals with underscores between words.

5Setting the Constants
  • Define two constants: CLAW_CLOSE (set to 30) and CLAW_OPEN (set to -30).
  • Trial and error will have to be used to find the correct settings for your rover.
6Grab and Release Functions
  • Create two functions: grab moves the left servo to CLAW_CLOSE, and release moves the left servo to CLAW_OPEN.
  • While these functions only have the 'Move Servo' block, doing this makes it easier to understand the code.
7Data Input
  • In the main code, create a variable named Input which uses "Request Input with prompt" to ask for the depot number ("Enter Depot Number:").
  • If you're using colour indicators instead, the input request can be replaced with an 'if else' statement that detects the colour and sets the input to a depot number.
8Secure the Cube
  • Once the robot has acquired the delivery instructions, move forward 10cm at speed 15 to approach the cube.
  • Then call the grab function to pick up the Meloncube.
9Delivering the Cube
  • Use an if/else if chain to check the Input value (1, 2, or 3) and execute the corresponding movement instructions to navigate to that depot.
  • Each branch contains a comment block ("Move to depot 1/2/3") where you add your movement blocks.
  • Finish off the code by calling release to drop the cube.
10Complete Code
  • The full program: set constants, request depot number, move forward and grab, then deliver to the correct depot based on input, and release.

Tip: You can add tracks on the ground for the Rover to line-follow, or create maze walls to allow the use of the IR sensors for navigation.

Continue Learning

Activity: Forklift AttachmentRelated resourceActivity: Forklift AttachmentUse the forklift attachment to lift and stack Meloncubes into increasingly taller towers, timing the servo precisely to reach each height.

Activity: Digger and TipperRelated resourceActivity: Digger and TipperUse the digger and tipper attachments together to build your own construction site, load grain-like material, transport it, and dump it in a new location.

Activity: Seed PlanterRelated resourceActivity: Seed PlanterUse the seed planter attachment to start your own little garden, organise your layout and have the Rover precisely deposit seeds in soft soil.

← Return to Resources