Get an LED to light up when something is detected within a specified distance. Super easy starter project or good for troubleshooting parts. 

Parts List:

HC-SR04 UltraSongic Distance Sensor

Arduino UNO

Breadboard, half size

1K Resistor



This is a very simple project.  Follow this sketch:










Full size:


LED: 11

Echo: 12

Trig: 13


Then upload the attached code. The distance is in centemeters and in the code is set to 50cm. Change to your desired distance and you should be good to go!


Check out this YouTube video for additional info:


This is intended to be an MVP for a much larger robot project. I will be building on this to make a robot that can recognize faces and greet people by name. Subscribe to my YouTube channel to follow along: