Speed Meter Using HC-SR04 Ultrasonic Sensor

by BALENDRAN ASHWIN in Circuits > Arduino

2309 Views, 3 Favorites, 0 Comments

Speed Meter Using HC-SR04 Ultrasonic Sensor

WhatsApp Image 2021-05-27 at 21.52.50.jpeg
HC-SR 04 Ultrasonic sensor is most commonly used to measure distance, but this time I will show you how to measure the speed of movement of an object using this sensor.

Description

Speed Measurement Using HC-SR04 Ultrasonic Sensor and Arduino

Device is very simple and consist only a few components:

- Arduino Nano microcontroller

- LCD display

- Ultrasonic sensor

- and LED diode

For that purpose we need to take two distance measurements in a short time apart and we have:

distance2 - distance1 = distance speed at a given time

If we make the measurements in a time period of 1 second, then we get the speed of movement of the object in cm/s. The basic code is taken from the arduino cc forum and I just added an LCD display for a visual representation of the results.

The first row shows the distance, and the second row shows the speed if the object is moving.

Building

FSYXFZKKOEBWNQG.jpg

trig Pin = 9

echo Pin = 10

CODE