Explorer: Avoid obstacles

The lesson teaches how the eXperiBot explores its environment and independently avoids obstacles.

eXperiBot sits on a light-colored surface with a yellow ball next to it.

Learn how to explore your surroundings with your eXperiBot while avoiding obstacles.

Explorer, Smart Team 5. to 8. Easy

Model solutions

Unit 1

No program code is required for this unit. You must simply prepare the eXperiBot for operation, which means:

  • Assemble the eXperiBot completely

  • Establish a connection to the app

Unit 2

Model solution: Unit 2 (Avoiding obstacles)

Solution file for download and import into the eXperiBot Blockly app.

Lesson contents

Unit 1

Assemble your eXperiBot.

The assembled eXperiBot.
Step 1

Connect your eXperiBot to the app.

Proceed as follows:

  1. Switch on your eXperiBot.

  2. Then press the “Connect” button at the top right of the screen. Follow the instructions to connect your eXperiBot to the app.

A green button labelled with “Connect”.
The “Connect” button
The Powerbrain’s control panel with a blue status LED.
The Powerbrain’s status LED lights up blue. Your eXperiBot is connected to the app.
Step 2
The assembled eXperiBot. The Powerbrain’s status LED lights up blue.

You’ve assembled your eXperiBot and connected it to the app—now you’re ready to go!

Step 3

Unit 2

In order for your eXperiBot to drive like a modern car, it needs sensors. These help it to avoid obstacles in its surroundings.

Your eXperiBot then reacts appropriately. If something is in the way, for example, it automatically swerves out of the way.

The following module is called Multisensor.

A black, cylindrical building block with several built-in sensors.

This Multisensor enables your eXperiBot to detect objects or avoid obstacles.

Knowledge update: the Multisensor for object recognition

The Multisensor emits invisible infrared light (IR light).

When this IR light hits an object, it is reflected back to the Multisensor.

  • If a lot of IR light is reflected back, the object is close.

  • If little or no IR light is reflected back, there is no object or it is further away.

This light signal allows the Multisensor to detect whether there is an object in front of it and how far away it is.

Light-colored objects reflect more light and are therefore detected earlier and more clearly than dark objects.

Attach a Multisensor to the front of the eXperiBot in the direction of travel.

The image shows how to assemble the eXperiBot. On the left, you can see a black cylindrical part, the Multisensor. A green arrow shows where the Multisensor should be attached to the eXperiBot. On the right, you can see the finished robot with two large Wheels, white and red cube-shaped modules, and the new black Multisensor.
Step 1

If you want your eXperiBot to explore the room for as long as you like, these statements must be repeated over and over again.

To do this, drag the appropriate block from the “Loops” category into your editor.

Tip

If something needs to be repeated over and over again, you need an “infinite repeat” Loop.

Step 2

Your eXperiBot should move forward for as long as you want.

To do this, select a suitable block from the “Motor” category.

Insert the block into the “Repeat forever” block.

Tip

Your program could now look like this:

Step 3

Test your program by placing your eXperiBot on the floor in your room.

A green oval button with a white triangle and the text “Run program.”

Change the time and speed.

Observe how these changes affect your eXperiBot’s driving.

Step 4

Your eXperiBot explores the environment.

Your eXperiBot crashes into obstacles.

When your eXperiBot detects an obstacle, it should drive backwards.

The statement “drive backwards” therefore executes only when the eXperiBot detects an “obstacle”.

To do this, insert a suitable block from the “Logic” category in the correct place in your program.

Tip: Which block fits here?

You need a block that only executes statements if your eXperiBot detects an obstacle.

Knowledge update “if-do” block

What is an “if-do” block?

This block only executes statements if a certain condition is true.

This is called a conditional block.

With a conditional block, you can control the flow of your program using conditions.

A condition can only be true or false.

If the condition is “true”, the program executes the statements; if it is “false”, the program skips them.

This feature lets your eXperiBot respond appropriately to different situations.

When do you need the “if—do” block?

Use it whenever you want your eXperiBot to respond differently in a situation:

  • If the condition is true, your eXperiBot executes the statement.

  • If the condition is false, your eXperiBot does not execute the statement.

How do you insert the “if—then” block?

Drag the “if—do” block from the “Logic” category into your program.

The image shows a blue programming block. The block says “if … then …”. The condition is entered in the field after “if”, and the statement that is executed when the condition is met is entered in the field after “then.”
  1. Top: Condition

  2. Inside: Statement

