distance measuring sensor

Not rated 26,197

distance measuring sensor
distance measuring sensor

One basic method for distance measurement involves using an ultrasonic transducer. The principle is to send a burst of ultrasonic waves towards an object, which reflects the waves back to the ultrasonic receiver. By measuring the time delay between transmission and reception, it is possible to accurately determine the distance to the object. However, there are some drawbacks to this method. An ultrasonic transducer operates at a defined center frequency, typically between 30 kHz and 45 kHz, which may require frequency generation using an AVR microcontroller. It is important to note that the principle of measuring the propagation time of the signal is not applicable for infrared (IR) signals, as they travel at the speed of light, making it challenging for even the fastest microcontrollers to respond. For instance, an IR signal traveling a distance of 30 cm would take approximately 1 nanosecond. If there are any uncertainties regarding the working of the transducer, it is advisable to search for relevant topics on forums or post questions in the appropriate section. The pinout and specifications of ultrasonic transducers can vary by manufacturer and should be provided by the vendor. When inquiring about a sensor pair, it is essential to obtain the specifications. A project involving ultrasonic distance measurement and object counting was previously conducted using a transducer pair operating at 33 kHz interfaced with an 8085 microprocessor. This was during a time when 8051 core microcontrollers were rare in the Indian market, with Intel being the sole manufacturer of the 80C31 and 87C51 series. A square wave signal of 40 kHz can be generated at any port pin using the AVR's internal timer, employing the PWM principle with a fixed 50% duty cycle. The voltage level of the square wave should be amplified according to the sensor's datasheet before being sent to the transmitter, as the operating voltage affects the range of the sound wave. An NPN power transistor can be used for amplification. The principle involves generating a limited train of pulses at the specified frequency (10 to 20 pulses is sufficient) while simultaneously starting an internal timer in the AVR. The timer should be stopped upon receiving the first pulse from the receiver, with the timer value being directly proportional to the total distance traveled by the wave. The ultrasonic transmitter utilizes a 4011 quad 2-input NAND gate, where two gates (IC1a and IC1b) form a conventional CMOS astable circuit. The oscillation frequency is determined by capacitor C1 and resistors R6 and R7, with a preset VR2 for frequency adjustment. Gates IC1c and IC1d buffer the outputs from IC1a and IC1b, driving the ultrasonic transmitter transducer (X1) in a push-pull configuration. In the receiver circuit, the ultrasonic echo signal is captured by transducer X2, amplified by a two-stage amplifier using transistors TR1 and TR2. The output from TR2 is rectified by diode D1 and smoothed by capacitor C4, resulting in a voltage level at the inverting terminal of IC2 that varies between 1.4V and 2.7V when no ultrasound echoes are detected, and drops to 1.2V upon receiving a strong echo. This rectified signal is sent to the inverting input (pin 2) of op-amp comparator IC2, where it is compared with a reference voltage set by preset VR3.

The ultrasonic distance measurement system operates on the principle of time-of-flight measurement, where the time taken for an ultrasonic pulse to travel to an object and back is used to calculate the distance. The speed of sound in air is approximately 343 meters per second, and thus the distance can be calculated using the formula:

Distance = (Time * Speed of Sound) / 2

The design of the ultrasonic transmitter involves careful consideration of the oscillation frequency, which must match the resonant frequency of the transducer for optimal performance. The use of a CMOS astable multivibrator allows for precise frequency control, enabling the generation of ultrasonic waves that can effectively propagate through the air.

The receiver circuit must be designed to detect weak ultrasonic signals, which requires high sensitivity amplification. The two-stage amplifier configuration ensures that even small echoes are amplified sufficiently for further processing. The rectification and smoothing stages convert the AC signal from the transducer into a usable DC voltage, which is then compared against a reference voltage to determine the presence of an echo.

For practical implementation, attention should be paid to the layout of the circuit, ensuring that components are placed to minimize noise and interference. Proper grounding and shielding techniques can enhance the performance of the system, especially in environments where external ultrasonic noise may be present. The overall design should also include considerations for power supply requirements, ensuring that the system operates reliably over its intended range.One crude method for distance measuring is by using an ultrasonic transducer. the principle is that u send a burst of ultrasonic wave in the direction of the object and it is reflected back to the ultrasonic receiver. by measuring the time delay from transmission to reception, u can measure fairly accurately the distance of the object.

the drawbacks are: note that u get a ultrasonic pair with a defined centre frequency (usually just above the audio range i. e between 30khZ and 45khz). and u may have to create the frequency using the AVR. please post the method/principle involved (if possible) because the principle of measuring propagation time of the signal is definitely ruled out as the IR signal travels at the speed of light which is too fast for even for the fastest uC to respond to. e. g. for the signal to travel a distance of say 30cm, the IR signal would take roughly 1nanosecond. If u have any doubts on their working, search for the appropriate topic on the forum ( where ur doubts ma have been raised by some other member and the solution already suggested) and if ur doubts are still not cleared, post it on the forum on the appropriate section by starting a new thread.

the pinout of utrasonic transducers and their specifications vary with the manufacturer and should be provided by the vendor/manufacturer along with the sensor itself. So when u enquire about the sensor pair, be sure to get the specifications of the sensor. I myself had done a project on ultrasonic distance measuring/object counting and used a ultrasonic transducer pair operating at 33khz interfaced to a 8085 uP(8051 core uCs were a rarity in those days as the technology itself had just entered the indian market at that time!

the only manufacturer was intel with the 80c31 and the 87c51 series. ). Had purchased it in mumbai itself from a company called pulse echo systems and the company had sent all the details but that was a long time ago ( more than 10 years back. even the firm does not seem to exist anymore!). u can generate a square wave of 40khz at any port pin using the AVR internal timer (use the PWM principle with a fixed 50% duty cycle.

). Now, amplify the voltage level of the square wave according to the data sheet before feeding it to the transmitter. ( if i remember correctly, the sensor can operate at more than 30V DC). this is neccesary because the range of the sound wave is dependent on the energy u transfer to it which is directly proportional to the operating voltage.

u can achieve it using a simple NPN power transistor. now the principle as i explained earlier is that u have to generate a limited train of pulses at that frequency (10~20 pulses is sufficient). simultaneously, start a internal timer inside the AVR. the next step would be to stop the timer as soon as u receive the first pulse from the receiver. the timer value would be directly proportional to the total distance travelled by the wave. Ultrasonic Transmitter is based on a 4011 quad 2-input NAND gate. Two of the gates, IC1a and IC1b, are used as a conventional CMOS Astable circuit whose oscillation frequency is set by capacitor C1, resistors R6 and R7, plus preset VR2, which adjusts the frequency.

Gates IC1c and IC1d buffer the outputs from IC1a and IC1b and drive the ultrasonic transmitter transducer, X1, in push-pull mode. In the Receiver circuit, ultrasonic echo signal is received by transducer X2. It is first amplified by the 2-stage amplifier based on transistors TR1 and TR2. The output from TR2 is rectified by diode D1 and smoothed by capacitor C4. The result is a voltage level at inverting terminal of IC2 which varies between 1 ·4V and 2 ·7V when X2 is not receiving ultrasound echoes, but falls to 1 ·2V when a strong enough echo from an object is detected.

The rectified signal goes to op amp comparator IC2`s inverting input, pin 2. The signal is compared with a reference voltage set by preset VR3, and applied 🔗 External reference