Explorer: Recognizing colors

The lesson teaches how the eXperiBot recognizes colored markers and performs appropriate actions based on them.

eXperiBot moves along a black line on a white surface. There are green, blue, and red markings on the line.

Learn how to tell your eXperiBot to recognize colors and perform specific actions.

Explorer, Smart Team 7. to 8. Medium

Model solutions

Unit 1

No program code is required for this unit. You just need to make the eXperiBot ready to start, which means:

  • Assemble the eXperiBot completely

  • Establish a connection to the app

  • Draw or stick a black line with green markings on the floor

Unit 2

First, attach the Multisensor to the front bottom of the eXperiBot. The Multisensor’s module LED should then light up blue.

Model solution: Unit 2 (Recognizing colors)

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

Unit 3

Model solution: Unit 3 (Recognizing colors)

Solution file to 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

Show your eXperiBot which way to go—draw your own line with green markers.

Plan the green markers directly. Don’t draw a continuous line, but leave 2 cm gaps for the green markers.

  1. Prepare the line: Take a black pen and draw a straight line with gaps on a large, light-colored piece of cardboard.

    The line should be at least 3 cm wide and at least 50 cm long.

    Or: Use black tape and stick a straight line with gaps on the floor.

  2. Add colored markers: Color the gaps green.

Use the picture as a guide so that your line and the green markers are clearly visible.

eXperiBot sits on a white surface directly next to a black line. There are several green markings on the line. Next to the robot is a white pen with a green cap. A length of 2 cm is marked on the green markings.
Step 4

Unit 2

You have already learned about the Multisensor in the lessons “Avoiding obstacles” and “Line follower”.

You learned how it recognizes objects and how it measures brightness.

This ability enables your eXperiBot to avoid obstacles and follow a line.

But the Multisensor can do even more: it also recognizes the color of a surface.

Knowledge update: the Multisensor for color recognition

The Multisensor uses color filters to distinguish colors.

If a lot of light reaches the green filter and only a little reaches the other filters, the sensor recognizes that the surface is green.

Attach the Multisensor to the front bottom 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 indicates where you should attach the Multisensor 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

Your eXperiBot must first follow the black line reliably as a line follower so that it can recognize the green markers correctly.

To do this, use your program from the “Line follower” lesson and adapt it.

If you have not yet completed the “Line follower” lesson, first create a program that allows your eXperiBot to follow the black line. You can find tips in the “Line follower” lesson.

Open your “Line follower” program.

Copy the code and paste it into the editor here.

Step 2
Hint: Line follower

With this program, your eXperiBot follows the black line until both IR sensors detect a white surface. Then your eXperiBot knows that it has reached the end of the line.

Now your eXperiBot should follow the line until it detects the color green.

Adjust your “Line follower” program. Use a suitable block from the “Multisensor” category.

Tip

Your eXperiBot repeats the Line follower statements until its Multisensor detects a green marker.

As soon as the Multisensor sees green, the repetition stops.

Step 3

Test your program by placing your eXperiBot at the start of your line.

Make sure both IR sensors of the Multisensor are aligned at the start.

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

Check whether your eXperiBot follows the line and stops before a green marker.

If not, adjust your program.

Tip

Change the condition in the following block and test your program again.

eXperiBot sits on a black line directly in front of a green marker. The line has additional green markers at several points.
Step 4

Your eXperiBot will now follow the line until it reaches a green marker.

Now your eXperiBot needs to know what to do when it stops repeating—i.e., when it is in front of a green marker.

First, make your eXperiBot play a sound, then move it forward over the green marker so it returns to the dark line.

To do this, add the appropriate blocks from the “Powerbrain” and “Multisensor” categories to your program.

Tip

When your eXperiBot detects a green marker, the repetition stops.

So think about where your newly inserted blocks need to be placed.

Tip

Your eXperiBot should only move forward a short distance. In doing so, it will cross the green mark, allowing its Multisensor to detect the dark line again. Only then can the eXperiBot continue to follow the line.

Step 5

Test your program by placing your eXperiBot at the start of your line.

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

