Maze Competition





Name of Activity

Maze Competition




NXT, car, touch sensor, maze, switch blocks, decision statement



Grade Level

4, 5, 6


1 Hour Total

Brief Description

Students will construct an NXT car and program the car to be controlled by two touch sensors. Students will drive their car through a maze.

Lesson Objectives:

– To learn to program with touch sensors and use decision statements “Switch Blocks”.

Materials Needed:

NXT car or materials to build an NXT car

Two touch sensors and long wires per car

Assortment of extra LEGO pieces

Tapeline Maze

Planning Sheet and Final Design Sheet (attached or make your own)

Computer running MINDSTORMS NXT-G Software

Preparation and Set Up:

Construct one or more maze(s) for students to use for their NXT cars.

Photocopy worksheets.

Arrange student into groups of two.

Distribute necessary materials.

Necessary Background


– Switch block.

– Decision statement.


  1. Have students plan out their design and program. Ask students questions to help them plan: How will students make their car so it turns easily? What makes a car turn in a computer program? What response should the car have when one touch sensor is pressed? What response should the car have when both sensors are pressed?
  2. Give students pre-built models or have students build a two-motor car using and NXT brick and two NXT motors.
  3. Have students wire two different touch sensors to the car using long wires. The sensors should not be directly attached to the car because the students will hold the sensors to direct the car.
  4. Have students program their two-motor cars:
    1. Students should recognize that they have two touch sensors attached to two ports.
    2. Both touch sensors need to be able to work at the same time so two paths should be created.
    3. You want two responses from the touch sensors. You can get these two responses from a decision statement, or “switch” block (if pressed then response 1. If released then response 2).
    4. The Switch blocks will need to be contained within a loop or else the NXT brick will only look for a response once and the program will end instantaneously.

  • Allow students to test their designs in the maze you have set up.
  • Remind students that they may redesign their cars and programs if they do not complete the maze.
  • Optional: have a prize at the end of the maze.
  • Extensions or Modifications:

    – Create a maze that has a different challenge that will require further design

    changes in the car or program (ramp, narrow section, line that students must

    stop on).

    – Use light sensors to navigate a maze (similar to line following activity).

    – Use the proximity sensor to navigate through a maze made out of cardboard boxes.


    – Use only one sensor to make car drive forward and stop.

    Reference 1

    Reference 2

    Reference 3

    Reference 4

    Reference 5

    Page 1 of 2 | Next page