![]() Sound waves are transmitted by the transmitter, hit the object, and then received by the receiver. Let’s suppose there is an object in front of the sensor at a 10 Cm distance. Let’s understand this once again by an example: We did this manually to show you how the distance is calculated. Of course, this calculation is done by the Arduino itself. And since the total distance is actually double the one-way distance, we divide it by two to get the one-way distance from the sensor to the object. But we want to measure the one-way distance. Step 5: This(total distance) is actually a two-way distance. This gives us the total distance traveled by the sound waves. So simply multiply the total calculated time by the speed of sound. Step 4: By the distance-time-speed formula, we can calculate the total distance traveled by the wave(speed is constant). OR T total = t 2 - t 1 (total time taken by the sound waves to get back to the sensor after reflecting back from the object) i.e, t 2 - t 1 = time for which the Echo pin remains high In other words, the echo was high for exactly the same time it took the waves to get back to the receiver. Step 3: Now in order to find out the distance traveled by the waves, first we have to measure the total time for which the echo pin was high(Arduino does this for us). Let’s call the time at this instance t 2. ![]() And as soon as the waves are received back by the receiver, the Echo pin becomes low. Step 2: These sound wave travels through the air and gets reflected back by the object in front of it. Note B: The speed of the sound wave is 343 m/s Let’s say the time at this instance is t 1. Note A: At the same time, the Echo pin automatically becomes high(gives 5 V as output). Step 1: As soon as the Trigger pin is set High(programmed), sound waves are transmitted from the transmitter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |