1 Introduction

In many issues related to measurement properties of the gas and gas mixtures, it is important to determine the speed of sound. In case of the gas mixture, this information allows us to calculate its percentage composition [1,2,3]. That is why, commercial sensors available on the market [1, 2] use the technique where the speed of sound is determined by analyzing the resonance frequency of an acoustic resonator inside which the gas sample is placed [4, 5]. The sensors excite the acoustic resonator by the acoustic signal and analyze its response. The resonance frequency is calculated according to the method based on fast Fourier transform (FFT) or a swept frequency technique [6]. A further analysis is done using the signal processing. Unfortunately, to track fast composition changes a signal processing adds a delay. This delay limits system application usage.

On the other hand, the speed of sound can be also determined by other methods. For example, in the technique named the time-of-flight (TOF) [7, 8], the speed of sound can be found by the time needed for a pulse of sound to travel a known distance. Measurements obtained using such a technique correspond to the theory for the resonator with long path lengths. Unfortunately, this enlarged measurement sensor requires quite a big amount of gas to fill the pipe. So, the response time is limited due to the time required to refill the whole volume.

Another technique makes use of the phase shift between continuously transmitted and received acoustic signals [9, 10]. The phase difference between transmitted and received signals is a function of the sound speed. This method can be used to measure the sound speed over small path lengths which can have the length as short as one wavelength.

We would like to present another method which allows us to measure the resonant frequency of an acoustic resonator with a short response time directly. The resonance frequency can be directly measured in the same way as a signal frequency.

2 The Description of the Measurement Method

The presented method of the measurement of the speed of sound in gas mixtures uses the positive feedback. The light source was driven by photoacoustic signals in a positive feedback loop. We used this approach in the concept of the self-excited photoacoustic generator [11, 12] earlier. But instead of the acoustic Helmholtz resonator, now a longitudinal resonator was used. The longitudinal resonator was chosen because of its direct relationship between the fundamental resonance frequency of the resonator and the sound speed. For the used longitudinal resonator closed at both ends, the resonance frequency can be specified as:

$$\begin{aligned} f=\frac{c}{\hbox {2}\cdot L} \end{aligned}$$
(1)

where f is the fundamental resonance frequency, c is the speed of sound, L is the resonator length. The speed of sound depends on the chemical composition and temperature of the gas. The following formula describes this relation [13]:

$$\begin{aligned} c=\sqrt{\frac{\gamma \cdot p}{\rho }}=\sqrt{\frac{\gamma \cdot R\cdot T}{M}} \end{aligned}$$
(2)

where p is pressure, R is the universal gas constant, T is the temperature of the gas. Properties of the gas are described by: \(\rho \) the density, \(\gamma \) the specific heat ratio, M the molar mass. In case of gas mixtures, the formula (2) will contain the sum of each gas component, \(\gamma _{i}\) (3) and \(M_{i}\) (4), and \(x_{i}\) is the fraction of the i component [3].

$$\begin{aligned} \gamma= & {} \sum _i^N {x_i \cdot \gamma _i } \end{aligned}$$
(3)
$$\begin{aligned} M= & {} \sum _i^N {x_i \cdot M_i } \end{aligned}$$
(4)

Thus, if a longitudinal acoustic resonator is filled with a gas mixture, then the physical properties of this mixture will determine the resonant frequency of the resonator along with mechanical dimensions of the acoustic resonator. A change in the composition of the gas mixture response immediately causes the change in resonance frequency. This resonance frequency can be measured in a simple way, e.g., by the frequency meter.

3 The Measurement Setup

The block diagram of the used system is given in Fig. 1. The main component of the measurement system is a longitudinal acoustic resonator. Windows are placed on the optical axis of the resonator, the surface of one of the windows is covered by carbon black which is a strong absorbing light beam material. As a result of the light beam absorption produced by the LED controlled by the LED driver, the covered window produces a strong photoacoustic signal which generates the acoustic wave.

Fig. 1
figure 1

The block diagram of the measurement system

Fig. 2
figure 2

The photograph of the used measurement setup

The photoacoustic effect is used only for the excitation of the acoustic wave. The linear dependency between acoustic amplitude and a wide range of frequency is used in order to provide a proper condition for the positive feedback loop. A nonlinear response or a resonance response can cause oscillations at frequencies other than the acoustic resonator.

