ULTRASONIC DRUM

PIPER MAKE EDUCATOR RESOURCES SERIES

To do this project, you will need a Piper Make Starter Kit. Get yours here:

Turn the Ultrasonic Range Finder into an instrument!

To get started, head to Piper Make and hit this icon:

Time: 30 minutes

Age Range: 8+

Difficulty: Beginner

In this project, students utilize the Ultrasonic Range Finder from "Security Zone." Students will use variables, loops and conditionals to convert distances to different notes.

Note: There are step by step instructions for the students to follow in the tutorials included in each project on Piper Make. These provide directions both for writing code and for building the electronic circuits. The tutorials are well-defined and most students will be able to follow them with little assistance required.

LEARNING OBJECTIVES

Students will:

 

  • Practice breadboarding and wiring.
  • Review and understand computational concepts of:
    • loops: running the same sequence multiple times.
    • sequence: identifying a series of steps for a task
  • Demonstrate computational thinking core concepts, including:
    • Algorithm Design by creating an ordered series of instructions for solving similar problems or for doing a task, such as turning a light off and on in the right order.
  • Create programs that include events, loops, and conditionals.
  • Decompose problems into smaller, manageable tasks which may themselves be decomposed.
  • Test and debug a program or algorithm to ensure it accomplishes the intended task.
  • Perform different roles when collaborating with peers during the design, implementation, and review stages of program development.

STANDARDS ALIGNMENT

CSTA's K-12 Standards 

1B-CS-02: Model how computer hardware and software work together as a system to accomplish tasks. Subconcept: Hardware & Software; Practice 4.4

1B-CS-03: Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies. Subconcept: Troubleshooting; Practice 6.2

1B-AP-09: Create programs that use variables to store and modify data. Subconcept: Variables; Practice 5.2

1B-AP-10: Create programs that include sequences, events, loops, and conditionals. Subconcept: Control; Practice 5.2

1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process. Subconcept: Modularity; Practice 3.2

1B-AP-12: Modify, remix, or incorporate portions of an existing program into one’s own work, to develop something new or add more advanced features. Subconcept: Modularity; Practice 5.3

1B-AP-15: Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended. Subconcept: Program Development; Practice 6.1, 6.2

Next Generation Science Standards

3-PS2-2: Make observations and/or measurements of an object’s motion to provide evidence that a pattern can be used to predict future motion.

MS-PS4-2: Develop and use a model to describe that waves are reflected, absorbed, or transmitted through various materials.

CCSS ELA

CCSS.ELA.L.W.3.8: Recall information from experiences or gather information from print and digital sources; take brief notes on sources and sort evidence into provided categories.

CCSS.ELA.L.W.3.10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

World-Class Instructional Design and Assessment (WIDA) English Language Proficiency Standards

ELD-SI.K-3.Argue:

  • Ask questions about others’ opinions
  • Support own opinions with reasons
  • Clarify and elaborate ideas based on feedback
  • Defend change in one’s own thinking
  • Revise one’s own opinions based on new information

 

ELD-SC.2-3.Argue.Interpretive:

  • Interpret scientific arguments by
  • Identifying potential evidence from data, models, and/or information from investigations of phenomena or design solutions
  • Analyzing whether evidence is relevant or not
  • Distinguishing between evidence and opinions

California's K-12 Computer Science Standards

3-5.CS.2: Demonstrate how computer hardware and software work together as a system to accomplish tasks.

3-5.CS.3: Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies.

3-5.AP.11: Create programs that use variables to store and modify data.

3-5.AP.12: Create programs that include events, loops, and conditionals.

3-5.AP.13: Decompose problems into smaller, manageable tasks which may themselves be decomposed.

3-5.AP.14: Create programs by incorporating smaller portions of existing programs, to develop something new or add more advanced features.

3-5.AP.17: Test and debug a program or algorithm to ensure it accomplishes the intended task.

Science Content Standards

3-PS2-2: Make observations and/or measurements of an object’s motion to provide evidence that a pattern can be used to predict future motion.

MS-PS4-2: Develop and use a model to describe that waves are reflected, absorbed, or transmitted through various materials.

Common Core English Language Arts

CCSS.ELA.L.W.3.8: Recall information from experiences or gather information from print and digital sources; take brief notes on sources and sort evidence into provided categories.

CCSS.ELA.L.W.3.10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

California English Language Development Standards

CA ELD.3.C.11: Supporting own opinions and evaluating others’ opinions in speaking and writing

CA ELD.3.C.12: Selecting and applying varied and precise vocabulary and language structures to effectively convey ideas

Michigan Integrated Technology Competencies for Students (MITECS)

1B-CS-02: Model how computer hardware and software work together as a system to accomplish tasks. Subconcept: Hardware & Software; Practice 4.4

1B-CS-03: Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies. Subconcept: Troubleshooting; Practice 6.2

1B-AP-09: Create programs that use variables to store and modify data. Subconcept: Variables; Practice 5.2

1B-AP-10: Create programs that include sequences, events, loops, and conditionals. Subconcept: Control; Practice 5.2

