Inspiration

Owls can locate prey by hearing tiny differences in when sound reaches each ear. We wanted to explore that same idea through robotics: could we build an affordable system that turns toward a sound without needing a camera?

What it does

Our robot uses two microphones to estimate the direction of a sound and moves a servo to point toward it. A Kalman filter smooths the angle estimates to reduce jitter. When the sound fades, the goal is to hold the last known direction rather than return to the center.

How we built it

We built the system using a Raspberry Pi Pico, two MAX4466 microphone modules, and a servo motor, programmed in C++ through the Arduino IDE. We then soldered the components onto a perfboard.

The software compares the microphone signals to estimate their relative arrival-time delay. Using the microphone spacing, speed of sound, and measured delay, we estimate the sound’s direction:

$$ \theta = \sin^{-1}\left(\frac{c\,\Delta t}{d}\right) $$

Here:

  • θ is the sound’s angle relative to straight ahead.
  • c is the speed of sound.
  • Δt is the arrival-time difference between the microphones.
  • d is the distance between the microphones.

This approximation assumes the source is sufficiently far away compared with the microphone spacing. The angle’s sign depends on how we label the microphones and measure the delay.

We feed the angle measurements into a Kalman filter and use its estimate to control the servo. We also added serial diagnostics to inspect signal levels, clipping, confidence, and tracking behavior.

Challenges we faced

Getting reliable measurements was harder than simply detecting a loud noise. We encountered a disconnected microphone, unequal microphone responses, swapped signal connections, and a faulty servo. Testing each component separately helped us distinguish hardware problems from software problems.

High microphone gain caused clipping, which distorted the signals used to estimate direction. Quieter sounds created a different challenge: as a voice faded, background noise could produce measurements near the center and pull the tracker away from the speaker.

We experimented with a separate impulse-detection mode for ball bounces, then simplified the design around continuous Kalman tracking. We also found that a timed filter reset could overwrite a held position with a weak measurement.

What we learned

We learned that detecting sound and locating sound are very different problems. A strong signal is not always a trustworthy signal, and filtering cannot fully compensate for distorted inputs.

We also learned how measurement uncertainty affects a Kalman filter—and why deciding when to trust a measurement matters just as much as smoothing it. Most importantly, we learned to debug systematically: verify the wiring, inspect the signals, and then adjust the algorithm.

What's next

We want to improve quiet-sound tracking, calibrate the microphones against background noise, and make direction estimates more consistent across both sides. A future extension could add a camera, allowing the robot to first turn toward a sound and then inspect what made it.

Built With

Share this project:

Updates

Submission history