Microcontroller Based Ultrasonic Distance Meter
ABSTRACT
There
are several ways to measure distance without contact. One way is to use
ultrasonic waves at 40 kHz for distance measurement.
Ultrasonic transducers measure the amount of time taken for a pulse of sound to
travel to a particular surface and return as the reflected echo. This circuit
calculates the distance based on the speed of sound at 25°C ambient temperature
and shows it on a 7-segment display. Using it, we can measure distance up to
2.5 meters. The ultrasonic transmitter unit with a 40 kHz pulse burst was excited and expect an echo
from the object whose distance want to measure. It travels to the object in the
air and the echo signal is picked up by another ultrasonic transducer unit
(receiver), also a 40 kHz pretuned unit.
The received
signal, which is very weak, is amplified several times in the receiver circuit. Weak echoes also occur due to the signals being directly received through the
side lobes. These are ignored as the real echo received alone would give the
correct distance. The output is filtered to accept 40 kHz frequencies and fed
to pin 12 of microcontroller AT89C2051, which is an analogue comparator. Pin 13
is the other pin of the comparator used for level adjustment using preset VR1. Of
course the signal gets weaker if the target is farther than 2.5 meters and will
need a higher pulse excitation voltage or a better transducer. The echo signal
will make port-3 pin 3.6 low when it goes above the level of voltage set on pin
13. This status is sensed by the microcontroller as programmed. When port-3 pin
P3.6 goes high, we know that the echo signal has arrived; the timer is read and
the 16-bit number is divided by twice the velocity of sound and then converted
into decimal format as a 4-digit number.
Here the microcontroller is used to generate 40 kHz
sound pulses. It reads when the echo arrives; it finds the time taken in microseconds
for to-and-fro travel of sound waves. Using velocity of 333 m/s, it does the
calculations and shows distance on the four 7-segment displays as centimeters
and millimeters(three digits for centimeters and one for millimeters).
Related Projects
No comments:
Post a Comment