Transformerless Ultrasonic Ranging System with the Feature of Intrinsic Safety for Explosive Environment.

The transformer used in the conventional ultrasonic ranging system could provide a huge instantaneous driving voltage for the generation of ultrasonic wave, which leads to the safety problem in the explosive mixture. This paper proposes a transformerless ultrasonic ranging system powered by the intrinsically safe power source and analog switches. The analysis of intrinsic characteristics of ultrasonic driving circuit is realized in normal and fault conditions. The echo-processing circuit combined with LIN bus technology is further adopted in order to improve the system stability. After the analysis of the timing diagram of ranging instruction, the evaluation experiments of ranging accuracy and ranging stability are completed. The results show that the system can realize reliable bidirectional communication between the LIN master node circuit and the ultrasonic transceiver unit, which realizes the transformerless driving. The system can realize the distance measurement within the range of 250⁻2700 mm, and the measurement error is less than 30 mm. The measurement fluctuation is less than 10 mm, which provides a new solution for the ultrasonic ranging system in the potentially explosive atmosphere.


Introduction
Due to the narrow working space in the industrial field, many special function vehicles have hidden hazards in the process of reversing, posing a huge threat to safety production [1]. In order to solve these kinds of problems, the ultrasonic detection technology is thus widely used for monitoring and early warning of safety distances because of its simple structure and fast response [2][3][4][5][6], and could be gradually seen in the potentially explosive atmospheres of gases and vapors.
The traditional ultrasonic ranging system driven by the transformer has the disadvantages of large volume and high cost. In this situation, a large driving voltage is required to drive the primary and secondary coils, and a high energy storage is generated while ensuring the driving performance [7]. These effects could be dangerous in explosive atmospheres, because the ultrasound has been considered to be an ignition source in the international safety regulations such as EN 1127-1 [8]. The ignition point of methane-air mixture is about 650 • C. In Reference [9], it is mentioned that the temperature required to ignite combustibles by hot surface methods is higher (about hundreds of degrees). However, this

Acoustic Impedance Matching of the Ultrasonic Transducer
The sound waves of the ultrasonic transducer used for ultrasonic ranging are transfered from a solid environment to a gaseous environment. When the sound waves pass through the two media interfaces, they will generate reflected waves and transmitted waves. As shown in Figure 2(a), when sound wave is vertically incident from medium 1 to medium 2, the sound transmittance t and the sound intensity transmittance T satisfy the following conditions [21]: (1) where Z1 and Z2 are the acoustic impedances of media 1 and 2, respectively; P0 and Pt are the incident and transmitted sound pressures, respectively; and I0 and It are the incident and projected sound intensities, respectively. The acoustic impedance Z is satisfied as following: where is the medium density and c is the wave velocity in the medium. It can be seen from the Equation (3) that the acoustic transmittance at the interface is related to the material itself. In actual use, if the emitting surface is made of aluminum, the sound intensity transmission T is: The problem of too low transmission intensity at the time of direct incidence is shown in Figure  2(b). Improvement is made by adding a matching layer, medium 3, between media 1 and 2. When the thickness d of medium 3 satisfies the following equation, there is a maximum sound intensity transmittance Tmax. The thickness d of medium 3 and the maximum sound intensity transmittance Tmax can be written as:

Acoustic Impedance Matching of the Ultrasonic Transducer
The sound waves of the ultrasonic transducer used for ultrasonic ranging are transfered from a solid environment to a gaseous environment. When the sound waves pass through the two media interfaces, they will generate reflected waves and transmitted waves. As shown in Figure 2a, when sound wave is vertically incident from medium 1 to medium 2, the sound transmittance t and the sound intensity transmittance T satisfy the following conditions [21]: where Z 1 and Z 2 are the acoustic impedances of media 1 and 2, respectively; P 0 and P t are the incident and transmitted sound pressures, respectively; and I 0 and I t are the incident and projected sound intensities, respectively. The acoustic impedance Z is satisfied as following: where ρ is the medium density and c is the wave velocity in the medium. It can be seen from the Equation (3) that the acoustic transmittance at the interface is related to the material itself. In actual use, if the emitting surface is made of aluminum, the sound intensity transmission T is:

Acoustic Impedance Matching of the Ultrasonic Transducer
The sound waves of the ultrasonic transducer used for ultrasonic ranging are transfered from a solid environment to a gaseous environment. When the sound waves pass through the two media interfaces, they will generate reflected waves and transmitted waves. As shown in Figure 2(a), when sound wave is vertically incident from medium 1 to medium 2, the sound transmittance t and the sound intensity transmittance T satisfy the following conditions [21]: (1) where Z1 and Z2 are the acoustic impedances of media 1 and 2, respectively; P0 and Pt are the incident and transmitted sound pressures, respectively; and I0 and It are the incident and projected sound intensities, respectively. The acoustic impedance Z is satisfied as following: where is the medium density and c is the wave velocity in the medium. It can be seen from the Equation (3) that the acoustic transmittance at the interface is related to the material itself. In actual use, if the emitting surface is made of aluminum, the sound intensity transmission T is: The problem of too low transmission intensity at the time of direct incidence is shown in Figure  2(b). Improvement is made by adding a matching layer, medium 3, between media 1 and 2. When the thickness d of medium 3 satisfies the following equation, there is a maximum sound intensity transmittance Tmax. The thickness d of medium 3 and the maximum sound intensity transmittance The problem of too low transmission intensity at the time of direct incidence is shown in Figure 2b. Improvement is made by adding a matching layer, medium 3, between media 1 and 2. When the thickness d of medium 3 satisfies the following equation, there is a maximum sound intensity transmittance T max . The thickness d of medium 3 and the maximum sound intensity transmittance T max can be written as: where γ is the wavelength of the sound wave in medium 3, and Z 3 is the acoustic impedance of medium 3. When the acoustic impedance Z 3 of medium 3 satisfies the equation: Z 3 = √ Z 1 Z 2 , T max takes a value of 1, which means the sound signal does not reflect at all. Therefore, it can be known that the sound transmission efficiency can be improved by reasonably selecting the matching material and the matching layer thickness, thereby improving the overall energy transmission efficiency of the overall driving system.
The mechanical vibration characteristics of ultrasonic piezoelectric transducers can also be expressed in terms of electrical quantities. In order to analyze the load impedance of the transducer, it is necessary to construct a transducer equivalent circuit by matching the appropriate inductor or capacitor to improve the energy conversion efficiency of the transducer. The equivalent circuit of the ultrasonic transducer is shown in Figure 3.
where γ is the wavelength of the sound wave in medium 3, and is the acoustic impedance of medium 3. When the acoustic impedance of medium 3 satisfies the equation: = , takes a value of 1, which means the sound signal does not reflect at all. Therefore, it can be known that the sound transmission efficiency can be improved by reasonably selecting the matching material and the matching layer thickness, thereby improving the overall energy transmission efficiency of the overall driving system.
The mechanical vibration characteristics of ultrasonic piezoelectric transducers can also be expressed in terms of electrical quantities. In order to analyze the load impedance of the transducer, it is necessary to construct a transducer equivalent circuit by matching the appropriate inductor or capacitor to improve the energy conversion efficiency of the transducer. The equivalent circuit of the ultrasonic transducer is shown in Figure 3.  3(a) is the equivalent circuit diagram of the ultrasonic transducer before resonance, where C0 is the static capacitance of the ultrasonic transducer due to clamping, and R0 is the dielectric resistance of the ultrasonic transducer. Since R0 is considered to be infinite, the influence is generally ignored.
, and are the dynamic inductance, capacitance, and resistance of the transducer, respectively. When the frequency of transducer driving pulse is equal to the resonant frequency of the ultrasonic transducer, and Cm undergo series resonance. The series branch is pure resistance Rm, the equivalent circuit of the transducer is shown in Figure 3(b), and C0 are connected in parallel, and the impedance is capacitive. The resonant frequency of the ultrasonic transducer is described as:

