21-01-2013, 10:16 AM
Microcontroller Based Ultrasonic Distance Meter
1Microcontroller Based Ultrasonic.docx (Size: 704.85 KB / Downloads: 54)
Introduction
Background
There are several ways to measure distance without contact. The technique of distance measurement using ultrasonic in air include continuous wave and pulse echo technique. In the pulse echo method, a burst of pulses is sent through the transmission medium and is reflected by an object kept at specified distance. The time taken for the pulse to propagate from transmitter to receiver is proportional to the distance of the object. For contact less measurement of the distance, the device has to rely on the target to reflect the pulse back to itself. The target need to have a orientation that it is need to be perpendicular to the direction of propagation of the pulses. The amplitude of the received signal gets significantly attenuated and is a function of nature of the medium and the distance between the transmitter and the target. The pulse echo or time of flight method of range measurement is subject to high level signal of attenuation when used in an air medium, thus limiting its distance range.
Distance measurement
Distance measurement proceeds after the echo signal is received. The echo signal is used as a form of interrupt signal to the microcontroller. The amplitude of echo is very small as compared to the transmitted signal. Thus the echo is received only when the object whose distance is measured from a reference point is must be within the specified range. When echo signal is received, thus microcontroller calculate the time of flight and this time is multiplied to the velocity of sound in air medium. This result the distance of the object is measured.
Statement of problem
Main objective of this project is to measure the distance of an object from a fixed point. Thus, this project is to design and implement the distance measurement system using a microcontroller, LCD & C codes on mide. The ultrasonic transmitter produces the ultrasonic wave & the reflected wave is received by the ultrasonic receiver sensor. The ultrasonic transmitter transforms an electrical signal into an ultrasonic wave & ultrasonic receiver transforms an ultrasonic wave into an electrical signal. If the target is within the specified range then the distance is measured otherwise not.
Need of the project
Since the manual procedure is difficult & somehow this method of measuring technique of distance is not exact due to the various faults such as misreading of number, error of scale, temperature, fixing of the scale etc.
Hence, to overcome those difficulties, we need like ultrasonic distance measurement electronic device. The distance between two object is not possible with the help of simply scale or tape, such as distance between two bank of sea, distance between two planets’, the distance between two aircrafts’ or the distance between aircraft and the earth. Thus, for those purpose we need high power of ultrasonic transducer.
Design Consideration
In this project, I designed the system using the C-programming codes in MIDE. Since C-code is simpler than Hex code, it is easy design the system using C language. But microprocessor needs hex code, thus MIDE compiler generates the Hex code, then which burn into the microcontroller.
Microcontroller:
The AT89C51 is a low-power, high performance CMOS 8-bit microcomputer with 4K byte of flash programmable & erasable read only memory (PEROM). The on-chip Flash allow the program memory to be reprogrammed in system or by a conventional nonvolatile memory programmer. The AT89C51 microcontroller provides a highly flexible & cost effective solution to my project.
The specific microcontroller has been chosen as it provides 128 byte of RAM & 4K byte of EEPROM for storing programs. It has a serial communication configure register (SCON), which has to be properly configure to start the microcontroller in serial communication mode. It also provides two timers. The timer can be configure to set the desired baud rate.
LCD
LCD is a Liquid Crystal Display device. A LCD is a thin, flat panel used for electronically displaying information such as text, image, & moving pictures. Its’ uses include monitors for computers, television, instrument panels & other devices ranging from aircraft cockpit displays, video player, gaming devices, clocks, watches, calculators & telephone etc. Among its’ major feature are its’ lightweight construction, portability, low electrical power consumption.
Ultrasonic Transmitter & Receiver:
The positive going pulse is applied to one of the terminal of ultrasonic transmitter & the signal is transmitted. Then the echo signal is received by the receiver sensor after reflection, which is very weak, is amplified several times in by the gain amplifier & then this signal fed to the microcontroller.
Ultrasonic sonar sensors actively transmit acoustic waves and receive them later. This is done by ultrasonic transducers, which transform an electrical signal into an ultrasonic wave and vice versa. The ultrasound signal carries the information about the variable to be measured. The task of the ultrasonic sensors is not merely to detect ultrasound, as intelligent sensors they have to extract the information carried by the ultrasonic signals efficiently and with high accuracy. To achieve this performance, the signals are processed, demodulated and evaluated by dedicated hardware.
Temperature
The velocity of sound in air is 332 m/sec at zero degree C, it is directly proportional to air temperature. As the ambient air temperature increases, the speed of the sound is also increases. There if a fixed target produces an echo after a certain time delay, and if the temperature drops, the measured time for the echo to return increases, even though the target has not moved. This happens because the speed of the sound decreases, returning an echo more slowly than at the previous, warmer temperature. If varying ambient temperatures are expected in a specific application, compensation in the system for the change in sound speed is recommended.
Atmospheric Pressure
Normal changes in atmospheric pressure will have little effect on measurement accuracy. Reliable operation will deteriorates however, in areas of unusually low air pressure, approaching a vacuum.
Humidity
Humidity does not significantly affect the operation of an ultrasonic measuring system. Changes in humidity do have a slight effect, however, on the absorption of sound. If the humidity produces condensation, sensors designed to operate when wet must be used.
Acoustic Interference
Environments that contains background noise which intermixed with ultrasonic waves. thus it may affect system operation.
Conclusion
The microcontroller with LCD makes it user friendly and can be embedded in a single unit. The circuit has been implemented on bread board and tested for its functionality by varying the distance between the transducer and the target. The target surface needs to be perpendicular to the impinging ultrasound waves. The power level of the signal is too low for long range measurement.
This circuit is designed to measure the distance upto 2.5 meters. The system can be design for lager range & this is done by using more efficient sensors.