Distance Detector With Buzzer and LED Meter.

About: I work for an IT company in Boise, ID where I do computer/server/networking/IT things. I got an Arduino to work on solidifying my programming skills and experimenting with hardware.


This is a simple distance detection circuit with the use of an ultrasonic sensor, a buzzer, a row of LEDs, and 2 relays (optional).

The ultrasonic distance sensor will light a row of LEDs depending on distance. Then if a change in distance is detected, that exceeds your threshold, a buzzer will sound and the optional relays can toggle a device (a light).

All options are configurable such as the threshold, number of LEDs, maximum perceived distance, etc...

You can download the Fritzing application to assist in the build/codeing process here: http://fritzing.org/download/


  • Garage parking sensor
  • Electronic measuring device
  • Security alarm
  • Motion detection
  • Add complexity to your everyday shenanigans.

This is my first project on the Arduino and using C++ so please be gentle ;)

*** Now with Mario sounds!!! ***

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Build It

Build the circuit using the listed parts:

  • 1 Ultrasonic sensor (I use the 4 prong model)
  • 1 Buzzer
  • 2 Relays (optional)
  • 8 LEDs (4 red, 2 yellow, 2 green)
  • 8 220 ohm resistors
  • A plethora of jumpers

Step 2: Code It

Using the supplied code, write your program. I have included comments in the code to explain what each section is doing. You can then modify the code to fit your needs.

Step 3: Resources

Be the First to Share


    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    2 Discussions


    3 years ago

    Piece of cake to make, thanks!


    3 years ago

    Really cool! I love arduino things like this!