NXT Trolly

ACTIVITY HEADER

 

 

 

Name of Activity NXT Trolly
Author Jay Clark
Keywords NXTs, cars, car, trolly, trollies, light sensor, loop, proximity sensor, sound sensor, threshold, switch
Subject NXTs
Grade Level 4, 5, 6, 7, 8, 9+
Time 2 Hours Total
Brief Description Students program their NXT cars to be trollies. The activity has three tasks.

(1) Using a light sensor, the trolly must follow the black tape loop that runs through the “town”

(2) Using a proximity sensor, the trolly must detect stations and stop for boarding.

(3) Using a sound sensor, the trolly must stop for townspeople whistling for the trolly.

Lesson Objectives: Programming with conditional loops and switches.
Determining and implementing multiple sensor thresholds.
Materials Needed: Pre-built NXT car and complete NXT kit.
Computers with Mindstorms NXT software.
Black tape for trolly track.
Boxes/Books/etc for trolly stations.
Extra LEGO people.
Preparation and Set Up: Set up a the trolly track with black tape in the classroom.
Place the trolly stations either all inside or all outside of the loop. (This is so the proximity sensor can be pointed to the right or left).
Necessary Background In order to follow a line, students will have to program their cars to repeatedly jump off and back on the line. In fact, they aren’t following the black line, but rather the line formed by the edge of the black tape and white floor. Students programs should consist of four blocks:
- Turn Right.
- Wait for Darker.
- Turn Left.
- Wait for Lighter.

Students will need to use a conditional loop or a switch to stop following the line at the station. A conditional loop will keep performing the line following functions until the distance threshold is breached. It will then move on to the next bit of code. A switch will make a decision about the program flow based on a sensor value.

Vocabulary:
Threshold – The sensor value that when breached, will trigger a wait for block or a conditional loop. (Some students have had a better time understanding it as a “benchmark”)

Switch – A program structure that makes a decision about which line of code to run next based on some criterion (time, sensor value, logic etc)

Procedure Introduction 10 minutes Review loops with the students and why they are useful in programs.

  • Loops allow us to repeat a set of commands that would otherwise be tedious to program over and over.

Sometimes loops should go on forever. Ask the students for examples they’ve done where loops go on forever. In more sophisticated programs, they should not. Ask if they can think of a situation in which you don’t want a program to go on forever. A conditional loop is a great way to end a loop exactly when you want it to end and move on to another task. Our brains use conditional loops all the time!

  •  When crossing the street, we look both ways. If its not safe, we do it again. We keep doing it until its safe, and then we cross the street.

Activity – 40 minutes If students haven’t done a line follower before, introduce the concepts using the line follower activity on the activities database. For the second task, students will have to use a conditional loop to look for the stations. After the loop, they should stop the car for 5 seconds. It’s important to note that you must drive past the station before you start looking for a new station. Therefore, there should be a loop with a counter on it, or another conditional loop to follow the line past the station before looking for the next one. For the third task, the students will have to use switches. First look at one of the sensors, say the sound sensor. If it detects a whistle, stop for five seconds, if not, look at the proximity sensor. If it detects a station, stop for five seconds. If not, continue following the line. Clean up/ Wrap up – 10 minutes

  • What was easiest? What was hardest?
  •  What would you have done differently?
  •  What were some good ideas you saw that other groups came up with?
Reference 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/a1.jpg
Reference 2 http://sites.tufts.edu/stompactivitydatabase/files/formidable/b5.png

Freeze Dance

ACTIVITY HEADER

 

 

 

Name of Activity Freeze Dance
Author Jay Clark
Keywords program, NXT, robot, dance, conditional, loop, conditional loop, sound sensor
Subject NXTs
Grade Level 4, 5, 6, 7, 8, 9+
Time 1 Hour Total
Brief Description Students program their NXT robots to dance! But wait! Using conditional loop structures, they must program their robot to stop dancing when the music stops, and start again when the music is turned back on.
Lesson Objectives: Learning about the conditional loop
Building for non-car NXT movement
Determining and implementing sensor thresholds
Materials Needed: NXT kit including a sound sensor
A source and means of amplifying music
Computers with NXT Mindstorms software
Preparation and Set Up: Clear a space in the classroom to serve as the dance floor, and mark it off with black tape (for the extensions). Set up your music system and find a volume that will register a readable sound level in the NXT.
Necessary Background A loop is a helpful programming structure that allows you to repeat a set of commands. But sometimes, you don’t want to loop forever. A conditional loop will repeat the enclosed actions until some other criterion is met. A loop can be set to run for a certain amount of cycles of the loop, for a certain amount of time, until a logic condition is met, or until a sensor threshold is broken. This activity uses the last criterion in conjunction with the sound sensor to stop the robot from dancing.