1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process. Subconcept: Modularity; Practice 3.2

1B-AP-12: Modify, remix, or incorporate portions of an existing program into one’s own work, to develop something new or add more advanced features. Subconcept: Modularity; Practice 5.3

1B-AP-15: Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended. Subconcept: Program Development; Practice 6.1, 6.2

Michigan Science Standards

3-PS2-2: Make observations and/or measurements of an object’s motion to provide evidence that a pattern can be used to predict future motion.

MS-PS4-2: Develop and use a model to describe that waves are reflected, absorbed, or transmitted through various materials.

Michigan English Language Arts

Michigan ELA, Grade 3-8, Research, 8: Recall information from experiences or gather information from print and digital sources; take brief notes on sources and sort evidence into provided categories.

Michigan ELA, Grade 3-8, Range of Writing, 10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

WIDA English Language Development

ELD-SI.K-3.Argue:

  • Ask questions about others’ opinions
  • Support own opinions with reasons
  • Clarify and elaborate ideas based on feedback
  • Defend change in one’s own thinking
  • Revise one’s own opinions based on new information

 

ELD-SC.2-3.Argue.Interpretive:

  • Interpret scientific arguments by
  • Identifying potential evidence from data, models, and/or information from investigations of phenomena or design solutions
  • Analyzing whether evidence is relevant or not
  • Distinguishing between evidence and opinions

Science Texas Essential Knowledge & Skills

TEKS Science Grade 3

(a) Introduction.

  (1) In Grade 3, students learn that the study of science uses appropriate tools and safe practices in planning and implementing investigations, asking and answering questions, collecting data by observing and measuring, and using models to support scientific inquiry about the natural world.

    (A) Within the physical environment, students recognize that patterns, relationships, and cycles exist in matter. Students will investigate the physical properties of matter and will learn that changes occur. They explore mixtures and investigate light, sound, and thermal energy in everyday life. Students manipulate objects by pushing and pulling to demonstrate changes in motion and position.

(b)(2) Scientific investigation and reasoning. The student uses scientific practices during laboratory and outdoor investigations. The student is expected to:

    (A) plan and implement descriptive investigations, including asking and answering questions, making inferences, and selecting and using equipment or technology needed, to solve a specific problem in the natural world;

(b)(3) Scientific investigation and reasoning. The student knows that information, critical thinking, scientific problem solving, and the contributions of scientists are used in making decisions.

TEKS Science Grade 4

(a)(1)(A) Within the physical environment, students know about the physical properties of matter including mass, volume, states of matter, temperature, magnetism, and the ability to sink or float. Students will differentiate among forms of energy including mechanical, light, sound, and thermal energy. Students will explore electrical circuits and design descriptive investigations to explore the effect of force on objects.

(b)(3) Scientific investigation and reasoning. The student uses critical thinking and scientific problem solving to make informed decisions. The student is expected to:

    (A) analyze, evaluate, and critique scientific explanations by using evidence, logical reasoning, and experimental and observational testing;

    (B) represent the natural world using models such as the water cycle and stream tables and identify their limitations, including accuracy and size; and

    (C) connect grade-level appropriate science concepts with the history of science, science careers, and contributions of scientists.

TEKS Science Grade 5

(a)(1) In Grade 5, scientific investigations are used to learn about the natural world. Students should understand that certain types of questions can be answered by investigations and that methods, models, and conclusions built from these investigations change as new observations are made. Models of objects and events are tools for understanding the natural world and can show how systems work. They have limitations and based on new discoveries are constantly being modified to more closely reflect the natural world.

(a)(3) Recurring themes are pervasive in sciences, mathematics, and technology. These ideas transcend disciplinary boundaries and include patterns, cycles, systems, models, and change and constancy.

ELA Texas Essential Knowledge & Skills Grade 3

(b) (1)Developing and sustaining foundational language skills: listening, speaking, discussion, and thinking--oral language. The student develops oral language through listening, speaking, and discussion. The student is expected to:

    (A) listen actively, ask relevant questions to clarify information, and make pertinent comments;

    (B) follow, restate, and give oral instructions that involve a series of related sequences of action;

    (C) speak coherently about the topic under discussion, employing eye contact, speaking rate, volume, enunciation, and the conventions of language to communicate ideas effectively;

    (D) work collaboratively with others by following agreed-upon rules, norms, and protocols; and

    (E) develop social communication such as conversing politely in all situations.

ELA Texas Essential Knowledge & Skills Grades 4 & 5

(b) (1)Developing and sustaining foundational language skills: listening, speaking, discussion, and thinking--oral language. The student develops oral language through listening, speaking, and discussion. The student is expected to:

    (A) listen actively, ask relevant questions to clarify information, and make pertinent comments;

    (B) follow, restate, and give oral instructions that involve a series of related sequences of action;

    (C) express an opinion supported by accurate information, employing eye contact, speaking rate, volume, enunciation, and the conventions of language to communicate ideas effectively; and

    (D) work collaboratively with others to develop a plan of shared responsibilities.

