Hands-on Activity Music by Touch:
Programming Robot Tactile Sensors to Play Sounds

Quick Look

Grade Level: 5 (5-8)

Time Required: 45 minutes

Expendable Cost/Group: US $0.00

This activity uses some non-expendable (reusable) items such as LEGO MINDSTORMS robot components; see the Materials List for details.

Group Size: 3

Activity Dependency:

Subject Areas: Biology, Computer Science, Life Science, Science and Technology

NGSS Performance Expectations:

NGSS Three Dimensional Triangle

Two photographs: A palm-sized gray plastic device (LEGO touch sensor). A girl pushes a button on a remote control device in her hand.
Students program LEGO robots to respond to information from touch sensors. Tactile sensors are used in the remote control devices we use every day.
Copyright © (left) LEGO https://shop.lego.com/en-CA/EV3-Touch-Sensor-45507 (right) 2004 Microsoft Corporation, One Microsoft Way, Redmond, WA 98052-6399 USA. All rights reserved. http://office.microsoft.com/en-us/images/results.aspx?qu=remote+control&ex=1#ai:MP900411755|


Students' understanding of how robotic touch sensors work is reinforced through a hands-on design challenge involving LEGO® MINDSTORMS® EV3 intelligent bricks, motors and touch sensors. They learn programming skills and logic design in parallel as they program robot computers to play sounds and rotate a wheel when a touch sensor is pressed, and then produce different responses if a different touch sensor is activated. Students see first-hand how robots can take input from sensors and use it to make decisions to move as programmed, including simultaneously moving a motor and playing music. A PowerPoint® presentation and pre/post quizzes are provided.
This engineering curriculum aligns to Next Generation Science Standards (NGSS).

Engineering Connection

Touch (tactile) sensors are key components of many devices we use every day. For instance, the touch sensors in keyboards and keypads tell computers which keys you are pressing. Similarly, you can open a car door using a touch sensor that generates an infrared signal that goes to the car's computer informing it to unlock the door. Phone and tablet touchscreens on phones enable even more exquisite communication between people and machines. The use of touch sensors has exploded into the engineering design of all sorts of devices.

Computer programming is a key component of many modern engineering designs. As students create robot programs in this activity, they must have a "goal" or "concept" of what the program solution needs to do and how, before they begin writing the code. Then, the process of working on the code and "debugging" it inherently constitutes "revising and improving their designs based on the results of testing." Hence, the thought processes required to code programs that meet problem constraints are very similar, if not identical, to those required for traditional engineering design of physical objects and products.

Learning Objectives

After this activity, students should be able to:

  • Program a LEGO robot to take input from touch sensors to play music and activate a motor.
  • Explain how the program and the touch sensors work.
  • Relate the program (robotic response to touch sensor information) to human responses to touch.

Educational Standards

Each TeachEngineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards.

All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN), a project of D2L (www.achievementstandards.org).

In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics; within type by subtype, then by grade, etc.

NGSS Performance Expectation

MS-LS1-3. Use argument supported by evidence for how the body is a system of interacting subsystems composed of groups of cells. (Grades 6 - 8)

Do you agree with this alignment?

Click to view other curriculum aligned to this Performance Expectation
This activity focuses on the following Three Dimensional Learning aspects of NGSS:
Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
Use an oral and written argument supported by evidence to support or refute an explanation or a model for a phenomenon.

Alignment agreement:

In multicellular organisms, the body is a system of multiple interacting subsystems. These subsystems are groups of cells that work together to form tissues and organs that are specialized for particular body functions.

Alignment agreement:

Systems may interact with other systems; they may have sub-systems and be a part of larger complex systems.

Alignment agreement:

Scientists and engineers are guided by habits of mind such as intellectual honesty, tolerance of ambiguity, skepticism, and openness to new ideas.

Alignment agreement:

NGSS Performance Expectation

MS-LS1-8. Gather and synthesize information that sensory receptors respond to stimuli by sending messages to the brain for immediate behavior or storage as memories. (Grades 6 - 8)

Do you agree with this alignment?

