ultrasonic sensor programming

Post on 10-Feb-2022

6 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Ultrasonic Sensor Programming

with Arduino

ByProf.Dr. Eng. Tamer Medhat tmedhatm@eng.kfs.edu.eg

www.kfs.edu.eg/drtamer.html

For example, if the object is 20 cm away from the sensor, and the speed of thesound is 340 m/s or 0.034 cm/µs the sound wave will need to travel about 588microseconds. But what you will get from the Echo pin will be double thatnumber because the sound wave needs to travel forward and bouncebackward. So in order to get the distance in cm we need to multiply thereceived travel time value from the echo pin by 0.034 and divide it by 2.

How does Ultrasonic Sensor?

0.034 cm/µs

Questions?

Components for Testing Ultrasonic Sensor

UltrasonicSensor with ArduinoAndSerial Monitor

UltrasonicSensor with Arduinoand Buzzer

UltrasonicSensor with Arduinoand LCD

Questions?

top related