This calculator can be used with an HC-SR04 Ultrasonic Distance Sensor. The sensor uses high frequency audio to measure the distance to an object between 2cm and 400cm from the front of the emitters, with a manufacturer’s stated accuracy of around 3mm. The non-audible tone is broadcast when the TRIGGER pin is brought high and the time it takes for that signal to be reflected back is presented as a pulse of corresponding width on the ECHO pin. Measure the pulse width, and you know the distance.
The calculators below will help you to verify the accuracy of your device under test by calculating what the measured sensor distance should be, based on the pulse length provided. Conversely, you can determine the expected pulse length based on a distance provided. All calculations require using the speed of sound in air which varies with temperature. Standard room temperature is 20°C / 68°F.
Enter pulse length in milliseconds
VALUES USED AS CONSTANTS
RATIO OF SPECIFIC HEATS 1.40 γ
INDIVIDUAL GAS CONSTANT – AIR 286.90 J/kg K
Enter temperature in degrees Celsius
Enter pulse length in milliseconds
VALUES USED AS CONSTANTS
RATIO OF SPECIFIC HEATS 1.40 γ
INDIVIDUAL GAS CONSTANT – AIR 1,716.00 ft lb/slug °R
Enter temperature in degrees Fahrenheit
Enter distance in Centimeters
Enter distance in Inches