If your program is working correctly, your eXperiBot will play a sound at the green marker and then move forward to the dark line.

Step 6

Now your eXperiBot should not only execute these statements once, but repeatedly—i.e., every time it encounters another green marker.

Adjust your program accordingly.

Tip

Think about how your eXperiBot can execute the statements repeatedly. To do this, you need a block that repeats all statements over and over again.

Step 7

Test your program. To do this, place your eXperiBot at the start of your line.

Check whether your eXperiBot follows the line, plays a sound at a green marker, and then continues on its way. Make sure that your eXperiBot repeats this process until it reaches the end of the line.

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

Let your eXperiBot drive forward over the green mark for just a brief moment.

Step 8

Your eXperiBot follows the line, plays a sound at the green marker, and then continues on its way. It reliably repeats this until it reaches the end of the line.

eXperiBot travels along a black line on a white surface. Green markers appear at several points along the line, and small note symbols next to them indicate that eXperiBot should play a sound at those points.
Step 9

Unit 3

Draw a new black line.

Or extend your existing line.

Add colored markers in red, blue, and green to the line.

eXperiBot stands next to a black line on a white surface. The line contains red, blue, and green markings. Three pens lie next to the line.
Step 1

Add to your existing program so that your eXperiBot follows the line until its Multisensor detects red, blue, or green.

To do this, insert the appropriate blocks from the “Logic” and “Multisensor” categories.

Tip

Your eXperiBot should follow the black line until it detects red, blue, or green. As soon as the Multisensor detects red, blue, or green, the Loop stops.

Tip

You can also simply place the block several times in a row.

Step 2

Your eXperiBot already knows that when it detects a green marker, it plays a sound and moves forward briefly over the green marker.

You still need to program how your eXperiBot should react to blue and red.

  • Blue marker: Your eXperiBot rotates once around itself.

  • Red marker: Your eXperiBot also rotates around itself and plays a sound.

In order for your eXperiBot to respond appropriately to colors, you need a block from the “Logic” category.

Tip

The block you are looking for only executes a statement if the condition is true.

Step 3

Here’s a reminder - this is how your eXperiBot should respond:

  • Green marker: Your eXperiBot plays a sound.

  • Blue marker: Your eXperiBot rotates once around itself.

  • Red marker: Your eXperiBot also rotates around itself and plays a sound.

Now add the appropriate conditions and statements to your Conditional branch.

Use the appropriate blocks from the “Multisensor” and “Powerbrain” categories.

Tip: Conditional logic

A Conditional statement helps your eXperiBot make decisions. The block only executes a statement if the condition is true.

Tip: Make a complete rotation

A rotation around itself means that your eXperiBot turns completely in a circle. This corresponds to 360°.

Step 4

After your eXperiBot executes its statements for green, blue, and red, it should move forward briefly. This will bring it back to the black line.

Add this to your program accordingly.

Step 5

Test your program by placing your eXperiBot at the start of the line.

Check whether your eXperiBot follows the line and reacts correctly to the colored markers:

  • Green: play a sound

  • Blue: turn around once

  • Red: turn and play a sound

Make sure your eXperiBot travels to the end of the line.

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

Your eXperiBot follows the black line and reacts correctly to all colored markers.

eXperiBot travels along a black line on a white surface. Green, red, and blue markings appear at several points along the line.
Step 7

Bonus unit 1

Think about your own actions that you want your eXperiBot to perform at the colored markers.

Adjust your program.

Tip

Here are a few ideas for your own actions: for example, changing speed, driving backwards, turning twice, playing a special sound, or driving fast or slow.

Step 1

Test your program. To do this, place your eXperiBot at the start of your line.

Check whether your eXperiBot follows the black line and reacts correctly to the colored markers.

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

Your eXperiBot follows the black line and reacts correctly to all colored markers.

eXperiBot travels along a black line on a white surface. The line features green, red, and blue markings at several points.
Step 3
eXperiBot Documentation eXperiBot Documentation Version 1.1.4 (Latest)
Made with by the eXperiBot Team © 2026 Cornelsen Experimenta GmbH