The HC-SR04 is an ultrasonic distance sensor that utilizes high-frequency sound waves to measure the distance between the sensor and an object. Offering non-contact measurement functionality, this economical device can accurately detect distances ranging from 2 cm to 400 cm, with a precision of up to 3 mm. The HC-SR04 is equipped with four pins: VCC (Power), Trig (Trigger), Echo (Receive), and GND (Ground). Additionally, its built-in control circuitry helps prevent inconsistent “bouncy” data, depending on the application.
Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.