Design of the Intrinsically Safe Ultrasonic Driving Circuit
The core of the ultrasonic transducer system is a layered resonance structure based on piezoelectric materials, which shows the characteristics of capacitive load. Therefore, it is necessary to adopt electrical impedance matching method to improve the output power of the signal source to the transducer during power transmission. In order to realize the transmission of ultrasonic waves, it is necessary to design a pulse driving circuit to generate an electric pulse having the same resonance frequency as that of the ultrasonic transducer and having a large driving voltage, and to drive the ultrasonic transducer to vibrate after matching the network, for the purpose of transmitting ultrasonic waves.  Figure 3a is the equivalent circuit diagram of the ultrasonic transducer before resonance, where C 0 is the static capacitance of the ultrasonic transducer due to clamping, and R 0 is the dielectric resistance of the ultrasonic transducer. Since R 0 is considered to be infinite, the influence is generally ignored. L m , C m and R m are the dynamic inductance, capacitance, and resistance of the transducer, respectively. When the frequency of transducer driving pulse is equal to the resonant frequency f s of the ultrasonic transducer, L m and C m undergo series resonance. The series branch is pure resistance R m , the equivalent circuit of the transducer is shown in Figure 3b, R m and C 0 are connected in parallel, and the impedance is capacitive. The resonant frequency f s of the ultrasonic transducer is described as:

Design of the Intrinsically Safe Ultrasonic Driving Circuit
The core of the ultrasonic transducer system is a layered resonance structure based on piezoelectric materials, which shows the characteristics of capacitive load. Therefore, it is necessary to adopt electrical impedance matching method to improve the output power of the signal source to the transducer during power transmission. In order to realize the transmission of ultrasonic waves, it is necessary to design a pulse driving circuit to generate an electric pulse having the same resonance frequency as that of the ultrasonic transducer and having a large driving voltage, and to drive the ultrasonic transducer to vibrate after matching the network, for the purpose of transmitting ultrasonic waves.
The ultrasonic transducer used in this scheme is an anti-drip-type transceiver-integrated ultrasonic probe (model: MA58MF14-0N), which is shown in Figure 4, and its electrical performance parameters are listed in Table 1. The ultrasonic transducer used in this scheme is an anti-drip-type transceiver-integrated ultrasonic probe (model: MA58MF14-0N), which is shown in Figure 4, and its electrical performance parameters are listed in Table 1.  In order to meet the intrinsically safe driving requirements, a transformerless ultrasonic driving circuit is designed and shown in Figure 5. The circuit consists of the impedance matching and the pulse generation. R1 and C3 are the matching resistor and the matching capacitor of the driving circuit, respectively. The echo-receiving capacitors C1 and C2 and the echo-receiving resistors R2 and R3 are chosen carefully in order to complete the reception of the echo signal. The system is powered by an intrinsically safe power supply (18 V) and produces the required driving voltage VDRV (12 V) via a direct current (DC) / DC converter. The pulse generation circuit is composed of four analog switches and controllers, i.e., S1, S2, S3, and S4. When the positive pulse is driven, the switches S2 and S3 are turned on, and S1 and S4 are turned off. At this time, the positive voltage of the transducer is VDRV, the negative terminal is 0; in the negative pulse driving state, the switches S1 and S4 are turned on, and S2 and S3 are turned off. At this time, the negative voltage of the transducer is VDRV and the positive terminal is 0. When the controller controls the switch to turn on and off with the resonant frequency fs of the transducer, a square wave of amplitude VDRV and frequency fs can be generated at both ends of the transducer, thereby ensuring normal operation of the transducer. After the end of a set of 16 pulses, the controller controls S0 to close, and the damping   In order to meet the intrinsically safe driving requirements, a transformerless ultrasonic driving circuit is designed and shown in Figure 5. The circuit consists of the impedance matching and the pulse generation. R 1 and C 3 are the matching resistor and the matching capacitor of the driving circuit, respectively. The echo-receiving capacitors C 1 and C 2 and the echo-receiving resistors R 2 and R 3 are chosen carefully in order to complete the reception of the echo signal. The ultrasonic transducer used in this scheme is an anti-drip-type transceiver-integrated ultrasonic probe (model: MA58MF14-0N), which is shown in Figure 4, and its electrical performance parameters are listed in Table 1.  In order to meet the intrinsically safe driving requirements, a transformerless ultrasonic driving circuit is designed and shown in Figure 5. The circuit consists of the impedance matching and the pulse generation. R1 and C3 are the matching resistor and the matching capacitor of the driving circuit, respectively. The echo-receiving capacitors C1 and C2 and the echo-receiving resistors R2 and R3 are chosen carefully in order to complete the reception of the echo signal. The system is powered by an intrinsically safe power supply (18 V) and produces the required driving voltage VDRV (12 V) via a direct current (DC) / DC converter. The pulse generation circuit is composed of four analog switches and controllers, i.e., S1, S2, S3, and S4. When the positive pulse is driven, the switches S2 and S3 are turned on, and S1 and S4 are turned off. At this time, the positive voltage of the transducer is VDRV, the negative terminal is 0; in the negative pulse driving state, the switches S1 and S4 are turned on, and S2 and S3 are turned off. At this time, the negative voltage of the transducer is VDRV and the positive terminal is 0. When the controller controls the switch to turn on and off with the resonant frequency fs of the transducer, a square wave of amplitude VDRV and frequency fs can be generated at both ends of the transducer, thereby ensuring normal operation of the transducer. After the end of a set of 16 pulses, the controller controls S0 to close, and the damping Pulse generation circuit Echo signal Switch control The system is powered by an intrinsically safe power supply (18 V) and produces the required driving voltage V DRV (12 V) via a direct current (DC)/DC converter. The pulse generation circuit is composed of four analog switches and controllers, i.e., S 1 , S 2 , S 3 , and S 4 . When the positive pulse is driven, the switches S 2 and S 3 are turned on, and S 1 and S 4 are turned off. At this time, the positive voltage of the transducer is V DRV , the negative terminal is 0; in the negative pulse driving state, the switches S 1 and S 4 are turned on, and S 2 and S 3 are turned off. At this time, the negative voltage of the transducer is V DRV and the positive terminal is 0. When the controller controls the switch to turn on and off with the resonant frequency f s of the transducer, a square wave of amplitude V DRV and frequency f s can be generated at both ends of the transducer, thereby ensuring normal operation of the transducer. After the end of a set of 16 pulses, the controller controls S 0 to close, and the damping R 0 is connected to the circuit to reduce the ultrasonic "tailing" caused by mechanical inertial vibration, for the purpose of reducing the dead zone.