As a result of the photoacoustic effect, the acoustic signal is generated inside the resonator and converted by the microphone into an electrical signal. The signal from the microphone is amplified and fed into the input of the LED driver. The amplifier works in a way that its gain is reduced when the signal from the amplitude detector is close to set threshold. This mechanism prevents the amplifier from saturation and produces a sinusoidal signal instead of a square one at output. The positive feedback loop automatically excites acoustic oscillations, whose frequency is recorded by a microcontroller. An analogue comparator is used in order to adapt amplifier output signal to a microcontroller. This changes a sinusoidal signal to a square one with an appropriate voltage level for a microcontroller. We use the STM32F4 family microcontroller which works as a frequency meter. The photograph of the measurement setup is shown in Fig. 2.

4 The Results of Measurements

The mixtures of carbon dioxide and argon with nitrogen were prepared in order to test the properties of the different mixtures. The gas samples were prepared using three syringes, and then the gas mixture was injected into the longitudinal acoustic resonator (59 mm long and 4 mm diameter). The oscillation frequency of the photoacoustic generator was changed and self-adjusted to the resonance frequency of the resonator immediately after each sample was injected into the resonator. The measured resonance frequency for the longitudinal acoustical resonator filled with air was 2.897 kHz, while the theoretical value was calculated on the basis of Eqs. 14 and amounted to 2.9068 kHz. The measured results and the theoretical values are shown in Fig. 3. Figure 3a shows the influence of argon concentration on the speed of sound in nitrogen, while Fig. 3b presents the influence of carbon dioxide concentration in nitrogen on the speed of sound. During all measurements, temperature of the gas was measured by PT1000 sensor and it is taken into account in Eq. 2. The obtained results of the measured speed of sound correspond to the theoretical values (a dotted line in Fig. 3). Some discrepancies result from the method of preparing gas mixtures. We prepared every portion of the gas mixture from about 99 % concentration. To prepare a gas sample, three connected (together) by needles syringes were used. Unfortunately, each time a little bit of gas remained in the needle from the previous measurement, and this remaining gas changed the final composition of the mixture. The solution for this problem was a reduction of a needle diameter which allowed us to improve the composition of the gas mixture.

Fig. 3
figure 3

The measured and the theoretical influence of argon concentration on the speed of sound in nitrogen (a), carbon dioxide concentration on the speed of sound in nitrogen (b)

As we can see in Fig. 3, the theoretical line almost overlaps with measured points. Unfortunately, overlapping decreases with higher gas concentration. Where the maximum difference for gas 100 % composition is 0.93 % (mean 0.48 %) for argon and 2.4 % (mean 1 %) for carbon dioxide. This effect results from the applied gas concentration. We used low-cost commercially available gases commonly used in industry which concentration is not exactly 99 %. When we assume that the concentration is lower than 99 %, the theoretical line (a dashed line) fits measurement points perfectly. Then, the maximum difference for argon is 0.12 % (mean 0.068 %) and for carbon dioxide is 0.6 % (mean 0.2 %).

The frequency generated by the positive feedback loop was very stable, while the maximum difference in one second of all recorded frequencies was \(\pm \,0.4\, \hbox {Hz}\). The influence of frequency variation \(\pm \,0.4\, \hbox {Hz}\) on the speed of sound is \(\pm \,0.0489\, \hbox {m}\cdot \hbox {s}^{-1}\), which results in difference gas composition for argon \(\pm \,\)0.011 % and carbon dioxide \(\pm \,\)0.043 %. We did not average the presented data and each measurement originates from a single signal period which took depend on resonance frequency about 0.4 ms. So, the response of the resonator was directly obtained when a resonator responded.

The major drawback of the presented method is that the acoustic wave velocity depends on its frequency. Unfortunately, in the presented method frequency depends on gas concentration and it is not constant. Fortunately, according to the data in [14] influence of the stimulation frequency between 1 kHz and 100 kHz on the speed of sound in air is less than 1 ppm, and between 1 kHz and 100 Hz is about 55 ppm. So, the difference is not higher than the frequency variation from a single measurement.

5 Conclusions

The presented method of measurement of the speed of sound is based on measurement of the resonant frequency of the acoustic longitudinal resonator. The resonator was stimulated by a photoacoustic signal in a positive feedback loop, where the light source was driven by photoacoustic signals. The positive feedback loop tracks the resonance frequency whose response time to the change of the gas concentration is very short—less than 1 ms. The time response depends on resonance frequency which can be higher, and consequently it will provide a lower response time.

Based on the presented method, it is possible to determine the speed of sound in different compositions of gas mixtures. The difference in the measured frequencies was \(\pm \,0.4\, \hbox {Hz}\) which results in percentage composition for argon ± 0.011 % and carbon dioxide ± 0.043 %. The maximum gas composition difference between measured and theoretical prediction for argon was 0.12 % and for carbon dioxide 0.6 %, respectively.