Ultrasonic ranging module HC-SR04 provides 2cm to 400cm non-contact distance measurement range. Its accuracy can reach ±3mm with a cycle period of 50ms, which is the minimum time delay recommended before measurements are taken. The module includes ultrasonic transmitter, receiver and control circuit. This project uses an ultrasonic ranging module with a Raspberry Pi to build an ultrasonic distance meter GUI.
The project can be developed by adding a button with a new function such as start function to repeat the measurment process: