Here is a simple example about how to use the Ultrasonic sensor to detect objects.
Parts List
Arduino UNO R3 (I use the Adafruit mount)
One (1) HC-SR04 Ultrasonic Sensor
One (1) Red LED, One (1) Green LED
Two (2) 560 ohm (Green, Blue, Brown, Gold) Resistors
(more…)