Speed Measurement Using HC-SR04 Ultrasonic Sensor and Arduino

by mircemk in Circuits > Arduino

493 Views, 3 Favorites, 0 Comments

Speed Measurement Using HC-SR04 Ultrasonic Sensor and Arduino

DSCN5853.JPG

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.

There is also an LED that signals the distance at which the object is placed. If the distance is less than 5 cm, the LED lights up continuously. As the distance increases the LED starts flashing at a speed that depends on the distance of the object. If the object moves away, the blinking is slower, and vice versa.

Building , Schematic and Code

Untitled Sketch_bb.jpg
DSCN5786.JPG
DSCN5779.JPG
DSCN5781.JPG
DSCN5783.JPG