Analysis of Intrinsic Characteristics of Circuit In Normal Conditions
In the driving circuit of the ultrasonic ranging circuit, the energy storage component has a large energy storage, so it is difficult to meet the intrinsic safety requirements. Therefore, the capacitor energy storage is the first consideration of the design, and the energy storage of the capacitor is calculated as follows: where U is the voltage across the capacitor C, and in order to meet the intrinsic safety performance requirements of the ultrasonic ranging device, combined with the equivalent circuit model of the ultrasonic transducer and the transformerless ultrasonic driving circuit in Figures 3 and 5, respectively, the circuit model of the driving system shown in Figure 6 is obtained, and the description of each parameter is shown in Table 2. R 1 is the matching resistor and C 3 is the matching capacitor. C 1 and C 2 are the echo-receiving capacitors. These four designations of the components have the same designations, as those in Figure 5. C 0 is the static capacitance. L m , C m , and R m are the dynamic inductance, capacitance, and resistance of the transducer, respectively. These four designations of the components have the same designations as those in Figure 3. R 11 and R 22 are equivalent resistances between the echo-receiving terminal and the ground. R0 is connected to the circuit to reduce the ultrasonic "tailing" caused by mechanical inertial vibration, for the purpose of reducing the dead zone.

Analysis of Intrinsic Characteristics of Circuit In Normal Conditions
In the driving circuit of the ultrasonic ranging circuit, the energy storage component has a large energy storage, so it is difficult to meet the intrinsic safety requirements. Therefore, the capacitor energy storage is the first consideration of the design, and the energy storage of the capacitor is calculated as follows: where U is the voltage across the capacitor C, and in order to meet the intrinsic safety performance requirements of the ultrasonic ranging device, combined with the equivalent circuit model of the ultrasonic transducer and the transformerless ultrasonic driving circuit in Figures 3 and 5, respectively, the circuit model of the driving system shown in Figure 6 is obtained, and the description of each parameter is shown in Table 2. R1 is the matching resistor and C3 is the matching capacitor. C1 and C2 are the echo-receiving capacitors. These four designations of the components have the same designations, as those in Figure 5. C0 is the static capacitance. Lm, Cm, and Rm are the dynamic inductance, capacitance, and resistance of the transducer, respectively. These four designations of the components have the same designations as those in Figure 3. R11 and R22 are equivalent resistances between the echo-receiving terminal and the ground.  The driving pulse is obtained by the switch at a frequency f and the voltage source VDRV. When the driving pulse frequency f is equal to the resonance frequency of the ultrasonic transducer, Lm and Cm undergo series resonance. The series branch is a pure resistor Rm. In the ultrasonic-distance-  The driving pulse is obtained by the switch at a frequency f and the voltage source V DRV . When the driving pulse frequency f is equal to the resonance frequency of the ultrasonic transducer, L m and C m undergo series resonance. The series branch is a pure resistor R m . In the ultrasonic-distance-measured device, the 16-pulse driving method is usually used, and the voltage between the two ends of the driver (+, −) is obtained as follows: where n (n = 1, 2, 3, . . . , 32) is a half-pulse ordinal. Then, during the positive and negative pulses, the equivalent circuit of the driving system is shown in Figure 7. The descriptions of the components in Figure 7 are shown in Table 2 and these element parameters in Figure 7 have the same meanings as those in Figure 6.
Sensors 2018, 18, x FOR PEER REVIEW 7 of 16 measured device, the 16-pulse driving method is usually used, and the voltage between the two ends of the driver (+, −) is obtained as follows: Ui + (n) = 2 ((−1) + 1) where n (n=1, 2, 3,..., 32) is a half-pulse ordinal. Then, during the positive and negative pulses, the equivalent circuit of the driving system is shown in Figure 7. The descriptions of the components in Figure 7 are shown in Table 2 and these element parameters in Figure 7 have the same meanings as those in Figure 6. As shown in Figure 7(a), during positive pulse driving, C1 and C3 are short-circuited to the ground. If C2 is stored, its energy is The actual positive pulse duration is tp, which is given by: During this period, the path formed by C2 and R22 satisfies: Then before the end of the positive pulse, Then, the actual energy is: According to the national and international standards, in the potentially explosive atmospheres of gases and vapors with class I (methane-air), the minimum ignition energy Wmin = 0.28 mJ [22,23], according to the above results ≪ ≪ , so the selection of capacitor C2 meets the intrinsic safety requirements.
Similarly, as shown in Figure 8b, during the negative pulse driving, C2 is short-circuited to the ground. If C1 and C3 are stored, their respective energies are given by:  As shown in Figure 7a, during positive pulse driving, C 1 and C 3 are short-circuited to the ground. If C 2 is stored, its energy is The actual positive pulse duration is t p , which is given by: During this period, the path formed by C 2 and R 22 satisfies: Then before the end of the positive pulse, Then, the actual energy is: According to the national and international standards, in the potentially explosive atmospheres of gases and vapors with class I (methane-air), the minimum ignition energy W min = 0.28 mJ [22,23], according to the above results W C 2 W C 02 W min , so the selection of capacitor C 2 meets the intrinsic safety requirements.
Similarly, as shown in Figure 8b, during the negative pulse driving, C 2 is short-circuited to the ground. If C 1 and C 3 are stored, their respective energies are given by:

Analysis of Intrinsic Characteristics of Circuit in Fault Conditions
Considering that short-circuit faults may be relatively difficult to happen in the internal circuit of the ultrasonic transducer, the conditions of the short circuit of the matching resistor R1 and the short-circuit of the transducer T1 are analyzed. The equivalent circuit is shown in Figure 8. The descriptions of the components in Figure 8 are shown in Table 2 and these element parameters in Figure 8 have the same meanings as those in Figure 6. When the short circuit of R1 occurs, the negative pulse driving mode is more dangerous than the positive pulse driving. Therefore, as shown in Figure 8(a), the system is a capacitive circuit, and the safety factor of the power supply voltage should be 1.5 according to the book by Zhang and Li [24]. Then, the corrected voltage is 1.5VDRV = 18 V, and the maximum equivalent capacitance of the system is Ce1 = C1 + C3 + C0 = 2090 pF. It is checked according to the minimum ignition curve (C + 0 Ω) of the class I capacitive circuit, at 20 V (greater than 18 V), and the corresponding capacitance value is Cmin1, (20 μF < Cmin1 < 30 μF), that is, ≪ , so the intrinsic safety requirement is also satisfied at this time.
Similarly, as shown in Figure 8(b), when the short circuit of the transducer T1 occurs, the system is a capacitive circuit. According to the standard, the safety factor of the power supply voltage should be 1.5, and the corrected voltage is 1.5VDRV = 18 V. The equivalent capacitance is Ce2 = C1 + C3 = 690 pF, so it is checked according to the minimum ignition curve (C + 40 Ω) of the class I capacitive circuit. At 20 V (greater than 18 V), the corresponding capacitance value is Cmin2 ( ≫ 100 ), that is, ≪ , so it also meets the requirements of intrinsic safety.

LIN Bus and Its Network Structure
In order to realize the communication and parameter setting of the microcontroller in the ultrasonic transceiver unit, the scheme adopts the LIN bus transceiver chip TJA1020. LIN is a serial communication protocol based on the Universal Asynchronous Receiver/Transmitter (UART) / Serial Communication Interface (SCI) interface, which can be used in various fields such as automobiles and home appliances. As shown in Figure 9, the LIN network as a whole adopts a single bus mode, and the network will enter the running mode after the initialization process is completed; when the sleep command is received or the bus is silent for 4-10 s, the mode will be going into sleep mode, and the network will enter initialization mode by wake-up signals or internal causes. The function of the LIN network is implemented by different nodes such as the master node and the slaves. The node application layer transmits signals and messages downwards through the protocol layer and the physical layer, and it can expand up to 16 nodes in an LIN network. The master node in the LIN network can not only control the slaves in the network, detect and adjust the bus status, Figure 8. System equivalent circuit diagrams for the conditions of (a) short circuit at R 1 and (b) short circuit at T 1 .
According to the above calculation results, W C 01 W min , and W C 03 W min , so the capacitors C 1 and C 3 are selected to meet the intrinsic safety requirements.

Analysis of Intrinsic Characteristics of Circuit in Fault Conditions
Considering that short-circuit faults may be relatively difficult to happen in the internal circuit of the ultrasonic transducer, the conditions of the short circuit of the matching resistor R 1 and the short-circuit of the transducer T 1 are analyzed. The equivalent circuit is shown in Figure 8. The descriptions of the components in Figure 8 are shown in Table 2 and these element parameters in Figure 8 have the same meanings as those in Figure 6.
When the short circuit of R 1 occurs, the negative pulse driving mode is more dangerous than the positive pulse driving. Therefore, as shown in Figure 8a, the system is a capacitive circuit, and the safety factor of the power supply voltage should be 1.5 according to the book by Zhang and Li [24]. Then, the corrected voltage is 1.5V DRV = 18 V, and the maximum equivalent capacitance of the system is C e 1 = C 1 + C 3 + C 0 = 2090 pF. It is checked according to the minimum ignition curve (C + 0 Ω) of the class I capacitive circuit, at 20 V (greater than 18 V), and the corresponding capacitance value is C min1 , (20 µF < C min1 < 30 µF), that is, C e 1 C min1 , so the intrinsic safety requirement is also satisfied at this time.
Similarly, as shown in Figure 8b, when the short circuit of the transducer T 1 occurs, the system is a capacitive circuit. According to the standard, the safety factor of the power supply voltage should be 1.5, and the corrected voltage is 1.5V DRV = 18 V. The equivalent capacitance is C e 2 = C 1 + C 3 = 690 pF, so it is checked according to the minimum ignition curve (C + 40 Ω) of the class I capacitive circuit. At 20 V (greater than 18 V), the corresponding capacitance value is C min2 (C min2 100 µF), that is, C e 2 C min2 , so it also meets the requirements of intrinsic safety.