(b)(13) Inquiry and research: listening, speaking, reading, writing, and thinking using multiple texts. The student engages in both short-term and sustained recursive inquiry processes for a variety of purposes. The student is expected to:

    (A) generate and clarify questions on a topic for formal and informal inquiry;

    (B) develop and follow a research plan with adult assistance;

    (C) identify and gather relevant information from a variety of sources;

    (D) understand credibility of primary and secondary sources;

    (E) demonstrate understanding of information gathered;

    (F) differentiate between paraphrasing and plagiarism when using source materials;

    (G) develop a bibliography; and

    (H) use an appropriate mode of delivery, whether written, oral, or multimodal, to present results.

§74.4. English Language Proficiency Standards

(c) Cross-curricular second language acquisition essential knowledge and skills.

(3) Cross-curricular second language acquisition/speaking.

(D) speak using grade-level content area vocabulary in context to internalize new English words and build academic language proficiency;

(E) share information in cooperative learning interactions;

(F) ask and give information ranging from using a very limited bank of high-frequency, high-need, concrete vocabulary, including key words and expressions needed for basic communication in academic and social contexts, to using abstract and content-based vocabulary during extended speaking assignments;

(G) express opinions, ideas, and feelings ranging from communicating single words and short phrases to participating in extended discussions on a variety of social and grade-appropriate academic topics;

(H) narrate, describe, and explain with increasing specificity and detail as more English is acquired;

CONCEPTS

In this project, students will build on their experience using the range finder. Variables will be used to relate a specific distance to its corresponding note.

PARTS

GPIO SETUP

OVERVIEW OF STEPS

Step 1: Drumroll Please...

It's your moment to unleash your inner drummer! In this tutorial, we're going to use your ultrasonic range finder to define different sounds at different distance ranges measured.

Ready? Let's do it!

Step 2: Gather Your Supplies

You'll need to snag your ultrasonic range finder and the diode jumper cables for this tutorial.

Step 3: Set Up Your Range Finder

Let’s start by connecting up our Ultrasonic Range Finder. Remember, the DIGITAL VIEW is a handy dandy way to see the GPIO pin locations. Here’s what each of those wires on the sensor connect to:

Red - VCC - 3.3V - Power
Black - GND - Ground
Yellow - DATA - GP22
Green - NC (No Connection) - Does not need to be connected

Step 4: Define a Variable

Start by dragging out a start block from the Chip Menu. Then, grab a repeat forever block from the Loops menu and connect it to the start block. Change the wait time on the start block to 0.25 seconds.

Then let's define a variable called distance sense to measure the distance from the range finder.

Since the range finder is connected to pin 15, use a range finder block from the Sensing menu for the range finder to measure the distance in cm.

Step 5: Set up the If-Do Statement

Since our range finder detects best within 300 cm, we want to our drum to apply to distances measured within 300 cm. Drag out an if _ = _ do block from the Logic menu and connect it below the set distance sense block. Change the = to a <.

Drag a distance sense value from the Variables menu and place it into the first input of the _ < _ block. Then, Drag a 0 from the Values menu and place it into the second input of the _ < _ block. Change the 0 to 300.
If the distance is less than 300 cm, then we're going to play a sound so drag a play sound block out from the Sounds menu too. We'll define what sounds in to play in the next steps.

Step 6: Play That Note!

But what note do we want to play? If we just put one sound in the play sound block, then it wouldn't be much of a drum right?

Let's create a new viable for the note that is going to be played. We can call it note to play. Make this variable by click the Create variable... button in the Variables menu to do this. But what will that note be?

Drag out a set note to play block and place it right before the play sound block.

Let's map the distance measured to different notes! To do this, we have to create two ranges, one of the distances that can be measured and one of the notes that can be played.

Drag out a map value block from the Logic menu and place it into the input of the set note to play block:

Step 7: Mapping it Out

Let's talk a little about the mapping because that's how we're going to figure out which note gets played!

Since the distances range between 0 and 300, change the second number in the map value block from 50 to 300.

Next delete the last two number value blocks in the map value block. Grab a note block from the Values menu and place it into one of the empty inputs at the end of the map value block. Do it again for the other input.

We want to use the distance sense variable, so grab a distance sense block from the Variables menu and place it into the first input on the map value block.

Change the note blocks to notes between A5 and A2. This will break up the 300 cm into equal units that match the number of intervals between A5 and A2:

Grab the instrument block from the Sounds menu and place it into the input of the play sound block. Delete the note block inside of the play sound block. Grab a note to play block from the Variables menu and place it into the pitch input of the instrument block.

Step 8: Sound On!

Now what sound would we like to create?

Change the instrument to whatever you would like! How fast do you want your notes to go? Change the length of the notes to mess with that, too!

Step 9: Test it Out!

Drumroll please... Let's test it out!

Move your hand closer and further from the sensor and see what happens! Does the sound change? Change around your parameters to see what other patterns you can create!

Step 10: You Finished!

Click EXIT to return to the menu and start your next coding challenge.