Jump to main content

Build a Sound-Tracking Search and Rescue Robot

1
2
3
4
5
15 reviews

Abstract

HELP! Locating survivors trapped under rubble is a difficult and dangerous task. After a natural disaster, like an earthquake, rescuers must act quickly to save as many lives as possible. They can use robots with different types of sensors to help find survivors. In this project you will build a sound-tracking robot that can use two microphones to drive toward a sound source. Designing the robot's algorithm will be up to you.

Summary

Areas of Science
Difficulty
 
Time Required
Short (2-5 days)
Prerequisites
Previous experience with Arduino is recommended. See our How to Use an Arduino page.
Material Availability
Bluebot 4-in-1 robotics kit and Science Buddies Electronics Kit for Arduino are available from our partner Home Science Tools. See the Materials section for details.
Cost
High ($100 - $150)
Safety
No issues
Credits
Ben Finio, PhD, Science Buddies

Objective

Build a sound-tracking robot and write a program to make it drive toward a sound source.

Introduction

Robots can go places that are dangerous for humans, like damaged buildings that are at risk of collapse or areas contaminated by radiation or severe pollution. This makes robots useful in search and rescue situations, especially after natural disasters like earthquakes, hurricanes, and landslides. Robots like the one in Figure 1 can work alongside human rescue crews to help find survivors.

An all-terrain robot drives around an uneven plywood environment. A child-sized doll represents a survivor.
Figure 1. A robot at an indoor competition designed to simulate finding survivors after an earthquake.

Just as humans use different senses, like sight, sound, and touch, robots can use many types of electronic sensors to gather information from their environment. They can use cameras and computer vision to recognize objects. But what about environments where it is difficult to see, like the rubble of a collapsed building after an earthquake? A robot might have to rely on another type of sensor to locate people trapped under the rubble—like a microphone to listen for the sound of a person calling for help.

Most humans can naturally use their two ears to tell which direction a sound is coming from. This is called binaural hearing. A robot can do the same thing by recording sound in stereo using two microphones. This works because sound waves travel radially outward from the sound source. As the waves expand outward, they get quieter. This means that the sound will seem louder to the microphone closer to the sound source, as shown in Figure 2. The sound will also reach that microphone slightly before it reaches the farther microphone.

 Sound waves radiate from a sound source toward two microphones.

A dot in the top right corner of the image is the sound source. Sound waves, represented by quarter-arcs, radiate out from the source toward the bottom left of the image. Two microphones are placed just to the left and right of the center of the image. Microphone #1 is on the left and microphone #2 is on the right.


Figure 2. A sound wave expands radially outward from a source toward two microphones. The sound wave will reach microphone #2 first and will seem louder to microphone #2 than to microphone #1.

While they are represented by lines in Figure 2, sound waves are actually traveling pressure waves. Air pressure fluctuates above and below the baseline atmospheric pressure as air particles bump into each other (Figure 3). Larger amplitude fluctuations in pressure result in louder sound, and higher frequency fluctuations result in higher-pitched sound. Microphones convert this changing air pressure into an electrical voltage, which can be read by a microcontroller like an Arduino.

A graph shows variation in sound pressure over time.

The first segment of the line showing pressure is horizontal at a y value of zero, representing the baseline atmospheric pressure. Farther to the right, the line moves up and down, showing the fluctuation above and below the baseline pressure. The amplitude of the wave is the vertical distance from the baseline to a peak or trough.


Figure 3. Graph showing an example sound wave. The x axis of the graph is time, and the y axis is pressure (which can be measured either as absolute pressure or as a change from baseline atmospheric pressure). Section 1 represents a period of silence and section 2 represents a period of sound. The arrow labeled 3 represents the baseline atmospheric pressure, and the arrow labeled 4 shows the amplitude of the wave (the change from atmospheric pressure). The graph of a microphone's output would look the same, but the y-axis would be voltage instead of pressure. (Image credit: Wikimedia Commons user CLI, CC BY-SA 4.0)

There are different ways to process the sound recorded by multiple microphones in order to determine the direction of the source. One method is to compare the amplitudes of the two sound waves and assume that the louder wave was detected by the microphone closer to the source. If you can record data fast enough, you can also check to see which microphone recorded a sound earlier, as shown in Figure 4.

Two similar sound waves slightly offset on the x-axis
Figure 4. Sound recorded by a stereo microphone as a car drove by, showing the time difference between left and right. The x axis of the graph is time and the y axis is voltage. (Image credit Wikimedia commons user Sophie means wisdom, CC BY-SA 3.0)