LIN Bus and Its Network Structure
In order to realize the communication and parameter setting of the microcontroller in the ultrasonic transceiver unit, the scheme adopts the LIN bus transceiver chip TJA1020. LIN is a serial communication protocol based on the Universal Asynchronous Receiver/Transmitter (UART)/Serial Communication Interface (SCI) interface, which can be used in various fields such as automobiles and home appliances. As shown in Figure 9, the LIN network as a whole adopts a single bus mode, and the network will enter the running mode after the initialization process is completed; when the sleep command is received or the bus is silent for 4-10 s, the mode will be going into sleep mode, and the network will enter initialization mode by wake-up signals or internal causes. The function of the LIN network is implemented by different nodes such as the master node and the slaves. The node application layer transmits signals and messages downwards through the protocol layer and the physical layer, and it can expand up to 16 nodes in an LIN network. The master node in the LIN network can not only control the slaves in the network, detect and adjust the bus status, but also communicate with the upper layer network (such as Controller Area Network (CAN)), which has both master and slave tasks, while the slave node only contains slave tasks.
Sensors 2018, 18, x FOR PEER REVIEW 9 of 16 but also communicate with the upper layer network (such as Controller Area Network (CAN) ), which has both master and slave tasks, while the slave node only contains slave tasks. The communication message frame format on the LIN bus is fixed, and the bus communication is controlled by the master node. After the master node passes the interval signal, the master node sends the synchronization field and the identifier field as the header of the message, and the slave returns the data field and the checksum field response host. Due to the physical layer limitation, the LIN bus transmission bit rate is up to 20 kbps, and the following conditions should be met during communication: T Header = 34•T bit (19) T Response = (10•N Data + 10)•T bit (20) where THeader is the nominal transmission time of the header, Tbit is the time required for the primary node to transmit 1 bit of data, TResponse is the response-rated transmission time, and NData is the number of bytes contained in the data field. At the same time, in order to ensure the transmission, both THeader and the TResponse need to leave a certain margin, and the maximum transmission time is 1.4 times the rated transmission time.

Design of the Ultrasonic Echo Signal Processing Circuit
The system echo-processing flow is shown in Figure 10. When the ultrasonic wave is affected by the obstacle and the echo signal is generated, the piezoelectric crystal in the ultrasonic transducer is forced to vibrate to convert the sound signal into a weak electrical signal. The weak electrical signal is amplified by the programmable amplification module and converted into a digital voltage signal through Analog to Digital (A/D) conversion. The digital filter is used to filter out clutter outside 58 kHz to reduce its interference to the system. The filtered signal passes through the echo threshold comparison module. When it is greater than the given value, it is the effective timing termination point. In the process of echo-processing, since the calculation of the obstacle distance time point is generated by voltage threshold comparison, the setting of the reference value for echo comparison is crucial.  The communication message frame format on the LIN bus is fixed, and the bus communication is controlled by the master node. After the master node passes the interval signal, the master node sends the synchronization field and the identifier field as the header of the message, and the slave returns the data field and the checksum field response host. Due to the physical layer limitation, the LIN bus transmission bit rate is up to 20 kbps, and the following conditions should be met during communication:

Master task
T Header = 34·T bit (19) T Response = (10 ·N Data +10)·T bit (20) where T Header is the nominal transmission time of the header, T bit is the time required for the primary node to transmit 1 bit of data, T Response is the response-rated transmission time, and N Data is the number of bytes contained in the data field. At the same time, in order to ensure the transmission, both T Header and the T Response need to leave a certain margin, and the maximum transmission time is 1.4 times the rated transmission time.

Design of the Ultrasonic Echo Signal Processing Circuit
The system echo-processing flow is shown in Figure 10. When the ultrasonic wave is affected by the obstacle and the echo signal is generated, the piezoelectric crystal in the ultrasonic transducer is forced to vibrate to convert the sound signal into a weak electrical signal. The weak electrical signal is amplified by the programmable amplification module and converted into a digital voltage signal through Analog to Digital (A/D) conversion. The digital filter is used to filter out clutter outside 58 kHz to reduce its interference to the system. The filtered signal passes through the echo threshold comparison module. When it is greater than the given value, it is the effective timing termination point. In the process of echo-processing, since the calculation of the obstacle distance time point is generated by voltage threshold comparison, the setting of the reference value for echo comparison is crucial. In order to improve the stability and anti-interference ability of the echo-processing system, the reverse current diode DLIN and the LIN matching resistor RLIN are connected in series between the LIN and Battery supply (BAT) pins of the module. The LIN node capacitor CLIN is used to control the voltage fluctuation in the LIN. Moreover, the TJA1020-enabled host application mode is used to receive the master controller's instructions and return echo information, as shown in Figure 10. The main controller communicate with the echo controller through LIN to control parameters such as amplification gain and echo comparison threshold. The echo controller returns the threshold comparison result and current status information.

LIN Bus Communication Performance Optimization
In order to ensure the bidirectional operation of the LIN communication to receive the signal fed back by the ultrasonic transceiver unit, the LIN bus voltage should satisfy the threshold condition.
At the dominant level, At the recessive level, where VLIN_L_MAX is the highest voltage at a low level in LIN bus; VLIN_H_MIN is the minimum voltage at a high level in LIN bus; VBAT is Chip BAT terminal voltage and equal to 12 V, and thus the size of RLIN needs to be adjusted during the actual process to change the driving capacity of the circuit, so as to meet the requirements in the potentially explosive atmospheres of gases and vapors and implement effective data communication.

System Principle Overview
The intrinsically safe transformerless ultrasonic ranging system is shown in Figure 11, and is mainly composed of a power supply unit, a control unit, a channel selection unit, an LIN communication unit, an ultrasonic transceiver unit, an alarm and calibration unit, and a display unit. The system uses STC12C5A32S2 microcontroller as the core of the control unit. The power supply unit is supplied with 18 V voltage from the intrinsically safe power supply (model: CSTI-I). The DC/DC conversion chip 78M05 provides the 5 V voltage required by the system and the MAX5025 generates 12 V voltage to ensure LIN communication. The channel selection unit realizes switching of the output signal of the control unit, and the LIN communication unit completes conversion of the In order to improve the stability and anti-interference ability of the echo-processing system, the reverse current diode D LIN and the LIN matching resistor R LIN are connected in series between the LIN and Battery supply (BAT) pins of the module. The LIN node capacitor C LIN is used to control the voltage fluctuation in the LIN. Moreover, the TJA1020-enabled host application mode is used to receive the master controller's instructions and return echo information, as shown in Figure 10. The main controller communicate with the echo controller through LIN to control parameters such as amplification gain and echo comparison threshold. The echo controller returns the threshold comparison result and current status information.