Tip: Where does the block go?

When your eXperiBot detects an obstacle, it should drive backwards. At the beginning, your eXperiBot checks whether there is an obstacle. This check is repeated continuously.

Step 5

The Multisensor can avoid obstacles. To do this, add a suitable condition from the “Multisensor” category to your program.

Tip

The Multisensor detects an obstacle as an object.

Tip

The “if-do” block executes a Statement if a condition is true.

  1. Condition

  2. Statement

A blue programming block that executes a statement when a certain condition is met.
Step 6

What statement should your eXperiBot execute when it detects an obstacle?

To do this, add a suitable statement from the “Motor” category to your program.

Tip

If your eXperiBot only moves backward, that’s not enough. When it moves forward, it will bump into the obstacle again. You need a block that changes the direction of your eXperiBot—for example, “Motor drive a right backward curve”.

Step 7

Test your program. To do this, place your eXperiBot back on the floor in your room. Place an obstacle on the floor at a slight distance, such as your backpack or a ball.

A green, oval button. The button has white lettering that reads, “Run program.”

Does your eXperiBot avoid the obstacle? If not, adjust your program and try again.

Tip

Check the condition and the statement in your “if-do” block again.

Step 8

Your eXperiBot explores its surroundings and avoids obstacles.

An eXperiBot stands in front of a backpack.
Step 9

Unit 3

Modern cars use distance sensors to avoid obstacles early on.

The IR sensor in your eXperiBot’s Multisensor works in the same way to detect objects in front of it.

You can use the sensitivity setting to adjust the distance at which the IR sensor reacts.

Change the sensitivity in the block and test different values.

Try out very small and very large values. Test your program after each value.

A green, oval button. The button has white lettering that reads, “Run program.”

Observe: How does your eXperiBot behave at very low and very high sensitivities?

Tip

Start with 100%—this is the normal value.

Change the sensitivity in small increments, for example, 20%, 50%, 150%.

Use a clearly visible obstacle, such as a pencil case.

Step 1

Compare the results of your tests and decide which sensitivity works best.

Consider: At which value does your eXperiBot avoid obstacles best?

Complete the following in your mind:

  • The higher the sensitivity value, the…

  • The lower the sensitivity value, the…

Step 2

Your eXperiBot now avoids obstacles at exactly the right time because you have tested and adjusted the sensitivity settings.

An eXperiBot facing a tennis ball.
Step 3

Unit 4

Cars use warning signals.

When a car detects an obstacle, warning lights flash or it emits a sound. This quickly alerts the person behind the wheel.

Your eXperiBot can do something similar: it can play a sound before avoiding an obstacle.

When your eXperiBot detects an obstacle, it should play a sound before avoiding it.

To do this, add a suitable block to your program.

Tip

Pay attention to the order of your blocks: first the sound, then the dodge.

Step 1

Test your program. Run your eXperiBot and observe:

  • Does the sound play every time?

  • Can you hear the sound clearly?

  • Does your eXperiBot swerve correctly afterwards?

A green, oval button. The button has white lettering that reads, “Run program.”
Step 2

Your eXperiBot plays a sound before it dodges the obstacle.

An eXperiBot sits on a white surface. To its left lies a yellow tennis ball. A black musical note appears between the robot and the ball.
Step 3

Bonus unit 1

Work with a partner. You need two eXperiBots.

Place your eXperiBots on the floor. Leave enough space between them and align them so that they are facing each other. The two Multisensors should be pointing towards each other.

Two eXperiBots on a light-colored floor. The two eXperiBots are positioned a short distance apart and are turned so that they are facing each other.
Step 1

Test your “avoid obstacle” program. Check whether your eXperiBots recognize each other and avoid each other when they approach each other.

A green, oval button. The button has white lettering that reads, “Run program.”

Does your program work in this situation? Adjust it if something is not working yet.

Hint

Adjust the sensitivity of the Multisensors. Experiment to find the settings that work best so that your two eXperiBots can detect each other.

Step 2

Your eXperiBots recognize each other in good time and safely avoid collisions.

Two eXperiBots on a white surface. The eXperiBots are positioned some distance apart and are turned so that they face in opposite directions.
Step 3
eXperiBot Documentation eXperiBot Documentation Version 1.1.4 (Latest)
Made with by the eXperiBot Team © 2026 Cornelsen Experimenta GmbH