Instruction Guide: Move Until Sound

In this lesson, students learn to work with the sound sensor and revisit calculating thresholds.

Have students work through the self-paced  "Move Until Sound" lesson from the "Behaviors" page in "NXT Video Trainer 2".

Students should be able to answer all the review questions and the end of each step in the video lesson and end up with a solid command of each parameter in the Wait-until-Sound block configuration panel.

As students progress through, have them document their milestones in the Move Until Sound Task Assignment sheet.

The "Clapper Challenge" in Step 11 will likely result in most students' first attempt to fail:

  • A Wait-for-Sound (loud), Move-unlimited, A Wait-for-Sound (loud), Stop type of program will not work as expected.
    • The culprit is that the Move-unlimited block only takes a few milliseconds to run, then the program moves to the next  block - another Wait-until-Sound (loud). 
    • Since the the clap that triggered the first Wait-unit-Sound block will linger in the air longer than the the Move-unlimited block takes to run, the second Wait-for-Sound block will also respond to the first clap.  The robot will likely not move at all (depending on how the students have configure their "stop").
  • Most students, once they figure out what the problem is, will first attempt to fix this by placing a Wait-For-Time block after the Wait-For-Sound or Move block.  While this will appear to work, it will fail to detect two claps separated by less time than the Wait-For-Time setting.
  • A more robust solution is to place a Wait-for-Sound (quiet : i.e. < threshold) after the first Wait-for-Sound (loud) block.  This way the first clap will have "died out" before the robot begins listening for a second clap.
    • Note, however, "quiet" will not be as quiet as the student measured in View Mode to calculate their threshold - because the motors are now running.
    • As result of this, the threshold when listening for the second clap is higher than the first (background noise level now includes the motor noise).  This cannot be measured directly in View Mode since the motors cannot be running while in View Mode.  Choose a higher threshold or set it at 100 if the "clap" is at least this loud.
    • Make sure the sound sensor is mounted high above the motors to prevent their noise from exceeding the threshold.

The teacher has the final sign-off on this sheet. Key learning to check for during your sign-off includes:

Understanding that the sound sensor is actually a "loudness" sensor:

  • It responds to the level of sound, not its frequency/pitch

Calculating a sound sensor threshold

Understanding each parameter in the "Wait until Sound" block

  • Particularly the "Until" section (how to set the threshold)

Understanding their program

  • Ensure each team member can explain the program
  • How did they solved the Clapper Challenge, particularly the double-counting of a single clap problem
  • Have team members explain the cause of the double-counting of a single clap problem
  • Good use of comments in program