LIN Bus Communication Performance Optimization
In order to ensure the bidirectional operation of the LIN communication to receive the signal fed back by the ultrasonic transceiver unit, the LIN bus voltage should satisfy the threshold condition.
At the dominant level, At the recessive level, where V LIN_L_MAX is the highest voltage at a low level in LIN bus; V LIN_H_MIN is the minimum voltage at a high level in LIN bus; V BAT is Chip BAT terminal voltage and equal to 12 V, and thus the size of R LIN needs to be adjusted during the actual process to change the driving capacity of the circuit, so as to meet the requirements in the potentially explosive atmospheres of gases and vapors and implement effective data communication.

System Principle Overview
The intrinsically safe transformerless ultrasonic ranging system is shown in Figure 11, and is mainly composed of a power supply unit, a control unit, a channel selection unit, an LIN communication unit, an ultrasonic transceiver unit, an alarm and calibration unit, and a display unit. The system uses STC12C5A32S2 microcontroller as the core of the control unit. The power supply unit is supplied with 18 V voltage from the intrinsically safe power supply (model: CSTI-I).
The DC/DC conversion chip 78M05 provides the 5 V voltage required by the system and the MAX5025 generates 12 V voltage to ensure LIN communication. The channel selection unit realizes switching of the output signal of the control unit, and the LIN communication unit completes conversion of the Transistor-Transistor Logic (TTL) level and the LIN level to realize state control and data transmission of the ultrasonic transceiver unit with the e524.06 chip as the core. Transistor-Transistor Logic (TTL) level and the LIN level to realize state control and data transmission of the ultrasonic transceiver unit with the e524.06 chip as the core.

Design of e524.06 Chip Peripheral Circuit
The potentially explosive atmospheres of gases and vapors are complex and therefore put high demands on the circuit so the system uses the ultrasonic-distance-measuring chip e524.06 which was produced by an elmo company, and designed its peripheral circuit (as shown in Figure 12) to achieve transformerless driving and echo-processing of the ultrasonic transducer. The chip is internally composed of a power module, a transducer driving module, an echo-receiving and -processing module, a clock module, a Joint Test Action Group (JTAG) interface module, a controller module, an Electrically Erasable Programmable Read Only Memory (EEPROM) module, and an Input/Output (I/O) interface module. By modifying the EEPROM configuration information in the chip, not only the adjustment of the ultrasonic transducer driving voltage and frequency, but also the working state of the transducer can be changed, and the static and dynamic modes can be selected to generate the threshold. When static generation is selected, the relevant registers are configured to realize the setting of key parameters, such as linear interpolation, voltage offset and scale factor, to adjust the ultrasonic echo-processing effect to improve the system measurement accuracy.   Figure 11. Block diagram of the ultrasonic ranging system.

Design of e524.06 Chip Peripheral Circuit
The potentially explosive atmospheres of gases and vapors are complex and therefore put high demands on the circuit so the system uses the ultrasonic-distance-measuring chip e524.06 which was produced by an elmo company, and designed its peripheral circuit (as shown in Figure 12) to achieve transformerless driving and echo-processing of the ultrasonic transducer. The chip is internally composed of a power module, a transducer driving module, an echo-receiving and -processing module, a clock module, a Joint Test Action Group (JTAG) interface module, a controller module, an Electrically Erasable Programmable Read Only Memory (EEPROM) module, and an Input/Output (I/O) interface module. By modifying the EEPROM configuration information in the chip, not only the adjustment of the ultrasonic transducer driving voltage and frequency, but also the working state of the transducer can be changed, and the static and dynamic modes can be selected to generate the threshold. When static generation is selected, the relevant registers are configured to realize the setting of key parameters, such as linear interpolation, voltage offset and scale factor, to adjust the ultrasonic echo-processing effect to improve the system measurement accuracy. Transistor-Transistor Logic (TTL) level and the LIN level to realize state control and data transmission of the ultrasonic transceiver unit with the e524.06 chip as the core.

Design of e524.06 Chip Peripheral Circuit
The potentially explosive atmospheres of gases and vapors are complex and therefore put high demands on the circuit so the system uses the ultrasonic-distance-measuring chip e524.06 which was produced by an elmo company, and designed its peripheral circuit (as shown in Figure 12) to achieve transformerless driving and echo-processing of the ultrasonic transducer. The chip is internally composed of a power module, a transducer driving module, an echo-receiving and -processing module, a clock module, a Joint Test Action Group (JTAG) interface module, a controller module, an Electrically Erasable Programmable Read Only Memory (EEPROM) module, and an Input/Output (I/O) interface module. By modifying the EEPROM configuration information in the chip, not only the adjustment of the ultrasonic transducer driving voltage and frequency, but also the working state of the transducer can be changed, and the static and dynamic modes can be selected to generate the threshold. When static generation is selected, the relevant registers are configured to realize the setting of key parameters, such as linear interpolation, voltage offset and scale factor, to adjust the ultrasonic echo-processing effect to improve the system measurement accuracy.   Figure 12. Ultrasonic transmitting and receiving circuit diagram.

Instruction and Ranging Timing of e524.06 Chip
Writing specific instruction steps are required to realize communication between the microprocessor and e524.06 chip and other functions such as 16-pulse driving wave transmission and EEPROM programming. On the basis of completing the hardware design and compiling the signal path of the ultrasonic ranging system, the calculation of actual distance data is completed according to distance order sequence in Figure 13. The real-time voltage of LIN bus in the ranging process is shown in Figure 13. The system sends ranging instructions and waits for the respond of ultrasonic transceiver between a and b (a range of valid time intervals is 77.6-154 µs), e524.06 chip in the ultrasonic transceiver evaluates the environmental noise in the measurement process between c and d, and the length of time T is the time used for ultrasonic transmission during a single measurement of the system.

