The distance between sensor and obstacle (cm): distance = travel_distance / 2 = 0.034 × pulse_duration / 2 = 0.017 × pulse_durationĪrduino - Ultrasonic Sensor Arduino's pins can generate a 10-microsecond pulse and measure the pulse duration. The travel distance of the ultrasonic wave (cm): travel_distance = speed × travel_time = 0.034 × pulse_duration The speed of the ultrasonic wave: speed = SPEED_OF_SOUND = 340 m/s = 0.034 cm/µs The travel time of the ultrasonic wave (µs): travel_time = pulse_duration Measures the pulse duration in ECHO pin, and then calculate the distance between sensor and obstacle.Generates a 10-microsecond pulse on TRIG pin.How to Get Distance From Ultrasonic Sensor To get distance from the ultrasonic sensor, we only need to do two steps (1 and 6 on How It Works part): Micro-controller: measures the pulse duration in the ECHO pin, and then calculate the distance between sensor and obstacle.The duration of the pulse is equal to the travel time of the ultrasonic wave. Ultrasonic sensor: generates a pulse to the ECHO pin.The ultrasonic sensor: detects the reflected ultrasonic wave and measures the travel time of the ultrasonic wave.The ultrasonic wave: is reflected after hitting an obstacle.The ultrasonic sensor: automatically emits the ultrasonic waves.Micro-controller: generates a 10-microsecond pulse on the TRIG pin. ![]() Arduino measures the duration of pulse to calculate distance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |