This activity aims to create a robot that follows a sound source. Use the sound file provided on a phone or portable speaker. When the sound source is held close (~50 cm) to the robot, the robot should turn towards the sound and approach it. The robot will do this by comparing the sound intensity between the left and right microphones. If the sound strength at the left receiver is greater than at the right, we will turn left, and vice versa. This is a form of phonotaxis.
In principle, the robot should be able to approach a sound source placed somewhere in the environment. However, as discussed earlier, the microphones are not very sensitive, so the robot might not be able to approach distant sound sources.
<aside> ⚠️ This robotic activity works best if the sound source the robot is supposed to approach is the only sound source. This implies that it is difficult to do this activity with different groups in the same room.
</aside>
<aside> ⚠️ Because the robot's sensors are not very sensitive, the volume of the speaker or phone should be turned up quite high. However, care should be taken not to turn the sound up so much that it is uncomfortable or that you need to raise your voice to be understood by someone three feet away. Too loud noise can damage hearing. If in doubt, students could wear hearing protection.
</aside>
<aside> ⚠️ In the programs provided for this activity, we assume the left microphone is plugged into port 3 and the right microphone into port 4.
</aside>
<aside> ℹ️
If time is limited, step 1, in which the robot's directionality is measured without external ears, can be skipped. However, we still recommend discussing the lack of directionality of the bare microphones so that students understand why they have to add external ears to the robot.
</aside>
If we wish to find the sound by comparing the intensities at both receivers, the left microphone must be more sensitive than the right one for sound coming from the left. However, this is not necessarily so. Remember, we discussed the properties of the microphones and compared them with our ears? We said the microphones are almost omnidirectional (but not entirely). Therefore, they pick up sound almost equally well from all directions. In fact, they might be so omnidirectional that a sound at the left of the robot stimulates the left and the right microphones equally. In this case, the robot could not tell whether to turn left or right.
In the first step of this activity, students will measure the microphones' directionality. For this activity, we will provide the robot with two microphone sensors. Sensors can be mounted, as seen in the images below.
<aside> ⚠️ If you mount the sound sensors, as shown below, do not tighten the screws too much. This might damage the sensors.
</aside>



The sound sensor
Next, have students build a setup like the one shown below. You can have students put a large sheet of paper or a whiteboard on the floor (as in the example below) and draw several compass directions. Below, angles from -40 to 40 degrees have been drawn in 20-degree steps. Place the sound source at an angle of 0 ° and about 50 cm from the robot. The sound source can be a phone or a speaker. The speaker is not shown in the image below.

Have the sound source play the following sound on repeat. The sound consists of bursts of white noise. The reason why this sound is pulsed is explained here. Click the link below, then click the 3 dots in the sound player to download the file.
Students should align the robot with each marked direction. Run the program below. In the program, ensure the block "set left_scale" contains the value 1. You can change this number by clicking on the small oval with the number.

When they click the green flag, the robot will take 20 measurements of sound intensity from the left and right microphones. Finally, it will calculate the average of the 20 measurements. The robot will beep when it is done. Once the robot beeps, they should write down the number for left_sound and right_sound.
Next, turn the robot to align it with the next direction and click the green button again to measure the next angle. In this way, the students will determine the loudness of the sound as picked up by the robot's two microphones (or ears) at different positions of the sound source relative to the robot.