Challenge

Project 2 - Measuring the distance of an object using ultrasonic sensor and also smoothen the sensor data using moving average filter

project link:

https://www.tinkercad.com/things/aA24ehScEWL

objective of the Project:

In this project the implementation of code for “Measuring distance of an object using ultrasonic distance sensor (HC-SR84) and also smoothen the sensor data using moving average filter”.

Goals:

  • Measuring the distance in terms of inches of an object using Ultrasonic Distance Sensor (HC-SR84).
  • The sensor data is smoothened by using Moving average filter technique to eliminate the high frequency variations from the sensor data.

Key Highlights of the Project:

  • Measuring the distance travelled by the wave to the object and gets bounced back from the object to sensor.
  • Smoothening the sensor data by moving average filter technique, the filter has a window of certain size. That window determines that how many data the filter can take.

Deliverables of this project:

  • The distance travelled by a wave to the object for which we want to measure the distance using Ultrasonic Distance Sensor (HC-SR84).
  • Eliminate the high frequency jitters from the sensor data by Moving Average filter to smoothen the sensor data.

components used:

Name Quantity Component
U4 1 Arduino Uno R3
U5 1 LCD 16 x 2
Rpot1 1 250 kΩ Potentiometer
R1 1 220 Ω Resistor
DIST1 1 Ultrasonic Distance Sensor

CIRCUIT DIAGRAM (connections):

code used in circuit:

output:

SOME INFORMATION ABOUT COMPONENTS USED IN PROJECTS AND KEYWORDS:

Ultrasound is a high-pitched sound wave whose frequency exceeds the audible range of human hearing.

Humans can hear sound waves that vibrate in the range of about 20 times a second (a deep rumbling noise) to 20,000 times a second (a high-pitched whistle). However, ultrasound has a frequency of more than 20,000 Hz and is therefore inaudible to humans.

Project summery:

The program uses the LiquidCrystal library to communicate with an LCD display, and the ultrasonic sensor HC-SR04 to measure distance. The program first initializes the LCD display and sets the pins for the ultrasonic sensor's trigger and echo. In the setup() function, it displays some text on the LCD and then clears it for the main loop. In the loop() function, the program sends a trigger pulse to the ultrasonic sensor, then measures the time it takes for the echo pulse to return using the pulseIn() function. It then uses the time and the speed of sound to calculate the distance to an object and displays the distance in centimeters and meters on the LCD. The program then waits for 1 second before measuring the distance again.

project link:"">>

https://www.tinkercad.com/things/aA24ehScEWL

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.