3. Cleaning


Our mBot doesn’t like his room to be messy.

Tidy everything up in less than a minute.

You get 30 minutes to programme your robot.

You'll learn how to:

•    Work with the proximity sensor.
•    Using an if-then-else function.

You'll be needing



Before you can begin, you should plot the course. Draw a 1 metre diameter circle on the floor or form one with adhesive tape. Indicate the centre so you know where to put the mBot. Next, set out a couple of cups for your mBot to push away. Challenge a friend, who tidies up the most cups?

To do:

  • Put your mBot in the middle of the circle and switch it on.
  • Tidy up as many cups as possible in one minute.
  • You’re not allowed to use the remote.
  • A cup is only tidied up if it’s outside of the circle.
  • As soon as it’s switched on, you’re not allowed to touch your mBot anymore.
  • You get 30 minutes to write and finalise your programme.


Which blocks can you use?

We’ll show you a few blocks that you’re going to need.


The mBot should circle around the centre until it sees a cup. If it sees a cup, it should stop.
Do you know how to combine the blocks? 

If everything goes well, your mBot is rotating and it stops when it spots a cup.
Now, it still has to push the cups out of the circle. To do that, you should drive forwards and then drive the same distance backwards.
Do you know what to do and where you should add the blocks?

This code will work, but maybe your mBot has to push the cups just a little further. Customise your programme and be sure to test it out!!!
If you want to push away more cups, you should amplify the power.



You can add as many assignments as you want. We’ll name a few, but please do use your own imagination.

  • Put your mBot on the table and let it push off the cups without falling off itself.
  • Make a second circle outside of the first one, the cups can't be pushed out of the outer circle.
  • If your mBot has pushed away all of the cups in less than one minute, you can always add new cups to the circle.
  • ...


Don’t hesitate to let us know some of your ideas.
Have fun!!!