Clean the Ocean
3 Minutes · Module 2 - Coral Reef Cleaner
VEX VR ocean cleanup robot simulation for kids teaches how to program a robot to detect and collect trash. A Tamil robotics lesson.
- Opening the Coral Reef Cleanup playground in VEX VR
- Using distance sensing blocks to detect trash while turning
- Adding drive forward and a forever loop to collect trash
What this lesson teachesRead the lesson as text
An ocean cleanup robot simulation uses automated robotic code to find and collect scattered trash in a virtual marine environment. It combines directional turning, distance sensing, and continuous loops to clear debris from an open surface.
The cleanup algorithm
The robot cleans an open aquatic surface by rotating continuously in one direction until it spots a piece of trash. Once its sensor detects an object ahead, the robot stops turning and moves straight toward that object to pick it up. By repeating this search and drive routine, the machine can clean up debris scattered in any direction across the ocean floor.
Blocks used for programming
- A turn right block makes the robot spin in a circle to scan the surrounding area for trash.
- A wait until block paired with the distance found an object sensor keeps the robot spinning until an item is detected.
- A drive forward block containing the distance in mm sensor block drives the robot forward by the exact measured distance rather than a default distance of 200 mm.
- A forever block encloses the entire code sequence so the robot repeats the detection and collection steps continuously.
Continuous cleanup with loops
Without a loop, the robot executes the sequence only once, collecting a single piece of trash before halting completely. Placing the code inside a forever block allows the robot to collect one item, immediately turn right again, detect the next piece of trash, and drive forward to collect it. This continuous repetition automates the full cleaning process across the playground.
Playground features
The Coral Reef Cleanup playground in VEX VR displays important real-time indicators, including the robot battery charge percentage and the total trash collected. The robot continues its cleanup loop across the playground as its power drains. When the robot charge reaches zero percent, the simulation finishes and provides a completion certificate, allowing the user to save the project to their device.
Part of the course
ROBOTIC SIMULATION