- To learn to program using light sensors
- To learn to program using loops
- To practice building with an NXT kit
- NXT Kit
- Solid colored floor or mat
- Tape that contrasts floor or mat
- Planning and Final Design Worksheets
- Computers running MINDSTORMS NXT-G Software
Preparation and Set Up:
- Set up a line for students car to follow
- Set up computers running NXT software
- Photocopy worksheets
- Arrange students in groups of two
- Distribute necessary materials
Have students plan out their design and program on paper before distributing materials. Help students think about the program by asking the following questions: How can the light sensor help you detect the line? What should happen when the car senses the line? What about when the light sensor detects the floor again? What is a loop? How will a loop be helpful in your program?
Have students build cars using NXT-G kits, or provide a pre-built car to each group.
The light sensor should be pointed at the ground.
Make sure the car can easily turn by attaching a skid plate or attaching a swivel wheel to the front of the car.
Attach the light sensor to the front of the car.
Have students program their cars.
The car should follow a line using a light sensor.
Program one motor to turn until the light sensor detects the line.
Use the “Wait for” block to use the light sensor data.
When the light sensor detects the line, have the first motor stop and the other motor turn until the light sensor detects the floor, at which point the second motor will stop.
Insert a loop around the program so that the car continually follows the line.
Allow students to test their design on a tapeline on the floor.
Tell students that they may redesign their car as this is an important step in the Engineering Design Process.
When students have completed their cars have them fill out their final design sheets.
Gather students together as a class and let each group share their car. Discuss the activity as a class.
Extensions or Modifications:
- Create a theme for the project such as “rounding the bases” so that the students cars have to do more than just follow a line.
- Have a challenge at the end of the line. For example, at the end of the line there is a box that the NXT car must pick up. Students must design a robotic arm to lift the box.