Bats & Dolphins: Seeing with Sound

How does a bat fly in total darkness? Echolocation. Learn how we use the same physics with Ultrasonic Sensors to keep robots from crashing.

Bats & Dolphins: Seeing with Sound

Nature invented radar millions of years before humans. Bats flying in caves and dolphins swimming in murky water cannot see. Yet, they catch tiny bugs or fish with surgical precision. They use Echolocation (Sonar). They scream, and they listen for the echo.

In robotics, we use 5-dollar components to mimic this superpower.

The Physics of the “Ping”

Sound is a wave. It travels at roughly 343 meters per second (the Speed of Sound). If you shout into a canyon, the sound wave travels out, hits the wall, and bounces back.

  • If the echo takes 1 second, the canyon is far.
  • If the echo comes back instantly, the wall is right in front of you.

The Ultrasonic Sensor (HC-SR04 / REV Ultra)

Look at the front of a Roomba or a hobby robot. You often see two silver cylinders that look like eyes. Those aren’t eyes. One is a Speaker (Transmitter). One is a Microphone (Receiver).

  1. Trigger: The robot sends a command.
  2. Ping: The speaker emits a high-frequency chirp (40kHz) that humans can’t hear.
  3. Echo: The robot waits. The sound hits the wall and bounces back.
  4. Math: The chip measures the time (in microseconds).
    • Distance = (Time x SpeedOfSound) / 2
    • We divide by 2 because the sound had to travel there and back.

Why Cameras Can’t Replace Ears

Why use Sonar when we have 4K Cameras?

  1. Glass and Mirrors: A LiDAR layout or a camera sees right through glass. Sound bounces off it. If your competition field has clear polycarbonate walls (which FTC does), cameras might think it’s open space. Sonar sees the wall.
  2. Computing Power: Analyzing a video feed requires a heavy processor (Raspberry Pi). Reading a ping sensor takes almost zero code. It’s fast and cheap.

The “Wall Follower”

One of the most reliable autonomous programs is the Wall Follower. Just like a bat flying alongside a cave wall:

  • “If Distance > 10cm, Turn Left (Closer).”
  • “If Distance < 10cm, Turn Right (Away).”
  • “If Distance = 10cm, Drive Straight.” This allows a robot to navigate a maze blindly, just by “feeling” the walls with sound.