ELEGOO HC-SR04 Ultrasonic Sensor is a device that can measure the distance to an object by using sound waves. It measures distance by sending out a sound wave at a specific frequency and listening for that sound wave to bounce back. By recording the elapsed time between the sound wave being generated and the sound wave bouncing back, it is possible to calculate the distance between the sonar sensor and the object.
Ultrasonic Sensor HC-SR04 is great for all kinds of projects that need distance measurements, avoiding obstacles as examples. HC-SR04 provides 2cm-400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules include ultrasonic transmitters, receivers, and control circuits.
As the name indicates, ultrasonic sensors measure distance by using ultrasonic waves. The sensor head emits an ultrasonic wave and receives the wave reflected back from the target. Ultrasonic Sensors measure the distance to the target by measuring the time between the emission and reception. The distance can be calculated with the following formula: Distance L = 1/2 × T × C where L is the distance, T is the time between the emission and reception, and C is the sonic speed. (The value is multiplied by 1/2 because T is the time for the go-and-return distance.)
Elegoo Ultrasonic Sensor HC-SR04 is inexpensive and easy to use since we will be using a Library specifically designed for this sensor, which can be downloaded from elegoo.com. To use it for Arduino projects you would need an ELEGOO UNO R3 controller board.