Freeze dance is a game the children play in which they must dance when the music is on, but freeze when the music is turned off. If they don’t stop, or cannot hold the position they were in when the music stopped, they are eliminated.

Vocabulary:
Threshold – The sensor value that when breached, will trigger a wait for block or a conditional loop. (Some students have had a better time understanding it as a “benchmark”)

Procedure Introduction 10 minutes Review loops with the students and why they are useful in programs.

  • Loops allow us to repeat a set of commands that would otherwise be tedious to program over and over.

Sometimes loops should go on forever. Ask the students for examples they’ve done where loops go on forever. (Simple tasks like line following, wall following). In more sophisticated programs, they should not. Ask if they can think of a situation in which you don’t want a program to go on forever. A conditional loop is a great way to end a loop exactly when you want it to end and move on to another task. Our brains use conditional loops all the time!

  •  When crossing the street, we look both ways. If its not safe, we do it again. We keep doing it until its safe, and then we cross the street.

Remind the kids or introduce them to freeze dance, and introduce the Activity. Activity 40 minutes Students should construct robots for about 15 minutes and program for at least 25 minutes. After 40 minutes is done. Put all the robots on the dance floor and start and stop the music. Clean up 5 minutes Wrap up 5 minutes

  •  What was easiest? What was hardest?
  •  What would you have done differently?
  •  What were some good ideas you saw that other groups came up with?
Extensions: Don’t bore us with those same old dance moves! Have the students’ robot switch up the dance moves after each pause.Programmatically, this involves an additional stop and a wait for sound block plus an additional looped dance sequence.

Allow students who finish quickly to explore the dance floor! have their robots move and groove while moving about the dance floor. Using their light sensor, they should detect that they’re about to leave the floor, and they should dance in a different direction. Programmatically, this would involve placing the dancing section of code in a switch or another conditional loop.

Don’t bump into other dancers! Using an ultrasonic distance sensor, detect fellow dancers and steer clear! Programmatically, this would involve placing the dancing section of code in a switch or another loop condition.

Modifications: Much of the programming could also be done with switches. Push for conditional loops if you want that to be the focus of the lesson.
Reference 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/b3.png
Reference 2 http://sites.tufts.edu/stompactivitydatabase/files/formidable/c.jpg

Think Like a Robot

ACTIVITY HEADER

 

 

 

Name of Activity Think Like A Robot
Author Esha John (Created by Chandni Sanariya and Laura Nixon)
Keywords human, robot, human robot, instructions, task, command, program, loop, instructions, 1 Hour Total
Subject Non-LEGO
Grade Level 4, 5, 6
Time 1 Hour Total
Brief Description This activity can be done as as introduction to ROBOLAB. It can be combined with a
simple programming exercise. It involves one instructor acting like a robot. The goal
of the activity is to give him/her clear and concise commands in order to complete a
simple task(example : following a line).
Lesson Objectives: To teach students how a computer/robot thinks. Thus, students learn how a
programmer must think in order to program effectively.
Materials Needed: black tape (for line following)

any other props (for different tasks)

Preparation and Set Up: If line following is the task that the human robot must be programmed to do,
mark a line of tape across the floor.

Other tasks might include walking in a square, staying in a box, etc.

Necessary Background Think of what kind of specific instructions might be needed to get a robot to perform
the chosen task. Brainstorm how it might react to inaccurate or incomplete instructions.

Vocabulary:
Program

loop

instructions

Procedure For Line Following Paste a line of tape across the floor. Explain to the students that a robot cannot think for itself and it needs very specific instructions from them the programmers. Give them a few examples of poor instructions. (Example: asking a robot to walk forward, without pointing it in a specific direction or telling it for how long it should walk forward). Enact how the robot will act after reading these poor instructions. Split the students into groups and ask them to make a list of instructions as detailed and specific as possible, which will make a robot follow the line of black tape on the ground. Have them test their instructions, by enacting how a real robot might respond to their instructions. Have them rewrite the instructions and retest them.

Wire Maze Challenge

ACTIVITY HEADER

 

 

 

Name of Activity Wire Maze Challenge
Author STOMP
Keywords Electrical Engineering, maze, loop, wire, current, switch, open circuit, closed circuit
Subject Non-LEGO
Grade Level 4, 5, 6
Time 1 Hour Total
Brief Description Students will be constructing a game made out of a simple circuit with a movable loop of wire that can be guided over a curved “maze” wire. The object of the game will be to guide the loop along the maze without touching the loop to the maze wire. If the student does touch the loop to the wire, the circuit will be complete, turning on the light bulb, and signaling the touch.
Lesson Objectives: - To teach students about electrical circuits.
- To teach students about electrical currents.
Materials Needed: Per Group:
- One 9V battery w/connection plate and attached wires.
- 24 inches of un-insulated wire (stripped insulated wire between 20 – 24 AWG should work).
- One 1-Watt light bulb w/ lamp base.
- One 24 inch length of insulated wire w/stripped ends.
- One 8 inch length insulated wire w/stripped ends.
- Electrical tape.
- Cardboard base (optional).
- Four alligator clips (optional).
- Popsicle stick or pencil.
Preparation and Set Up: - Show the first five slides of Powerpoint attached.
- Break the class into groups of two.
- Distribute worksheets and building materials.
Necessary Background Vocabulary:
Electrical current
Switches
Open circuit
Closed circuit
Procedure
  1. Connect 1 wire of the battery connection plate to the light bulb using an 8 inch strip of wire.
  2. Attach a 24 inch length of insulated wire to the other side of the light bulb. The end of the wire not connected to the lamp should be stripped of insulation for the last three inches of its length.
  3. Curl the stripped end of the long wire into a small loop approximately ½” across.
  4. Using electrical tape, create a handle for the wire ring by fastening the remaining wire to the end of a pencil or popsicle stick.
  5. Using a 24 inch strip of wire without insulation, create a looping and bending “maze” that the ring will have to follow.
  6. Put one end of your maze through the wire loop on the end of the popsicle stick, and then tape both ends to the cardobard base so that the maze sticks up into the air.
  7. Use a gator clip to attach the other terminal of the battery connection plate to the end of the maze. Leave one end of the un-insulated maze taped to the table with nothing else connected to it. You should now see that when your loop touches the wire path the light bulb turns on!. See if you can guide the loop along the maze without touching the wire and turing on the light.
  8. Discuss with the class why the light bulb only goes on when the loop touches the wire.
Extensions or Modifications: If you finish with the wire maze with extra time remaining, try to figure out a way to add an additional loop to the maze. There are two different ways to wire this circuit – you can either have the light bulb turn on when either one of the loops touches the wire, or you can have it turn on only when both loops are touching the wire. Draw your new circuit below using the electrical engineering symbols on the previous page.

The diagrams below are two possible approaches to this extension.

Modifications:
Hint:
Be careful not to connect the battery terminals together if there is no resistor in between
them! This creates what is known as a short circuit, and if left connected for too long will
quickly drain the battery.

Reference 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze1.png
Reference 2 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze2.png
Reference 3 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze3.doc
Reference 4 http://sites.tufts.edu/stompactivitydatabase/files/formidable/maze4.pdf

Line Follower

 

ACTIVITY HEADER

 

 

 

Name of Activity Line Follower
Author STOMP
Keywords car, light sensor, line, follow, loops, loop, ports
Subject and Grade Level NXTs, 4, 5, 6, 7, 8, 9+
Time 1 Hour Total
Lesson Objectives: - To learn to program using light sensors
- To learn to program using loops
- To practice building with an NXT kit
Materials Needed: - 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
Procedure
  1. 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?
  2. Have students build cars using NXT-G kits, or provide a pre-built car to each group.
    1. The light sensor should be pointed at the ground.
    2. Make sure the car can easily turn by attaching a skid plate or attaching a swivel wheel to the front of the car.
    3. Attach the light sensor to the front of the car.
  3. Have students program their cars.
    1. The car should follow a line using a light sensor.
    2. Program one motor to turn until the light sensor detects the line.
    3. Use the “Wait for” block to use the light sensor data.
    4. 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.
    5. Insert a loop around the program so that the car continually follows the line.
  4. Allow students to test their design on a tapeline on the floor.
  5. Tell students that they may redesign their car as this is an important step in the Engineering Design Process.
  6. When students have completed their cars have them fill out their final design sheets.
  7. 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.
Sample Image 1 http://sites.tufts.edu/stompactivitydatabase/files/formidable/60_image_2.jpg
Sample Image 2 http://sites.tufts.edu/stompactivitydatabase/files/formidable/60_image_3.png
Sample Image 3 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Line-Follower.pdf
Sample Image 4 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Building_Design_Sheet.pdf
Sample Image 5 http://sites.tufts.edu/stompactivitydatabase/files/formidable/Final_Design_Sheet.pdf

Switch to our mobile site