Click to view other curriculum aligned to this Performance Expectation
This activity focuses on the following Three Dimensional Learning aspects of NGSS:
Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
Gather, read, and synthesize information from multiple appropriate sources and assess the credibility, accuracy, and possible bias of each publication and methods used, and describe how they are supported or not supported by evidence.

Alignment agreement:

Each sense receptor responds to different inputs (electromagnetic, mechanical, chemical), transmitting them as signals that travel along nerve cells to the brain. The signals are then processed in the brain, resulting in immediate behaviors or memories.

Alignment agreement:

Cause and effect relationships may be used to predict phenomena in natural systems.

Alignment agreement:

  • Explain how various relationships can exist between technology and engineering and other content areas. (Grades 3 - 5) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Explain how knowledge gained from other content areas affects the development of technological products and systems. (Grades 6 - 8) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Describe how new technologies have helped scientists make better observations and measurements for investigations (e.g., telescopes, electronic balances, electronic microscopes, x-ray technology, computers, ultrasounds, computer probes such as thermometers) (Grade 5) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Explain the interactions between the nervous and muscular systems when an organism responds to a stimulus (Grade 8) More Details

    View aligned curriculum

    Do you agree with this alignment?

Suggest an alignment not listed above

Materials List

Each group needs:

To share with the class:

Note: This activity can also be conducted with the older (and no longer sold) LEGO MINDSTORMS NXT set instead of EV3; see below for those supplies:

Worksheets and Attachments

Visit [www.teachengineering.org/activities/view/umo_sensorswork_lesson03_activity1] to print or download.

Pre-Req Knowledge

  • Experience using and programming the LEGO MINDSTORMS EV3 robot and intelligent brick (computer) so that it takes input from sensors for decision making.
  • An understanding of how touch sensors work, both human and robotic, as presented in the associated lesson.
  • Completion of the Our Bodies have Computers and Sensors unit and the What Is a Sensor? lesson.


We have learned how the human sense of touch works from the previous lesson. Now how do we implement the "stimulus-sensor-coordinator-effector-response" framework in a LEGO robot?

In today's design challenge activity, you will carefully program a LEGO robot to alter how some music is played and how a wheel is turned, depending on which touch sensors are activated. Let's get started!


Before the Activity

  • Gather materials so each group has a LEGO MINDSTORMS EV3 intelligent brick, motor and two touch sensors, and cables for connecting them, as well as a computer with the LEGO EV3 software installed.
  • Make copies of the Music by Touch Pre-Quiz and Music by Touch Post-Quiz, one each per student. The quizzes are provided as separate attachments, and also embedded in the presentation so they can be presented to the class as a whole, if desired.
  • Perform the activity prior to doing it with students. Make sure you are familiar with the design challenge and answers, which are provided in detail on slides 4-7 of the presentation.
  • Use the 13-slide Music by Touch Presentation, a Microsoft® PowerPoint® file, to teach and conduct the activity. Set up a computer/projector to show the presentation to the class.
  • Divide the class into groups of three students each.

With the Students

  1. Administer the pre-quiz by handing out paper copies; the quiz is also on slide 2. The answers are provided for the teacher on slide 3 for discussion after students have completed the quiz.
  2. As a quick review, remind students of the similarities between human and robot designs (slide 4). Your hand is commanded by your brain. Similarly, the LEGO intelligent brick commands its motor to move.
  3. Then introduce the activity's design challenge. Slide 5 provides a description and diagram of the equipment setup and explains the program requirements. Have students write the program on paper and check them as completed. Program requirements:
  • If one touch sensor is touched, play a piece of music and keep rotating the wheel (attached to the motor) slowly.
  • If the other sensor is also touched, play the music faster and make the wheel turn faster.
  • Do this in a loop, continuously, until the program is stopped.
  1. Review with students how the LEGO EV3 motor works:
  • The EV3 motor is an electric motor that works by converting electricity into motion, and is similar to many other motors that you see around you daily.
  • The EV3 motor has a built-in wheel rotation sensor that helps it control its motion, that is, it can move precise distances using this rotation sensor.
  1. Hand out to each group a LEGO brick, motor and two touch sensors.
  2. Assist students as they work through the challenge. Make sure to check each group's plans and provide encouragement and suggestions so that they develop successful programs. Slides 6-9 provide the programming solution for the teacher.
  3. Have each group demonstrate that its program works successfully.
  4. At activity end, lead a class discussion about the activity, as described in the Assessment section.
  5. Administer the post-quiz by handing out paper copies; the quiz is also on slide 10. The answers are provided on slides 11-12. Slide 13 contains vocabulary terms and definitions.


