|Name of Activity
||NXT, car, touch sensor, maze, switch blocks, decision statement
||4, 5, 6
||1 Hour Total
||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.
||- To learn to program with touch sensors and use decision statements “Switch Blocks”.
||NXT car or materials to build an NXT car
Two touch sensors and long wires per car
Assortment of extra LEGO pieces
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.
Arrange student into groups of two.
Distribute necessary materials.
- Switch block.
- Decision statement.
- 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?
- Give students pre-built models or have students build a two-motor car using and NXT brick and two NXT motors.
- 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.
- Have students program their two-motor cars:
- Students should recognize that they have two touch sensors attached to two ports.
- Both touch sensors need to be able to work at the same time so two paths should be created.
- 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).
- 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
- 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.