Arduino – Ultrasonic Sensor with LEDs and buzzer


Hi guys,

This is my first tutorial,  I’ve just started a few months ago learning electronics (previously I’ve just knew how to program in C and Python). When I finished this project (took me about 5 hours or something) I’ve decided to share to help anyone that is starting in electronics.

What’s this project about?

Basically we have an Ultrasonic sensor that measures the distance and the LED’s bar graph will light up according to our distance from the sensor and as we get closer the buzzer beeps in a different way. This circuit can work as a parking sensor! It’s easy and cheap.

Parts Required

  • 1x Arduino (Click to see on Amazon)
  • 1x 74HC595 8 Bit Shift Register
  • 1x Breadboard
  • 8x LEDs (for example: 3x red, 3x yellow, 2x green)
  • 9x 220 Ohm Resistors
  • 1x Buzzer
  • 1x Ultrasonic Sensor (for exemple: HC-SR04)
  • Jumper Wires




Upload the Code below

Watch the video demonstration

Thanks for reading, you can contact me by leaving a comment. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Leave a Comment:

Add Your Reply