Introduction
This is a project that we have done in the measurement lab in the American University of Sharjah. We use an ultrasonic transducer with signal conditioning circuits in order to reach to a valid relationship between the input to the system (distance of the transmitter and receiver) and the output of the system which can be measuremed as a time difference using LabVIEW.
Steps to Complete
The diagram below shows a general description for the components needed for this project. Description is given below as well.
1- Ultrasonic wave generation:
The process starts from the Signal Generator, a 40 KHz sinusoid. This value was obtained from the documentation of the ultrasonic transceiver that we have in the lab which represents the resonant frequency of the transceiver’s crystals. We had to tune the input frequency in order to get maximum output which occurred at frequency of 40.125 KHz. The generated signal is transmitted to the next stage, modulation.
2- Modulation:
We used a 2N7000 MOSFET as a switching device, the ultrasonic signal was inputted to the drain of the MOSFET. A 10v peak to peak signal at 10 Hz frequency was used to switch the MOSFET on and off by connecting the signal to the gate of the MOSFET. The output which is an ultrasonic signal in an envelope of 10 Hz is sent to the ultrasonic transmitter. The signal penetrates the air until it hit a reflecting surface and, if aligned properly, goes back to the system through the ultrasonic transducer. The received signal is amplified and sent to the next stage, signal reconstruction.
3- Signal Reconstruction:
Signal reconstruction, in other words, demodulation, is done in two stages. First, the envelope is detected using a diode, a 1N4001 diode was used along with a low pass filter which consists of a resistor and a capacitor in parallel. After that, the obtained signal was passed to a comparator which will sharpen the edges and give the required peaks value. For this purpose we used three different types of comparators (in parallel) and compared between the results from each and then chose the most suitable for our purpose. The first is a uA741 opamp, the filtered signal goes to the non inverting input and a variable dc voltage (controlled by a potentiometer) is applied to inverting input which acts as a threshold for the trigger. The output levels are +Vcc and –Vcc which are supplied by a DC power supply. The second comparator was made of an LM311P comparator. The inverting input is the filtered signal and the non-inverting input is a variable threshold voltage (using a potentiometer). The output was taken from an open emitter with a pull-down resistor. The output levels are zero and +Vcc. The third comparator is the same as the first one, however, with a TLC272 opamp and output levels of zero and five volts. We found that the LM311P comparator give us the best result so we set the biasing supply voltage to 5vots such that the signal can be processed digitally.
4- Time Delay Calculation:
We used National Instrument’s CompactRIO embedded FPGA real-time processor for calculating the time difference in time between the transmitted and received signal, this will give a relation that is directly proportional to the distance between the ultrasonic transceiver and the obstacle. The fed signals here are the 10 Hz clock signal and the received and reconstructed signal. The program shown below was downloaded to CompactRIO FPGA to acquire the data:
The acquired data are then sent to the host LabView VI to display the results, following is the CompactRIO VI block diagraml:
And below are the host VI block diagram and frontpanel
Additional Notes
- The ultrasonic transceiver is a piezoelectric device which has a specific resonance frequency, 40 KHz. The only way to get this value is by using a pure sinusoid. We tried using a square and triangular waveforms which caused the received signal to flicker, which indicates the presence if the resonance frequency as well as other frequencies which matches the theoretical explanation that a square and triangular waveform can be constructed from pure sinusoids at different frequencies.
- Another important observation that we noted is that the ultrasonic transeiver does not work with a non-inverting amplifier as we get an output of -5Vdc from a uA741 opamp amplifier (gain =11). Connecting the modulated signal directly to the opamp without the ultraonic transiever gives normal output. Why? so far we do not have a definite answer.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.