Before You Begin



What’s the point?

To help students understand that in order to get information from the environment, a robot must have both a sensor and a program set to accommodate and process information coming in through the sensors.

To help students understand that a program uses sensory input to make decisions about what to do next (e.g., If this input comes in, do one thing; if another input comes in, do something different).


What you will need:

   For each group:

·     The Robotics Inventions™ kit

·     A disk

·     A copy of the Technical Guide

·     Roverbot building instructions, Constructopedia, pages 12-17

·     A building bin (optional)

·     Student activity sheets



   For the class:

·     Transparencies # 2, 2A, and 3

·     One pre-built M. Pathfinder


Programs used StartTouch (to initialize an input port for touch); StopOnPres1; StopOnPres2 (found on the student activity sheets)   


Prepare Ahead:

1.       Make enough copies of the Working with Touch Sensors student activity sheets for each student to have one.

Download the StartTouch program into slot #5 of the M. Pathfinder you will be using for demonstration. This program must run at least one time before you can get touch sensor readings by using the View on the display window. (See Important Note in the box below.)

Return to Top

New commands introduced in this activity:


     Tech Guide        

    Tech Guide

    Tech Guide

     Tech Guide

     Tech Guide
© The LEGO Group








Activity Overview

In this activity you will first use a built M.Pathfnder to demonstrate the use of a touch sensor. Then students will build Roverbot and attach touch sensors to it. Roverbot is a four-wheeled, two motor vehicle, with a sturdy base designed to hold both light and touch sensor attachments.

This activity is designed to help students understand the advantages and flexibility sensors add to a system. In a class discussion, you will remind students of the problem they solved in the previous activity—making a robot move toward a wall, hit it, and go back—emphasizing that the programs they wrote were limited to a specific distance from the wall. When the distance changed, the program had to change too. Here, students realize the robot has no way of telling that it hit something. This provides a smooth transition to the introduction of a touch sensor—a device that can register when it’s pressed and when it’s released.

To introduce the touch sensor, you will connect it to a long connector wire and attach it to M. Pathfinder, Port 1. You will show students the pushbutton, explaining that it has three states, pressed, released and clicked.

You will then tell students that you want M. Pathfinder to keep going and to stop only when the sensor is pressed. Running it on program #1, you will press the sensor and have students observe that the robot is not responding to input from the sensor. You will then point out that in order to receive input from a sensor and to be able to decide what to do when it’s pressed or released, the robot must have a program to follow.

Next, you will have students build Roverbot, attach a touch sensor to it, and follow the activity sheet that will walk them through two programs with sensor blocks (Wait Until and Sensor Watcher). You will decide whether to introduce the sensor blocks to the entire class before they do the activity sheets or to have the students work in small groups first, following the activity sheet and trying to figure it out on their own. Transparency # 3 will help you guide a class discussion, highlighting the relationships between command blocks in different programs. This can be used as needed, either as an introduction or a summary (or both).

Finally, you will give students enough time to try to solve the RCXtra challenges. These problems give them an opportunity to apply newly introduced commands, and may inspire them to come up with their own problems to solve.



Programming for Sensor Input

Return to Top