Instruction and Ranging Timing of e524.06 Chip
Writing specific instruction steps are required to realize communication between the microprocessor and e524.06 chip and other functions such as 16-pulse driving wave transmission and EEPROM programming. On the basis of completing the hardware design and compiling the signal path of the ultrasonic ranging system, the calculation of actual distance data is completed according to distance order sequence in Figure 13. The real-time voltage of LIN bus in the ranging process is shown in Figure 13. The system sends ranging instructions and waits for the respond of ultrasonic transceiver between a and b (a range of valid time intervals is 77.6-154 μs), e524.06 chip in the ultrasonic transceiver evaluates the environmental noise in the measurement process between c and d, and the length of time T is the time used for ultrasonic transmission during a single measurement of the system. Software flow design of the whole ultrasonic ranging system can be realized according to the ranging distance sequence above. The controller issues a distance measurement command (the dominant level between 77.6 and 154 μs) after completing the system initialization, and starts the hardware count function, which calculates ultrasonic wave spreading time according to the difference between the counts of the two falling edges and system command cycle, with the help of programmable counter array (PCA) edge capture function of single-chip microcomputer (STC12C32S2).

Software Flow of the System Ranging Process
The working flow chart of the ranging system is shown in Figure 14. The system waits for the falling edge of c time (waiting for interrupt) from time b. When it enters the interrupt program, the system takes out the current timing value and uses it as the starting point of echo time. The system waits for the next falling edge trigger (e time) after processing the above, taking the current count value in the interrupt program as the end point of the echo time, clears the counter and related variables, and ends the ranging.
When the ranging is over, the system enters the communication and display module. Firstly, it turns off the capture function of the PCA module, uses the DS18b20 to get the current temperature, and further obtains the sound speed after calibration, and then calculates the current distance based on this. When data transmission is required, the system selects different transmission modes (control mode or acquisition mode), selects channels (single channel or quad channels), and then performs data checksum calculation. On this basis, it is packaged into data frames and sent via the LIN bus. Software flow design of the whole ultrasonic ranging system can be realized according to the ranging distance sequence above. The controller issues a distance measurement command (the dominant level between 77.6 and 154 µs) after completing the system initialization, and starts the hardware count function, which calculates ultrasonic wave spreading time according to the difference between the counts of the two falling edges and system command cycle, with the help of programmable counter array (PCA) edge capture function of single-chip microcomputer (STC12C32S2).

Software Flow of the System Ranging Process
The working flow chart of the ranging system is shown in Figure 14. The system waits for the falling edge of c time (waiting for interrupt) from time b. When it enters the interrupt program, the system takes out the current timing value and uses it as the starting point of echo time. The system waits for the next falling edge trigger (e time) after processing the above, taking the current count value in the interrupt program as the end point of the echo time, clears the counter and related variables, and ends the ranging.
When the ranging is over, the system enters the communication and display module. Firstly, it turns off the capture function of the PCA module, uses the DS18b20 to get the current temperature, and further obtains the sound speed after calibration, and then calculates the current distance based on this. When data transmission is required, the system selects different transmission modes (control mode or acquisition mode), selects channels (single channel or quad channels), and then performs data checksum calculation. On this basis, it is packaged into data frames and sent via the LIN bus. When data transmission is not required, the real-time distance display is directly performed and an audible and visual alarm is performed according to the defined safety value.  Figure 14.The diagram of system ranging process.

Ultrasonic Ranging Experiment and Analysis
The level conversion and ranging test system are built to verify the analysis of ultrasonic driving system and LIN bus level part and evaluate the overall function and safety of the system.

Analysis of LIN-Bus-Matching Resistance Experiment
As shown in Figure 15, it is noted that the controlling unit can realize the transmission of ultrasonic ranging instruction when the master node circuit RLIN is 1 kΩ during the experiment. However, the controlling unit cannot receive the effective response of the ultrasonic transceiver, which is shown in Figure 15.
The two curves in Figure 15 are the level changes of the LIN bus and the receive data (RXD) port of the TJA1020 chip when the resistance RLIN in Figure 10 is 1 kΩ, and the controller performs the ranging instruction (before c). The RXD terminal voltage varies with the LIN bus voltage (the dominant level is 115 μs), but at the time c and e, although the ultrasonic transceiver unit replies to the ranging information and the LIN bus generates a level change, the RXD terminal does not. The corresponding reaction is due to the fact that the "low" level of the LIN bus reaches 5.8 V, which exceeds the decision threshold of the TJA1020 for the highest level of the low level, so the hardware circuit needs to be improved.

Ultrasonic Ranging Experiment and Analysis
The level conversion and ranging test system are built to verify the analysis of ultrasonic driving system and LIN bus level part and evaluate the overall function and safety of the system.

Analysis of LIN-Bus-Matching Resistance Experiment
As shown in Figure 15, it is noted that the controlling unit can realize the transmission of ultrasonic ranging instruction when the master node circuit R LIN is 1 kΩ during the experiment. However, the controlling unit cannot receive the effective response of the ultrasonic transceiver, which is shown in Figure 15.
The two curves in Figure 15 are the level changes of the LIN bus and the receive data (RXD) port of the TJA1020 chip when the resistance R LIN in Figure 10 is 1 kΩ, and the controller performs the ranging instruction (before c). The RXD terminal voltage varies with the LIN bus voltage (the dominant level is 115 µs), but at the time c and e, although the ultrasonic transceiver unit replies to the ranging information and the LIN bus generates a level change, the RXD terminal does not. The corresponding reaction is due to the fact that the "low" level of the LIN bus reaches 5.8 V, which exceeds the decision threshold of the TJA1020 for the highest level of the low level, so the hardware circuit needs to be improved.  Table 3 shows the communication level results when the RLIN takes the values of 1 kΩ, 2 kΩ, and 3.5 kΩ. At this time, the ranging command transmission (123 μs, and 128 μs at the dominant level) can be realized. At point c and point e, as the voltage of the LIN bus drops, the voltage of RXD also changes. The corresponding low-level potentials of the LIN bus are 4.0 V and 3.2 V, respectively, in line with the LIN bus low level. The specification, therefore, produces a low level on the RXD side. The experiment also proves that when RLIN are 2 kΩ and 3.5 kΩ, the circuit can complete normal communication and data interaction, and realize effective communication between the ultrasonic transceiver unit and the controlling unit.

