The HC-SR04 is a low-cost ultrasonic sensor that can measure distances from 2cm up to 4m with stable performance and high-ranging accuracy under a 15 detection angle. This sensor can interface with Arduino or any other microcontroller. You can easily find coding for this sensor on the web.