sensor: A device that converts one type of signal to another; for instance, the speedometer in a car collects physical data and calculates and displays the speed the car is moving.

stimulus: A thing or event that causes a reaction, such as a specific functional reaction in an organ or tissue.

tactile: Related to touch.


Pre-Activity Assessment

Pre-Quiz: Before starting the activity, administer the Music by Touch Pre-Quiz (also on slide 2) to assess students' base understanding of the stimulus-to-response framework and touch sensors. Answers are provided on the Music by Touch Pre-Quiz Answer Key (and slide 3).

Activity-Embedded Assessment

Button Check: As students are conducting the activity, check to see if students understand what each of the individual programming buttons mean, whether they can follow the logic of the program step-by-step and explain their programs (refer to the programming answer for the teacher on slides 6-9).

Post-Activity Assessment

Concluding Discussion: At activity end, lead a class discussion about the activity, asking students to share their experiences and lessons learned. Ask students:

  • Describe the challenges you faced.
  • What issues or difficulties did you encounter?
  • What are examples of how touch sensors are used in real-world devices? (Example answers: Remote control devices that open car and garage doors, turn on/off ceiling fans, etc.).
  • What might you now want to learn about touch sensors?

Post-Quiz: Administer the Music by Touch Post-Quiz (also on slide 10) to assess students' understanding of the stimulus-to-response framework, touch sensors and programming. Answers are provided in the Music by Touch Post-Quiz Answer Key (and slides 11-12). Review students' answers to assess their understanding of the concepts explored in the activity.

Additional Multimedia Support

LEGO EV3 robots and sensors: https://www.lego.com/en-us/themes/mindstorms/about

List of sensors: http://en.wikipedia.org/wiki/List_of_sensors

What is a transducer? http://en.wikipedia.org/wiki/Transducer

What is a sensor? http://en.wikipedia.org/wiki/Sensors


Get the inside scoop on all things TeachEngineering such as new site features, curriculum updates, video releases, and more by signing up for our newsletter!
PS: We do not share personal information or emails with anyone.

More Curriculum Like This

Upper Elementary Lesson
How Does a Touch Sensor Work?

Students learn about how touch sensors work, while reinforcing their similarities to the human sense of touch. They look at human senses and their electronic imitators, with special focus on the nervous system, skin and touch sensors.

Upper Elementary Lesson
Brain is a Computer

Students learn about the similarities between the human brain and its engineering counterpart, the computer. Since students work with computers routinely, this comparison strengthens their understanding of both how the brain works and how it parallels that of a computer.

Upper Elementary Unit
How Do Sensors Work?

Through six lesson/activity sets, students learn about the functioning of sensors, both human and robotic. The overall framework reinforces the theme of the human body as a system with sensors—that is, from an engineering perspective.

Upper Elementary Lesson
How Does a Sound Sensor Work?

Students learn about how sound sensors work, reinforcing their similarities to the human sense of hearing. They look at the hearing process—sound waves converted to electrical signals sent to the brain—through human ear anatomy as well as sound sensors.


© 2013 by Regents of the University of Colorado; original © 2013 Curators of the University of Missouri


Trisha Chaudhary, Pranit Samarth, Satish S. Nair

Supporting Program

GK-12 Program, Computational Neurobiology Center, College of Engineering, University of Missouri


This curriculum was developed under National Science Foundation GK-12 grant no. DGE 0440524. However, these contents do not necessarily represent the policies of the National Science Foundation, and you should not assume endorsement by the federal government.

Last modified: October 16, 2020

Free K-12 standards-aligned STEM curriculum for educators everywhere.
Find more at TeachEngineering.org