If you aren't familiar with it, the HC-SR04 is very commonly sold sensor for the IoT and maker markets and uses Sonar (like a Bat) to find distance to an object. It has a sender and a transmitter which sends out a small ultrasonic pulse which bounces off of an object and back to the sensor. Because of how this works please take into consideration that small objects and those that don't reflect sound (like cloth or soft fuzzy things) may not work well with this sensor. It works best with hard and reflective items like glass, metal and most plastics. If you search around you can find that several vendors sell the HC-SR04 sensors and if you price shop you can sometimes find them under $2 each, although watch out for shipping times and charges as many times the very inexpensive vendors ship from China instead of the US.