Subject Area(s) Math, Science Associated Unit Robotics Associated Lesson Activity Title Lights and Music Grade Level (6 - 12) Activity Dependency Students who have basic NXT programming experience, as the concepts covered in this lesson do not require advanced skills. Students will need to understand how to use light sensors to differentiate between white and black through the use of a simple switch function, but students will not need to know how to follow a line. Time Required 90 minutes Group Size 4-5 Expendable Cost per Group US$___ Summary Today's class is designed around familiarizing students with the display and sound functions of the NXT brick and examining how those functions can be tied into other programming elements such as the use of sensors and the use of sound/display functions to inform programmers which part of a program or switch their robot is in. We will conclude the class with a discussion of advanced applications of sound and display blocks and a reflection on what the group learned from the day’s lesson. Engineering Connection This lesson touches on basics of programming in that it helps students understand the linkages between differing inputs and outputs of a program, where an input (in this case, the light sensor) can instruct the robot to produce a particular type of output (in this case, a sound or display element). Also, the use of a light sensor will provide students exposure to basics of light and optics (as reflected light will be the basis of the light sensor’s reading), as well as basic math concepts such as calculating averages. Keywords/Icons The Sound and Display blocks are located on the Common palette. MyBlocks are located on the Custom palette. Once created, the can be opened and edited in their own tab. Educational Standards NC science: 2.02 NC math: 1.01 Learning Objectives After this activity, students should be able to: Students should know the difference between inputs and outputs Students should know how to combine both input and output functions of the NXT robot. Students should be able to apply to their own programs. Materials List Each group needs: Computer with Mindstorms NXT v2.0 Taskbot or similar robot equipped with a light sensor Student Worksheets Introduction / Motivation (10 mins) Although perhaps the most critical capability of a robot in NXT is its ability to move, the ability for the robot to display words or images on its screen or emit sounds is also of great importance in NXT programming. To begin, discuss with students the general applications of displays and sounds in robotics and related fields, then the potential applications for how sounds and display functions could be useful in NXT programming. Corresponding questions will be included on the students’ worksheets for them to fill out as the discussion progresses. Sounds and displays allow a robot to provide sensory feedback to programmers, and well placed sound and display blocks can inform a programmer when the robot is performing a certain task or function embedded in their program. In the case of a dance team that has used a series of “My Blocks” to program each group member’s dance move, a display block placed at the beginning of each My Block can indicate at any given time during the program which “My Block” the robot is running. Sounds can be used the same way. Ask students for other suggestions of how these blocks can be used beyond their basic applications of making noise or displaying an image, and if possible try to guide them along to the application we will be exploring in greater detail later in the lesson – tying display and sound outputs to sensor inputs from NXT sensors like light sensors. Vocabulary / Definitions Word Definition Procedure 1. Introduce students to Sound/Display capabilities of the NXT (20-25 Minutes) After going over the potential applications of Sounds and Displays, have your students open the NXT software and begin to play around with the blocks that control those functions. Sound Block and Menu Display Block and Menu After a brief introduction of how to manipulate these blocks, allow students to write basic programs calling for the robot to display a short phrase or image, then make a sound. Have students upload their program to the Taskbot and run the program to see it in action. Ample time should be provided so that each student can create and test his or her own program. A sample program could look like this: 2. Linking Display/Sound Blocks to other Programming Applications (35 Minutes Total) As mentors should have touched on in the introductory portion of the lesson, we now want to instruct students how to link display/sound blocks to other programming functions. Although there are virtually no limits to the different applications that can be made between these blocks and other functions, we will focus our efforts on two key applications – 1) the use of display/sound blocks to inform students of what portion of a program the robot is executing and 2) linking a display/sound to a robot’s light sensor, so that the robot will make a noise or display a phrase/image when the robot detects a black line. a) Display/Sound blocks to indicate program progress (15 of 35 Minutes) In RoboCup competitions like dance, the use of “My Blocks” are good ways to divide up individual dance moves or segments of a routine so that students can each contribute an individual contribution to the routine as a whole. By embedding a display function at the start of a “My Block,” students can put a “signature” of their move to be displayed on the robot’s screen while it executes their portion of the program. Have students briefly discuss the utility of using displays in this way and record answers on their worksheets, then have each student independently sketch out a brief dance move on their worksheets that contains two or three distinct movements of the robot. Have the students then program each of their moves using the NXT software and save them as “My Blocks.” Students should be instructed to each place a display block at the front of their “My Block” that spells out their name or displays an image of their choice. One student should then link each of the group’s “My Blocks” into a single program and test it. A sample “My Block” is shown below: b) Display/Sound blocks linked to Light Sensor (20 of 40 Minutes) In RoboCup competitions such as Rescue, one of the most critical functions a robot needs to perform is to be able to sense an obstacle or person to “rescue,” stop and make a sound indicating that they have found the person to be “saved.” Therefore, this portion of the lesson plan will cover a basic switch function that will tell the robot to stop if its light sensor detects a black line, then make some sort of noise upon encountering the line. Students should be familiar with basic switch functions, so ask students to write and discuss how we might be able to achieve this goal and lead them towards the outcome of using a switch. Then, have students independently design a basic program that tells the robot to stop and make some sort of noise if it encounters a black line. The mentor should lay down a strip of black tape at least 2 feet long, then have students test the light values of black and white in the classroom and come up with an average value on their worksheets. Their program should consist of a simple light sensorbased switch calibrated to the specific light values in the room, with the “White” portion of the switch instructing the robot to move forward while the “Black” half of the switch should instruct the robot to stop, then use a sound to indicate that the black line had been reached. Once the program is complete, have students test out their program using the black line laid out on the floor. A sample of a possible model program appears below: 3. Wrap-up: Discussion of Advanced Applications, Reflect ion Discussion Questions (10 Minutes) As a concluding activity, mentors should discuss other methods of tying sensors to display/sound functions than simply the use of a basic switch function. One method that mentors should cover in this quick discussion is the use of range values, where a Light Sensor block from the advanced template can be used to collect a value. That Light Sensor block can then be connected with a data wire to a Range Value block, where a defined range of light values can be set for colors that yield readings not as low as black but not as high as white, such as Green. A quick sample program of this sort is below, explain to students how data wires and range functions work as they likely have not had previous experience with these more advanced blocks: After a brief display of this programming technique, mentors should lead a group reflection discussion using the questions listed on the worksheets handed out to team members. Have each student write down the answer to their reflection question on the handout, and collect all handouts when the reflection discussion is complete. After discussion, make sure that the area is cleaned up, and students can then be dismissed for the day. 4. Exhibition (5 Minutes) Students should show their dance moves to their partner team. If the robot was not able to complete that portion of the test plan, the students should explain what is in their 'My Blocks' and theorize why it did not work. 5. Clean-Up (5 Minutes) Students should return their area to it's original condition. All robotic components should be placed in the appropriate containers. If there were chairs on the desks upon arrival, they should be placed back on the desks. All personal belongings should be collected and students should be dismissed. Attachments Lights and Music: Student Worksheet Safety Issues None Troubleshooting Tips None Investigating Questions See Procedure Step 3 (Discussion of Advanced Applications) above Assessment Post-Activity Assessment Lights and Music: Student Worksheet Activity Extensions See Procedure Step 4 (Exhibition) above Activity Scaling N/A Additional Multimedia Support References Other Redirect URL Owner Contributors Copyright Version: January 2009