In this project you will use the first method. You will mount two microphones on an Arduino robot, use them to record sound, and compare the resulting measurements to find the one with the greater amplitudes. We will provide example code and a circuit diagram to get you started, but it is up to you to decide what to do with this information. When should your robot decide to turn and drive toward a sound? When should it drive straight? When should it consider the sound "noise" and just ignore it? You will design and code your own algorithm to control the robot's behavior. Before you get started, you may wish to watch this video to learn more about the microphones you will use in this project:

Terms and Concepts

Questions

Bibliography

Materials and Equipment Buy Kit

Recommended Project Supplies

Get the right supplies — selected and tested to work with this project.

View Kit

Materials for this project:

You may wish to purchase additional parts to customize or add features to your robot. See Variations section for ideas.

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.

Experimental Procedure

Note: This engineering project is best described by the engineering design process, as opposed to the scientific method. You might want to ask your teacher whether it's acceptable to follow the engineering design process for your project before you begin. You can learn more about the engineering design process in the Science Buddies Engineering Design Process Guide.
Note: If you have never used an Arduino before, please see our How to Use an Arduino page and go through at least the first three tutorials before you attempt the procedure for this project.
  1. Follow the instructions in this video to assemble your Bluebot chassis. However, instead of mounting the 4xAA battery pack on top of the robot, mount it on the lower plate. Then mount your Arduino next to the breadboard on the top plate. This will make it easier to connect the circuit to the Arduino.
  1. If needed, solder header pins to your microphone breakout boards.
  2. Build the circuit shown in Figures 5 and 6. Be careful and note that there are three different power supplies involved in this circuit: 5 V and 3.3 V from the Arduino, and 6 V from the 4xAA battery pack. All parts of your circuit should have a common ground connection, but you must be careful not to short-circuit the different positive voltages to each other. Also note that the Arduino pins used in this diagram match the pins used in the example code, but you could choose to use different pins.
    1. Place the H-bridge in the breadboard, straddling the center gap. Refer to the H-bridge's datasheet from the Bibliography for the pinout. Going counterclockwise from the top left, starting with pin 1, connect the pins as follows:
      1. Pin 1 to Arduino pin 10
      2. Pin 2 to Arduino pin 3
      3. Pin 3 to the right motor negative wire
      4. Pin 4 to ground
      5. Pin 5 to ground
      6. Pin 6 to the right motor positive wire
      7. Pin 7 to Arduino pin 2
      8. Pin 8 to the 6 V from the AA battery pack
      9. Pin 9 to Arduino pin 9
      10. Pin 10 to Arduino pin 4
      11. Pin 11 to the left motor positive wire
      12. Pin 12 to ground
      13. Pin 13 to ground
      14. Pin 14 to the left motor negative wire
      15. Pin 15 to Arduino pin 5
      16. Pin 16 to 5 V from the Arduino
    2. Place a slide switch in the breadboard to use as an on/off switch for the 4xAA battery pack. Connect the battery pack's positive wire to the switch, and the negative wire to a ground bus.
    3. Connect your microphones using male-female jumper wires. Make sure you read the pin labels on your microphones, as they may be in a different order than the ones shown in the diagram.
      1. Microphone ground to Arduino ground
      2. Microphone VCC to Arduino 3.3 V (not 5 V). The documentation for the microphone recommends using the 3.3 V supply since it is less noisy than the 5 V supply.
      3. Each microphone out to one of the Arduino's analog inputs, such as A0 and A1.
    Breadboard view diagram for the sound tracking robot circuit
    Figure 5. Breadboard diagram for the circuit. A larger version is available for download.

    Schematic for the circuit showing Arduino connections to the microphones and H-bridge
    Figure 6. Schematic for the circuit. A larger version is available for download.
  3. Mount the microphones to your robot chassis. Experimenting with microphone placement and orientation is part of what you can try for this project. In general, you do not want the microphones too close together. Figure 7 shows one example, but you could put your microphones somewhere else, or even use other supplies (like popsicle sticks) to extend them.
     Robot chassis facing the camera, with two microphones mounted on its left and right sides toward the front, facing diagonally outward
    Figure 7. Microphones mounted on the robot chassis.
  4. Download the example code. This code contains functions to make the robot drive and steer. It also samples the two microphones for a set period of time and calculates the maximum amplitude for each microphone. It does not, however, contain an algorithm that tells the robot what to do with this information—that part is your job! Make sure you read through all the comments and understand how the code works. If you do not know what an Arduino command does, you can look it up in the official Arduino language reference (see Bibliography).
  5. Plan out an algorithm for how your robot should react to the microphone readings. Your goal is to make the robot drive toward the source of a sound. Here are a few things to consider (this is not an exhaustive list):
    1. The robot's motors are pretty loud. Should you take readings while the robot is moving, or "stop and listen" so the motors' noise does not affect the readings? Can you calibrate the microphones to filter out (ignore) noise from the motors?
    2. There is probably some level of background noise in your environment. Do you want your robot to react to every single sound? Should you set a threshold so it only reacts if sound amplitude exceeds a certain volume? Do you want it to react to a person's voice, or something like a person clapping their hands?
    3. If a sound comes from in front of the robot, the two microphone readings will not be exactly the same. If the microphone readings are close, but not exactly equal to each other, you may want the robot to drive straight instead of turning.
    4. You can leave your robot plugged into the computer and use the serial print command to print out the values of different variables. This is useful for debugging and calibrating the microphones (e.g., measuring the amplitude produced by different sounds at different distances from the robot).
  6. Convert your algorithm to Arduino code. Make sure you document your code with comments so you understand what it does if you come back to it later.
  7. Upload and test your code. At first, it may be helpful to leave the robot's motors turned off (using the switch on the breadboard) and leave the Arduino connected to the computer with a USB cable. This will let you use the serial monitor to debug and observe the measured sound values. When you are ready, you can put the robot on the floor and let it drive around. You can leave the USB cable connected during testing, but it will pull on the Arduino and affect the robot's motion, so you will want to disconnect it eventually.
  8. Your robot may not work perfectly on the first try, and that is OK! Iteration is an important part of the engineering design process. Make observations about your robot's behavior. For example, does it ever turn in the wrong direction? Does it drive forward when it is not supposed to? Are there parameters you can tweak in your code to change these behaviors? What about changing the physical location of the microphones?
  9. Continue iterating until you can get your robot to reliably drive toward a sound source. See the Variations section for other ways to add to or improve your robot.
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Connections

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Sustainable Cities and Communities: Make cities inclusive, safe, resilient and sustainable.

Variations

  • You can connect up to six microphones to your robot since the Arduino UNO has six analog inputs. Can you place an array of microphones around your robot and use them to more accurately determine the direction of a sound source?
  • The example code uses the digitalWrite command to drive the robot at full speed. Instead, you can use the analogWrite command for the H-bridge's enable pins (pins 1 and 9) to control the speed of each motor, as shown in our H-bridge tutorial video. Can you make your robot drive at variable speeds (for example, turn faster if a sound is detected farther to one side)? Note: The analogWrite command is also useful to fine-tune the robot to drive straight if it tends to drift off to one side.
  • Can you add indicator LEDs to your robot? For example, you could have the robot turn on an LED when it is listening for a sound or use different LEDs to indicate when it is going to drive in different directions.
  • Did you include threshold variables in your code? Can you add potentiometers to your circuit so you can adjust these thresholds without needing to edit the code?
  • Is it possible to use an Arduino to determine the direction of a sound source using the timing of the sounds instead of the amplitude? Hint: You will need to look up the sampling rate of the Arduino's analog inputs and calculate how long it takes sound to travel between the microphones, based on the speed of sound and how far apart the microphones are.
  • Can you add a voice recognition module to your robot to make it respond to voice commands?
  • You can connect many other sensors to your robot, such as bump sensors, infrared sensors, light sensors, and ultrasonic sensors. Can you connect more sensors to help your robot navigate an environment with obstacles? In addition to search and rescue, can you think of other applications, like space exploration or autonomous cars?

Contact Us

If you have purchased a kit for this project from Science Buddies, we are pleased to answer your questions.

In your email, please follow these instructions:
  1. What is your Science Buddies kit order number?
  2. Please describe how you need help as thoroughly as possible:

    Examples

    Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
    Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
    Bad Question I don't understand the instructions. Help!
    Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
    Bad Question Can I use a different part?

Contact Us

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben. "Build a Sound-Tracking Search and Rescue Robot." Science Buddies, 6 Dec. 2023, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p048/robotics/sound-tracking-robot. Accessed 14 Apr. 2024.

APA Style

Finio, B. (2023, December 6). Build a Sound-Tracking Search and Rescue Robot. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p048/robotics/sound-tracking-robot


Last edit date: 2023-12-06
Top
Free science fair projects.