Chitti app logo

Chitti is better in the app

Coins, streaks and builds — free on Android & iOS

Get the app
Chitti logoChitti

Sensors

5 Minutes · Module 2 - Vacuum cleaning Robot

VEX VR robotics for students: Learn how to program a robotic vacuum cleaner using distance sensing blocks. A Tamil robotics simulation lesson.

  • Setting up the vacuum cleaner logic on the Art Canvas playground
  • Using wait until and distance sensing blocks to detect walls
  • Adding random turn angles and a forever loop to run continuously
What this lesson teachesRead the lesson as text

A robotic vacuum cleaner uses distance sensors and navigation algorithms to navigate an enclosed room, detect obstacles, and clean the entire floor area. In robotics simulations like VEX VR, an empty Art Canvas playground serves as a room to test this automatic cleaning logic.

The cleaning algorithm

  • The robot starts by driving forward in a straight line across the room.
  • It constantly measures the distance between its sensor and the approaching wall.
  • When the distance to the wall becomes less than 100 millimeters, the robot stops moving forward.
  • The robot turns right by a random angle and drives forward again to explore a new path across the room.

Programming the sensor blocks

  • A drive forward block from the drivetrain category sets the robot in motion.
  • A wait until block from the control category holds the next action until a condition is met.
  • A less-than block from operators checks whether the distance in millimeters from distance sensing is less than 100 millimeters.
  • A turn right block from drivetrain is paired with a pick random block from operators set between 1 and 180 degrees to produce unpredictable turn angles.

Running continuously with loops

Running these commands only once makes the robot turn once and stop permanently. Placing the driving, waiting, and turning blocks inside a forever block from the control category makes the robot repeat the sequence endlessly. Each time the robot reaches within 100 millimeters of a wall, it picks a new random angle, turns, and continues driving, which allows it to cover the entire ground.

Monitoring and saving the project

Different camera perspectives, such as the top view and front view, help observe how the robot detects walls and shifts direction. The simulation display also shows operational data, including the robot coordinates and current rotation angle. Once the program works properly, choosing save to your device from the file menu downloads the project file so it can be reopened and upgraded later.

Part of the course

ROBOTIC SIMULATION

View course →