Skip to content

The tool’s interface below is still in French.

mBot: avoiding obstacles

At what distance to react, which way to turn, for how long? Set it, run it, count the bumps.

Réglages

Cliquez dans l’arène pour ajouter un obstacle. Le faisceau vert montre ce que « voit » le capteur ; il devient rouge sous la distance de détection.

Programme


            

Les limites du vrai capteur

  • Portée : de 3 cm à 4 m environ ; en dessous de 3 cm, la mesure devient fausse.
  • Angle : il ne voit que devant lui, dans un cône étroit : un pied de chaise sur le côté lui échappe.
  • Surfaces : un mur de biais ou un tissu renvoie mal les ultrasons.
  • Réglage : plus le robot roule vite, plus il faut détecter loin, car il lui faut de la distance pour s’arrêter.
How it works

How to use the obstacle avoidance simulator

Set the detection distance, the direction and duration of the turn, then watch the virtual robot cross an arena while counting collisions.

  1. Set the logic

    A few parameters are enough.

  2. Run the simulation

    The virtual robot runs your program.

  3. Get the program

    mBlock blocks and Arduino code.

FreeNo subscription, no hidden limits.
No sign-upOpen the page and use the tool. That’s it.
InstantResults in seconds, on mobile too.
PrivateEverything runs in your browser.

About the obstacle avoidance simulator

The ultrasonic sensor measures the distance to the obstacle in front of the robot. The typical program: drive forward while the way is clear, otherwise back up and turn.

The simulation shows the effect of each setting: a detection distance that is too short at high speed causes crashes, a turn that is too brief brings the robot back facing the wall.

mbot obstacle avoidance mbot ultrasonic sensor mbot obstacle avoidance program mblock obstacle avoidance robot obstacle simulator mbot distance sensor code mbot simulator
FAQ

Frequently asked questions about the obstacle avoidance simulator

At what distance should it detect?

15 to 25 cm suits medium speed; increase it if the robot drives fast.

Do I need a robot to use the tool?

No. It exists precisely to prepare or test a program before loading it onto the mBot.

Are the blocks identical to those in mBlock?

Labels may differ slightly depending on the mBlock version; the logic and the Arduino code stay the same.

Esc
↑ ↓ navigateEnter open