ModuLab logo ModuLab Build • Play • Explore
Classroom Login Register

Robot Brain Mission 5 - Give It Echo Ears Pupil Notes

Add the ultrasonic distance sensor. It sends a tiny sound pulse and listens for the echo. The robot brain uses the echo time to estimate distance.

In This Lesson

Mission 5: Give It Echo Ears

Big Question

How can a robot sense that something is nearby without touching it?

Your Mission

Add the ultrasonic distance sensor. It sends a tiny sound pulse and listens for the echo. The robot brain uses the echo time to estimate distance.

Parts

  • Bluepill on breadboard
  • Ultrasonic distance sensor
  • Jumper wires

Build

  1. Place the ultrasonic sensor so the two round parts face outward.
  2. Connect power and ground.
  3. Connect the trigger and echo wires to the pins shown in ModuLab.
  4. Keep the sensor pointing into open space.

Connect

  1. Plug in USB.
  2. Press **Connect**.
  3. Open the sonar or distance panel.

Try It

Move your hand:

  • far away
  • halfway
  • close

Watch the distance value change.

Success Check

  • The number changes when your hand moves.
  • Close objects give a smaller number.
  • Far objects give a bigger number or no reading.

Debug

If the number is stuck:

  • Check trigger and echo are not swapped.
  • Keep your hand flat in front of the sensor.
  • Move slowly.
  • Check power and ground.

Remix

Make the display show:

  • FAR
  • NEAR
  • STOP

Choose your own distance limits.

Robot Brain Idea

Sensors are inputs. They let the robot brain learn something about the world before choosing what to do next.