Analysis of Ultrasonic Ranging Instructions and Driving Wave Experiments
In order to verify the validity of the ranging command of the communication control system composed of the system microprocessor and TJA2010 for the ultrasonic driving system, the results shown in Figure 16 can be obtained by monitoring the LIN command level and the voltage across the transducer. As shown in Figure 16(a), at the time T1 and T2 after the ranging command is issued, a square wave is generated immediately at both ends of the transducer to drive the transducer. As shown in Figure 16(b), a total of 16 sets of pulses are generated during the period T11-T12 of driving the transducer, and the frequency f is written as:  Table 3 shows the communication level results when the R LIN takes the values of 1 kΩ, 2 kΩ, and 3.5 kΩ. At this time, the ranging command transmission (123 µs, and 128 µs at the dominant level) can be realized. At point c and point e, as the voltage of the LIN bus drops, the voltage of RXD also changes. The corresponding low-level potentials of the LIN bus are 4.0 V and 3.2 V, respectively, in line with the LIN bus low level. The specification, therefore, produces a low level on the RXD side. The experiment also proves that when R LIN are 2 kΩ and 3.5 kΩ, the circuit can complete normal communication and data interaction, and realize effective communication between the ultrasonic transceiver unit and the controlling unit.

Analysis of Ultrasonic Ranging Instructions and Driving Wave Experiments
In order to verify the validity of the ranging command of the communication control system composed of the system microprocessor and TJA2010 for the ultrasonic driving system, the results shown in Figure 16 can be obtained by monitoring the LIN command level and the voltage across the transducer. As shown in Figure 16a, at the time T 1 and T 2 after the ranging command is issued, a square wave is generated immediately at both ends of the transducer to drive the transducer. As shown in Figure 16b, a total of 16 sets of pulses are generated during the period T 11 -T 12 of driving the transducer, and the frequency f is written as:

Analysis of the System Measuring Range
In the laboratory environment, a 30 cm × 30 cm × 5 mm iron plate and a 3-m-long guide rail and bracket were used to build a mining ultrasonic ranging experimental platform to measure the range and accuracy of the system. The distance measurement in the range from 240 to 2800 mm was performed in steps of 100 mm, and the results obtained are shown in Figure 17. The experiment proves that the system can measure the distance measurement within 250 mm to 2700 mm, and the measurement error increases when the measured distance is closer (within 800 mm) and farther (outside 2100 mm). When the distance is medium (900 mm-2000 mm), the error is smaller and the overall system error is less than 3 cm.
At the same time, in order to determine the maximum and minimum values of the system measurement, the experiment was carried out in steps of 5 mm in the range of 230-260 mm and 2650-2750 mm, and 30 mm was the maximum allowable error limit. The experiment results show that the error would be larger if the distance is less than 245 mm and more than 2705 mm, thus determining the overall measuring range of the system from 250 mm to 2700 mm.

Analysis of the System Measuring Range
In the laboratory environment, a 30 cm × 30 cm × 5 mm iron plate and a 3-m-long guide rail and bracket were used to build a mining ultrasonic ranging experimental platform to measure the range and accuracy of the system. The distance measurement in the range from 240 to 2800 mm was performed in steps of 100 mm, and the results obtained are shown in Figure 17. The experiment proves that the system can measure the distance measurement within 250 mm to 2700 mm, and the measurement error increases when the measured distance is closer (within 800 mm) and farther (outside 2100 mm). When the distance is medium (900 mm-2000 mm), the error is smaller and the overall system error is less than 3 cm.

Analysis of the System Measuring Range
In the laboratory environment, a 30 cm × 30 cm × 5 mm iron plate and a 3-m-long guide rail and bracket were used to build a mining ultrasonic ranging experimental platform to measure the range and accuracy of the system. The distance measurement in the range from 240 to 2800 mm was performed in steps of 100 mm, and the results obtained are shown in Figure 17. The experiment proves that the system can measure the distance measurement within 250 mm to 2700 mm, and the measurement error increases when the measured distance is closer (within 800 mm) and farther (outside 2100 mm). When the distance is medium (900 mm-2000 mm), the error is smaller and the overall system error is less than 3 cm.
At the same time, in order to determine the maximum and minimum values of the system measurement, the experiment was carried out in steps of 5 mm in the range of 230-260 mm and 2650-2750 mm, and 30 mm was the maximum allowable error limit. The experiment results show that the error would be larger if the distance is less than 245 mm and more than 2705 mm, thus determining the overall measuring range of the system from 250 mm to 2700 mm.  At the same time, in order to determine the maximum and minimum values of the system measurement, the experiment was carried out in steps of 5 mm in the range of 230-260 mm and 2650-2750 mm, and 30 mm was the maximum allowable error limit. The experiment results show that the error would be larger if the distance is less than 245 mm and more than 2705 mm, thus determining the overall measuring range of the system from 250 mm to 2700 mm.

Analysis of System Measuring Stability
Considering that the system will make larger errors due to other factors such as the external environment in a single measurement, it is necessary to count the multiple measurement results of the system at the same distance to evaluate the stability of the system. Figure 18 shows the measurement results obtained after 50 times of measurements of the system at 500 mm, 1200 mm, 1600 mm and 2700 mm. The experimental results show that when the obstacle distances are 500 mm, 1200 mm, 1600 mm and 2700 mm, the measurement fluctuations of the ultrasonic ranging system are 2 mm, 1 mm, 2 mm and 3 mm, respectively, with the fluctuation of less than 1 cm. At the same time, the maximum absolute value of measurement errors are 27 mm, 19 mm, 1 mm and 13 mm, respectively. The measurement at 1600 mm is more accurate, which is consistent with the moderate distance and small error experimental results in the measurement range experiment. The experimental result proves that the overall system error is less than 3 cm.

Conclusions
Based on the study of ultrasonic transmission path, this paper selects the ultrasonic transducer. The transformerless ultrasonic driving circuit was designed by calculating the energy of the critical energy storage components in normal and fault conditions. The parameter setting for implementing the wave-processing circuit based on LIN bus technology was completed, and the transmission scheme of the comparison result was demonstrated. Finally, the above-mentioned ultrasonic transceiver scheme was verified by the e524.06 chip, and the ultrasonic ranging system without a transformer was built to verify the ranging performance. The experiment proves that the ultrasonic ranging system can realize distance measurement in the range of 250-2700 mm with an error of less than 30 mm and a measurement fluctuation of less than 10 mm, which provides an effective method for improving the anti-interference ability of the mining ultrasonic ranging system.