Introduction to Sensors

Name of Activity

Introduction to Sensors




NXT Robotics, sensors, ultrasonic sensor, light sensor, sound sensor, touch sensor, beginning robotics, programming, introduction to NXT, introduction to Mindstorms, introduction to programming



Grade Level

4, 5, 6, 7, 8


2 Hours Total

Brief Description

An introduction to robotics would be incomplete without imparting a basic understanding of how robots perceive their environment and react to it. Discuss the function of sensors and introduce the “wait for” block. Give the students a set of simple challenges to practice programming with one of the 4 sensors.

Lesson Objectives:

  • Understand the concept of a sensor and where they are found in the natural world.
  • Understand the “wait for” command and programming with sensors

Materials Needed:

  • 8-12 NXT Kits
  • Computers w/ Mindstorms
  • Other demonstration equipment (i.e. paper programming blocks, tennis ball)

Preparation and Set Up:

  1. Decide what functions of the NXT will be most useful for your class. Do you want them to know how do use a particular sensor? How to steer the robot? How to make the NXT make noises? Then, create a list of ~8 challenges that target these areas of Mindstorm programming . Create the challenges so that harder challenges only require the students to change 1 or 2 parts of their program. That way they will see the direct connection between the change they made and the robot’s actions. They will also feel accomplished if they are able to complete more challenges. (see example for the touch sensor)
  2. You may have the students pre-build a car, but the activity can also be done by programming other things (e.g. an NXT arm). If the students haven’t built anything, you can bring in 2-4 pre-made cars for the students to share.

Necessary Background

  • STOMPer must have experience programming NXTs with Mindstorms
  • Students must have some previous understanding of programming (see Human Robot), maybe some experience programming without sensors.


  1. Discuss what sensors are, where they exist in the real world, and parallels to human senses. Move to specifically discussing the sensor you are going to focus on. Explain the sensor in greater depth (see this tip for ultrasonic sensors). (5 min)2- Introduce the “wait for” block. Use large blocks or a projector to program as a class (see this tip for programming as a class). (5 min)
  2. Have students pair off. One student acts as the robot, doing what the program instructs it to do. The other student interacts with the robot. For example, if you are focusing on the ultrasonic sensor, one student will put his/her hand close to the robot student’s eyes, as though triggering the ultrasonic sensor. The robot student then does as the program says. Change the program and have the kids switch roles. (10 min)
  3. Now distribute the NXT kits and robots from the previous class. Give students the remainder of the hour to modify their robot and add the chosen sensor. (25 mins, this may be a good time to break for next class)
  4.  Assign the challenges, to be done in order. You can either hand out a worksheet or write them on the board. When a group completes a challenge, have the group demonstrate the challenge to one of the STOMPers so that s/he can sign off. 

Extensions or Modifications

Page 1 of 2 | Next page