I would like to use the US0078-000 ultrasonic liquid flow transducer from Audiowell (specification sheet below [1]) to measure the density of liquids based on the time-of-flight (TOF) of acoustic signals and then identify their type. In particular, I am interested in differentiating between gasoline and diesel. Check the paper below [2] if you would like to learn more about the application.
I was wondering if an Arduino board is capable of generating a 2 MHz square excitation signal to drive the transducer. If so, how can I connect the transducer and program the Arduino to drive it, read the echo, and measure the TOF?
An Arduino board can easily generate a 2 MHz square wave. The details depend on the board chosen.
However, no microcontroller can drive the transducer directly, which requires an amplifier of some sort with 50 Ohms output impedance. In the data sheet example, the driving signal is 20 pulses of 0 to 2V.
If you happen to choose an Arduino Uno R3 (or similar like Pro Mini or Classic Nano), then one place to start is to study this excellent tutorial, which explains how to program one of the built in timers to output a given frequency to an output pin.
That is useful. What about the signal amplification? Do you have any suggestions for the electrical circuitry? In other words, where should I connect the transducer and the amplifier?
Sorry if my questions seem very basic, as I am new to this type of application.
Figure 1 of the transducer data sheet suggests that a circuit like this voltage divider followed by an emitter follower impedance converter would work to drive the transmit sensor. The transducer is modeled as capacitor C1, which it is only a very rough approximation.
That question has been asked many times on the forum and I have never seen anyone answer yes. It usually requires measuring very short time periods in the few nanosecond range and it seem that most arduinos are just not fast enough to provide any kind of reasonable precision.
If the OP is attempting to duplicate the system in the Arabian Journal article (linked in the OP's first post), then the times of flight are on the order of 70 microseconds for a 10 cm round trip. See snip. That's obviously not a problem for an Arduino to measure.
Maybe consider trying a DS1603L. If the "depth" of liquid is known, then you could also use that sensor to "measure" the depth, and the difference between the known and measured depths would vary depending on the fluid type.
The data sheet for the transducer describes a setup with a path length in liquid of 120 mm.
The velocity of sound in kerosene is 1324 m/s, so the one way TOF is 90.6 microseconds, which is not a problem for an Arduino to measure.
The OP seems to be unaware that the receiver is more complicated than the transmitter, and I wonder if the plastic case of the transducer tolerates exposure to gasoline.
If you are considering using just one transducer as the transmit and receive element, you may get some ideas from the schematic for the ubiquitous JSN-SR04T:
If that's true, if I were you, I'd try the DS1603L. With that non-contact sensor, you don't have to design the transmit and receive circuitry, there's no worry about whether the case can tolerate exposure to gasoline (your transducer's datasheet is silent about that), and you don't have to design a gasoline-proof fitting to hold the transducer in contact with gasoline.
Also, I hope you are familiar with the safety requirements for using electrical devices in hazardous (explosive) environments. If words like "intrinsically safe" and NEMA ratings (or your country's equivalent) don't mean anything to you, then you should not be doing this project.
I am aware of the HazLoc requirements, and I do have a background in electrical engineering, but I still need help with electronic circuit design.
I would like to use two transducers, one as a transmitter and one as a receiver to avoid the complexity of using one transducer as a transceiver. Please note that the transducers, separated by 120 mm, will be mounted on a housing case and submerged in a metallic pipe where the liquid flows. I will deal with HazLoc requirements and transducer/liquid interaction later as I'm still in the stage of building a proof of concept.
My question now is, can any Arduino board handle the TOF calculation? If so, how can I connect the transducers and program the Arduino to drive one, read the echo, and measure the TOF?