Design and Performance Analysis of an Intrinsically Safe Ultrasonic Ranging Sensor

In flammable or explosive environments, an ultrasonic sensor for distance measurement poses an important engineering safety challenge, because the driving circuit uses an intermediate frequency transformer as an impedance transformation element, in which the produced heat or spark is available for ignition. In this paper, an intrinsically safe ultrasonic ranging sensor is designed and implemented. The waterproof piezoelectric transducer with integrated transceiver is chosen as an energy transducing element. Then a novel transducer driving circuit is designed based on an impedance matching method considering safety spark parameters to replace an intermediate frequency transformer. Then, an energy limiting circuit is developed to achieve dual levels of over-voltage and over-current protection. The detail calculation and evaluation are executed and the electrical characteristics are analyzed to verify the intrinsic safety of the driving circuit. Finally, an experimental platform of the ultrasonic ranging sensor system is constructed, which involves short-circuit protection. Experimental results show that the proposed ultrasonic ranging sensor is excellent in both ranging performance and intrinsic safety.


Introduction
Non-contact distance measurement is widely used for aircraft altimetry, ship docking, vehicle safety reversing and some other location detection systems. However, non-contact distance measurements in flammable and explosive environments such as coal mines, and the chemical, oil, gas industries and some other circumstances have always been a technical challenge.
In general, there are several mature non-contact distance measurement technologies, such as capacitive [1], laser [2,3], infrared [4,5], and ultrasonic [6,7] methods, etc. The capacitive sensor is normally used in near-distance measurements whose range is within 0.3 m [8]. Laser distance measuring sensors show advantages of high accuracy, anti-electromagnetic interference, and their measurement distance can be up to 1000 m. They are often considered suitable for distance measurement in harsh environments. The infrared distance measuring sensor is based on the characteristics of non-proliferation when infrared light is spread. With its advantages of high speed, high resolution and high security, an infrared distance measuring sensor can be used to take a distance measurement of up to hundreds of meters. However, the above two methods have some disadvantages. They both have a small beam-angle, which will lead to a limited direction coverage, and they cannot replace ultrasonic devices in some applications such as an ultrasonic parking assistance systems. The beam-angle of an ultrasonic transducer varies from 7˝to 30˝, which is a large direction range. The ranging principle of ultrasonic distance measurement systems is based on the time-of-flight measurement of reflected echoes [9,10]. Ultrasonic sensors are increasingly popular compared to other devices in the field of distance measurement up to a few meters, because they have advantages of low cost, easy implementation, anti-electromagnetic interference, and strong ability to adapt all kinds of targets and light intensities [11,12]. For this reason, ultrasonic sensors are widely used in target distance measurement tasks [13,14].
However, in certain flammable and explosive environments, the concentration of flammable gas can be high. It is dangerous to let a distance measuring system to be exposed to this environment, so all the electrical devices need to be installed in explosion-proof shells, which are heavy and limits their use in the field. It is much safer when an ultrasonic ranging sensor is designed with an intrinsically safe circuit. Furthermore, the design makes the intrinsically safe equipment have smaller size and lower cost [15,16]. Intrinsically safe circuits are widely used in flammable and explosive environment applications, such as water level measurement [17] and power supplies [18]. Unfortunately, the applications of currently existing ultrasonic distance measurement systems in potentially flammable or explosive environments are limited due to their non-intrinsic safety. Therefore, it is necessary to design an intrinsically safe ultrasonic ranging system.
Intrinsic safety is a protection method based on the principle of limiting energy in an electrical circuit, which is more favorable than the other existing safety concepts [19,20]. In general, there are two categories of intrinsically safe and associated apparatus, which are "ia" and "ib" respectively. The categories differ in two main aspects: one is the number of specified faults and the other is the value of safety factor [21]. In this paper, the circuit is designed according to the standard of "ia", which has more stringent requirements. When the system is operating, an intrinsically safe circuit in an electrical apparatus of category "ia" should not cause ignition in each of the following circumstances: (a) normal operation; (b) normal operation and with one countable fault; (c) normal operation and with two countable faults.
Based on the considerations and thorough analyses of the conventional ultrasonic ranging sensor, a novel ultrasonic ranging sensor has been designed and fabricated to achieve intrinsically safe characteristics and to be usable in flammable or explosive environment applications, while maintaining (almost) the same performance and function levels as conventional sensors. Besides the necessary designs to meet the precision and range demands of ultrasonic distance measurement, the intrinsically safe circuit is laid out and evaluated. Moreover, an energy limiting circuit is specially designed to achieve dual over-voltage and over-current protection for the whole sensor system. Finally, a series of experiments are performed to verify the performance of the proposed intrinsically safe ultrasonic ranging sensor.

An Analysis of Ultrasonic Ranging Sensors and Their Impedance Matching Circuits
The block diagram of the ultrasonic ranging sensor is illustrated in Figure 1. According to the demands of ultrasonic ranging equipment, such as a reversing ultrasonic alert system, the system should have at least three transducer circuits at the same time due to the directivity characteristics of a single ultrasonic transducer, if not, it is difficult to detect a target outside the beam-angle. In Figure 1, only one transducer circuit is shown. The implementation of the other two is the same as this. As can be easily seen, the whole system is broadly composed of a power supply circuit, driving circuit, transducer, echo receiving circuit, ultrasonic ranging and data processing, DS18B20 temperature compensator (Dallas Semiconductor Inc, Dallas, TX, USA), ranging and alarm control unit, visualization and sound-light alarm. The power supply circuit provides all kinds of voltage grades for the sensor system. The ranging module is made up of an ultrasonic transmitting circuit, an echo receiving module and data processing module. The GM3101 (Chengdu Goldtel Microelectronics Co., LTD, Chengdu, China) ultrasonic ranging IC (integrated circuit, IC) is in charge of transmitting 40 kHz pulse signals and transforming the echo signals into distance information. The alarm module consists of two parts: one part is the ranging and alarm unit used to send ranging and alarm commands, and the other part is the visualization and sound-light alarm module.
In the proposed intrinsically safe ultrasonic ranging sensor, a waterproof piezoelectric transducer with integrated transceiver is selected as the energy transducing element because it is suitable for complex environments, such as coal mines. The appearance and the equivalent circuit diagram of the waterproof piezoelectric transducer with integrated transceiver are schematically shown in Figure 2a Figure 2a shows the transducer has a metal shell, which can insulate the internal structure from water and dust in the complex environment. Moreover, when the transducer works in resonant state, its equivalent circuit can be depicted as in Figure 2b, where the static capacitance, the dynamic The power supply circuit provides all kinds of voltage grades for the sensor system. The ranging module is made up of an ultrasonic transmitting circuit, an echo receiving module and data processing module. The GM3101 (Chengdu Goldtel Microelectronics Co., LTD, Chengdu, China) ultrasonic ranging IC (integrated circuit, IC) is in charge of transmitting 40 kHz pulse signals and transforming the echo signals into distance information. The alarm module consists of two parts: one part is the ranging and alarm unit used to send ranging and alarm commands, and the other part is the visualization and sound-light alarm module.
In the proposed intrinsically safe ultrasonic ranging sensor, a waterproof piezoelectric transducer with integrated transceiver is selected as the energy transducing element because it is suitable for complex environments, such as coal mines. The appearance and the equivalent circuit diagram of the waterproof piezoelectric transducer with integrated transceiver are schematically shown in Figure 2a The power supply circuit provides all kinds of voltage grades for the sensor system. The ranging module is made up of an ultrasonic transmitting circuit, an echo receiving module and data processing module. The GM3101 (Chengdu Goldtel Microelectronics Co., LTD, Chengdu, China) ultrasonic ranging IC (integrated circuit, IC) is in charge of transmitting 40 kHz pulse signals and transforming the echo signals into distance information. The alarm module consists of two parts: one part is the ranging and alarm unit used to send ranging and alarm commands, and the other part is the visualization and sound-light alarm module.
In the proposed intrinsically safe ultrasonic ranging sensor, a waterproof piezoelectric transducer with integrated transceiver is selected as the energy transducing element because it is suitable for complex environments, such as coal mines. The appearance and the equivalent circuit diagram of the waterproof piezoelectric transducer with integrated transceiver are schematically shown in Figure 2a Figure 2a shows the transducer has a metal shell, which can insulate the internal structure from water and dust in the complex environment. Moreover, when the transducer works in resonant state, its equivalent circuit can be depicted as in Figure 2b, where the static capacitance, the dynamic  Figure 2a shows the transducer has a metal shell, which can insulate the internal structure from water and dust in the complex environment. Moreover, when the transducer works in resonant state, its equivalent circuit can be depicted as in Figure 2b, where the static capacitance, the dynamic capacitance, the dynamic inductance, and the dynamic resistance of the piezoelectric transducer are defined as C 0 , C, L and R, respectively.
When the transducer's parallel branch is resonant, in other words, working at a parallel resonant angular frequency, the reactance of L, C and C 0 will be counteracted and the transducer may be equivalent to Figure 2c. C 1 0 , C 1 , L 1 and R 1 are respectively the static capacitance, the dynamic capacitance, the dynamic inductance, and the dynamic resistance of the piezoelectric transducer after equivalent transformation. Then, the equivalent circuit can be simplified into Figure 2d through further equivalent transformation [22]. Relevant calculations are expressed as follows: where, w p is the parallel resonance angular frequency [22], and Z p is the total impedance of the transducer when working at the parallel resonance angular frequency.
After combining Equation (2) and Figure 2d, some conclusions can be drawn as follows: The piezoelectric transducer is capacitive at resonance. In order to improve the vibration amplitude of the surface and the work efficiency of piezoelectric transducer, the problem of impedance matching must be solved first. Generally, there are various impedance matching circuits such as parallel inductance, series inductance, capacitance-inductance, T network, etc. Among them, the capacitance-inductance matching circuit is the most practical, for it can not only match the transducer but also wipe off the harmonic from the power source. As can be seen from Figure 3, L 1 is the matching inductance and C 1 is the matching capacitance. capacitance, the dynamic inductance, and the dynamic resistance of the piezoelectric transducer are defined as C0, C, L and R, respectively. When the transducer's parallel branch is resonant, in other words, working at a parallel resonant angular frequency, the reactance of L, C and C0 will be counteracted and the transducer may be equivalent to Figure 2c. C′0, C′, L′ and R′ are respectively the static capacitance, the dynamic capacitance, the dynamic inductance, and the dynamic resistance of the piezoelectric transducer after equivalent transformation. Then, the equivalent circuit can be simplified into Figure 2d through further equivalent transformation [22]. Relevant calculations are expressed as follows: where, wp is the parallel resonance angular frequency [22], and Zp is the total impedance of the transducer when working at the parallel resonance angular frequency.
After combining Equation (2) and Figure 2d, some conclusions can be drawn as follows: The piezoelectric transducer is capacitive at resonance. In order to improve the vibration amplitude of the surface and the work efficiency of piezoelectric transducer, the problem of impedance matching must be solved first. Generally, there are various impedance matching circuits such as parallel inductance, series inductance, capacitance-inductance, T network, etc. Among them, the capacitance-inductance matching circuit is the most practical, for it can not only match the transducer but also wipe off the harmonic from the power source. As can be seen from Figure 3, L1 is the matching inductance and C1 is the matching capacitance. To simplify the calculations, the total shunt capacitance of both ends of the transducer is expressed as CS = C1 + C0. Hence, the total input impedance of piezoelectric transducer can be derived by substituting the CS expression into Equation (2). The following equations can be obtained: To simplify the calculations, the total shunt capacitance of both ends of the transducer is expressed as C S = C 1 + C 0 . Hence, the total input impedance of piezoelectric transducer can be derived by substituting the C S expression into Equation (2). The following equations can be obtained: where, Z 1 p is the total impedance after the impedance matching. Then the imaginary part is set as 0, the relationship between the matching capacitance and the matching inductance is obtained, as is shown below: Equation (6) shows that the parameters of L 1 and C 1 only depend on C 0 , the static capacitor of piezoelectric transducer, when the piezoelectric transducer is working in the state of parallel resonance. Relevant parameters of the selected piezoelectric transducer and matching circuit can be seen in Table 1. Moreover, all of the parameters are obtained under the condition of 48 V driving voltage and are allowed for an intrinsic safety design. The experimental studies will be conducted and analyzed in next section.

Analysis of Non-Intrinsically Safe Ultrasonic Driving Circuit
Compared to the non-waterproof transducer, the waterproof piezoelectric transducer with an integrated transceiver can be used in harsh environments. However, it has lower transmitting and receiving efficiency [23]. The waterproof piezoelectric transducer with an integrated transceiver cannot be driven directly by a microprocessor. Therefore a specially designed driving circuit is required. For the ultrasonic ranging sensor, a power supply circuit and a driving circuit are the main energy circuits. A typical driving circuit of conventional ultrasonic ranging sensor is shown in Figure 4.
where, Z′p is the total impedance after the impedance matching. Then the imaginary part is set as 0, the relationship between the matching capacitance and the matching inductance is obtained, as is shown below: Equation (6) shows that the parameters of L1 and C1 only depend on C0, the static capacitor of piezoelectric transducer, when the piezoelectric transducer is working in the state of parallel resonance. Relevant parameters of the selected piezoelectric transducer and matching circuit can be seen in Table 1. Moreover, all of the parameters are obtained under the condition of 48 V driving voltage and are allowed for an intrinsic safety design. The experimental studies will be conducted and analyzed in next section.

Analysis of Non-Intrinsically Safe Ultrasonic Driving Circuit
Compared to the non-waterproof transducer, the waterproof piezoelectric transducer with an integrated transceiver can be used in harsh environments. However, it has lower transmitting and receiving efficiency [23]. The waterproof piezoelectric transducer with an integrated transceiver cannot be driven directly by a microprocessor. Therefore a specially designed driving circuit is required. For the ultrasonic ranging sensor, a power supply circuit and a driving circuit are the main energy circuits. A typical driving circuit of conventional ultrasonic ranging sensor is shown in Figure 4.  that the driving circuit is difficult to meet the requirement of an intrinsically safe circuit. A specific energy feature analysis is shown below: In the stage of ultrasonic wave transmission, the current in each branch of the driving circuit and the current through the inductor are calculated as follows: q A " 0.024 A (10) where, I L , I R , and I t are the current of each branch, respectively. I L is also the current through the inductor. U 0 is the driving voltage about 48 V. R 11 is the current limiting resistance. In order to improve reliability of the circuit, the current should be multiplied by a safety factor k (2.0), which is: According to the critical ignition curve of an inductance circuit [21], we can find the minimum igniting current for 8 mH inductance is I B = 300 mA when the voltage is 36 V. Hence, it is believed that the I L 1 is much higher than the minimum igniting current under the condition of 48 V voltage.
Therefore, the typical driving circuit has been proved to have non-intrinsically safe features by the calculation of current.

Energy Limiting Circuit
In the proposed distance measurement sensor system, an energy limiting circuit is designed to develop the intrinsically safe characteristic of the sensor. The energy limiting circuit is shown in Figure 5.
In the stage of ultrasonic wave transmission, the current in each branch of the driving circuit and the current through the inductor are calculated as follows: (11) where, IL, IR, and It are the current of each branch, respectively. IL is also the current through the inductor. U0 is the driving voltage about 48 V. R11 is the current limiting resistance. In order to improve reliability of the circuit, the current should be multiplied by a safety factor k (2.0), which is: (12) According to the critical ignition curve of an inductance circuit [21], we can find the minimum igniting current for 8 mH inductance is IB = 300 mA when the voltage is 36 V. Hence, it is believed that the IL′ is much higher than the minimum igniting current under the condition of 48 V voltage. Therefore, the typical driving circuit has been proved to have non-intrinsically safe features by the calculation of current.

Energy Limiting Circuit
In the proposed distance measurement sensor system, an energy limiting circuit is designed to develop the intrinsically safe characteristic of the sensor. The energy limiting circuit is shown in Figure 5.

Over-Voltage Protection
As can be seen from Figure 5, the transistor Q 1 is an on-off component that is controlled by the comparator U 1A and U 1B . In normal state, the base of the transistor Q 1 is in low level, so the transistor Q 1 is at an ON-state. D 15 is TL431, a 3-terminal voltage stabilizer, which can keep U 9 (the voltage of positive input end of U 1A ) at a holding potential of 2.5 V. Namely, U 9 = 2.5 V. Moreover, U 8 (the voltage of inverting input end of U 1A ) can be represented as: In the proposed sensor system, the threshold of input voltage U I is 12.5 V. After matching the suitable value of R 12 with R 13 , the divider resistors U 8 will achieve 2.5 V when the input voltage U I is 12.5 V. If the input voltage is higher than 12.5 V, it will lead to the result that U 8 is greater than U 9 , and that the output voltage level of the comparator U 1A will change from high to low. Hence, the inverting input end voltage of U 1B will be pulled down through the circuits of D 9 and D 17 , which will cause the base of Q 1 turning to a high voltage. Then, the transistor Q 1 is at an OFF-state, in which the power supply will be cut off to realize an over-voltage protection. From Figure 6, we can know that the output voltage U O will be 0 V when the input voltage U I is higher than 12.45 V. Over-Voltage Protection As can be seen from Figure 5, the transistor Q1 is an on-off component that is controlled by the comparator U1A and U1B. In normal state, the base of the transistor Q1 is in low level, so the transistor Q1 is at an ON-state. D15 is TL431, a 3-terminal voltage stabilizer, which can keep U9 (the voltage of positive input end of U1A) at a holding potential of 2.5 V. Namely, U9 = 2.5 V. Moreover, U8 (the voltage of inverting input end of U1A) can be represented as: In the proposed sensor system, the threshold of input voltage UI is 12.5 V. After matching the suitable value of R12 with R13, the divider resistors U8 will achieve 2.5 V when the input voltage UI is 12.5 V. If the input voltage is higher than 12.5 V, it will lead to the result that U8 is greater than U9, and that the output voltage level of the comparator U1A will change from high to low. Hence, the inverting input end voltage of U1B will be pulled down through the circuits of D9 and D17, which will cause the base of Q1 turning to a high voltage. Then, the transistor Q1 is at an OFF-state, in which the power supply will be cut off to realize an over-voltage protection. From Figure 6, we can know that the output voltage UO will be 0 V when the input voltage UI is higher than 12.45 V. In the proposed sensor, the threshold current of system is 100 mA. R4, whose value is 2 Ω, is the resistance for over-current detecting. Moreover, because D3 is an accurate voltage stabilizer TL431 (Texas Instruments, Dallas, TX, USA), the voltage between cathode and anode of D3 is 2.5 V. Hence, the positive input end voltage of U1B can be expressed as: where R5 and R6 are the divider resistors, respectively, UI is the input voltage, and UR5 is the voltage of R5. As can be seen from Equation (14), by matching the values of R5 with R6, the voltage of UR5 is stabilized at 0.2 V.
As the rated current of the proposed sensor is about 70 mA, the voltage of R4 is lower than 0.2 V under normal circumstances, so for the comparator U1B (LM339, Texas Instruments, Dallas, TX, USA), the voltage of its positive input end is lower than that of inverting input end, which will make the output voltage of U1B become low and Q1 be at an ON-state, but when short circuits and other faults occur, the system current is more than 100 mA. Furthermore, the voltage of R4 will be higher than 0.2 V, which will lead to the output becoming high and Q1 being at an OFF-state. Then, the In the proposed sensor, the threshold current of system is 100 mA. R 4 , whose value is 2 Ω, is the resistance for over-current detecting. Moreover, because D 3 is an accurate voltage stabilizer TL431 (Texas Instruments, Dallas, TX, USA), the voltage between cathode and anode of D 3 is 2.5 V. Hence, the positive input end voltage of U 1B can be expressed as: where R 5 and R 6 are the divider resistors, respectively, U I is the input voltage, and U R5 is the voltage of R 5 . As can be seen from Equation (14), by matching the values of R 5 with R 6 , the voltage of U R5 is stabilized at 0.2 V.
As the rated current of the proposed sensor is about 70 mA, the voltage of R 4 is lower than 0.2 V under normal circumstances, so for the comparator U 1B (LM339, Texas Instruments, Dallas, TX, USA), the voltage of its positive input end is lower than that of inverting input end, which will make the output voltage of U 1B become low and Q 1 be at an ON-state, but when short circuits and other faults occur, the system current is more than 100 mA. Furthermore, the voltage of R 4 will be higher than 0.2 V, which will lead to the output becoming high and Q1 being at an OFF-state. Then, the power supply will be cut off so as to realize over-current protection. Figure 7 shows the maximum allowable current of sensor is 0.101 A.
Sensors 2016, 16,867 8 of 17 power supply will be cut off so as to realize over-current protection. Figure 7 shows the maximum allowable current of sensor is 0.101 A.

Design and Evaluation of an Intrinsically Safe Driving Circuit
To solve the above issue, a transducer driving circuit with a high-speed opto-coupler has been designed. The proposed driving circuit is shown in Figure 8, where IC1 is the high-speed opto-coupler, and its switching speed can reach microsecond grade. Once the high speed opto-coupler closes, it can isolate the power supply from an echo signal completely. Therefore it is suitable for transmitting impulse signal and weak echo signal. At the same time, there is no energy storage element in the proposed driving circuit. It can be concluded that the proposed driving circuit meets the requirement of an intrinsically safe circuit based on the above calculation and analysis. The sparks safety assessment of transducer's matching circuit and drive circuit can be seen as follows:  (16) where U0 is the driving voltage about 48 V. The current limiting resistances R13 and R15 are both 135 Ω. I1 is the current of flowing through the inductor L1. In order to improve reliability of the circuit, the current should be multiplied by a safety factor k (2.0), that is: According to the critical ignition curve of inductance circuit [21], we can find the minimum igniting current IB of 0.33 mH inductance is 1.1 A, which is much higher than 234.96 mA. So, the designed circuit meets the requirements of the desired intrinsic safety circuit.

Design and Evaluation of an Intrinsically Safe Driving Circuit
To solve the above issue, a transducer driving circuit with a high-speed opto-coupler has been designed. The proposed driving circuit is shown in Figure 8, where IC 1 is the high-speed opto-coupler, and its switching speed can reach microsecond grade. Once the high speed opto-coupler closes, it can isolate the power supply from an echo signal completely. Therefore it is suitable for transmitting impulse signal and weak echo signal. At the same time, there is no energy storage element in the proposed driving circuit. It can be concluded that the proposed driving circuit meets the requirement of an intrinsically safe circuit based on the above calculation and analysis. The sparks safety assessment of transducer's matching circuit and drive circuit can be seen as follows: where I2 is the shorted current of L1. If the current I2 is multiplied by a safety factor k (2), that is: First, under normal condition, the normal work current I 1 of the designed driving circuit is expressed as: U 0 R 15`R13`R 1 " p 48 135`135`138.58 q mA " 117.48 mA (16) where U 0 is the driving voltage about 48 V. The current limiting resistances R 13 and R 15 are both 135 Ω. I 1 is the current of flowing through the inductor L 1 . In order to improve reliability of the circuit, the current should be multiplied by a safety factor k (2.0), that is: According to the critical ignition curve of inductance circuit [21], we can find the minimum igniting current I B of 0.33 mH inductance is 1.1 A, which is much higher than 234.96 mA. So, the designed circuit meets the requirements of the desired intrinsic safety circuit.
Second, when the short circuit occurs in the transducer, the current I 2 of the proposed driving circuit is calculated as follows: " p 48 135`135 q mA " 177.78 mA (18) where I 2 is the shorted current of L 1 . If the current I 2 is multiplied by a safety factor k (2), that is: As it can obviously seen, I B " I 1 2 , which meets the requirements of the desired intrinsic safety circuit.
If the current I 2 is multiplied by a safety factor k (1.5), that is: " kˆI 2 " p1.5ˆ177.78q mA " 266.67 mA (20) According to the critical ignition curve of resistance circuit [21], we can find the minimum igniting current I B corresponding to the 48 V power supply is 275.00 mA, which is higher than 266.67 mA. Therefore, the above spark ignition analyses and calculation results indicate that the circuit is intrinsically safe.
The transmitting pulses produced by the novel approach of driving current are shown in Figure 9. Due to the resistance distribution of current limiting resistor and opto-coupler, a pulse string, composed of about 16 V and 40 kHz pulse signals which is controlled by GM3101, will be sent to the anode of the transducer. The time of the stage A, when the sensor is transmitting pulses, is T A = 16ˆ25 µs = 400 µs. After transmitting the pulses, the microprocessor will turn off the opto-coupler and the transducer will go to the stage of aftershock (C) before the echo receiving stage. In order to distinguish the aftershock signal and the echo signal, a period of aftershock shielding time is necessary, after which the proposed sensor begins to detect an echo. In Figure 9, B represents the stage of aftershock shielding. Obviously, T B is much larger than T C . After designing and implementing the driving circuit, we take a waterproof piezoelectric transducer with an integrated transceiver for experiments to test its driving ability. Tests have been done in various distances of the target object, and the echo waveform in 185 cm is shown in Figure 10. We can find that the echo voltage is still very large (about 1.75 V) in such a long distance, which shows that the proposed novel driving circuit has a pretty good performance in driving the waterproof piezoelectric transducer with integrated transceiver.  (20) According to the critical ignition curve of resistance circuit [21], we can find the minimum igniting current IB corresponding to the 48 V power supply is 275.00 mA, which is higher than 266.67 mA. Therefore, the above spark ignition analyses and calculation results indicate that the circuit is intrinsically safe. The transmitting pulses produced by the novel approach of driving current are shown in Figure 9. Due to the resistance distribution of current limiting resistor and opto-coupler, a pulse string, composed of about 16 V and 40 kHz pulse signals which is controlled by GM3101, will be sent to the anode of the transducer. The time of the stage A, when the sensor is transmitting pulses, is TA = 16 × 25 μs = 400 μs. After transmitting the pulses, the microprocessor will turn off the opto-coupler and the transducer will go to the stage of aftershock (C) before the echo receiving stage. In order to distinguish the aftershock signal and the echo signal, a period of aftershock shielding time is necessary, after which the proposed sensor begins to detect an echo. In Figure 9, B represents the stage of aftershock shielding. Obviously, TB is much larger than TC. After designing and implementing the driving circuit, we take a waterproof piezoelectric transducer with an integrated transceiver for experiments to test its driving ability. Tests have been done in various distances of the target object, and the echo waveform in 185 cm is shown in Figure 10. We can find that the echo voltage is still very large (about 1.75 V) in such a long distance, which shows that the proposed novel driving circuit has a pretty good performance in driving the waterproof piezoelectric transducer with integrated transceiver.

The Realization of the Distance Measurement Sensor
The digital circuit hardware selection is shown in Table 2. A software program for the MSP430F149 microprocessor (Texas Instruments, Dallas, TX, USA) has been developed. The flowchart of the software is given in Figure 11. The program was written in C language on the platform of Keil uVision 4 IDE (Advanced RISC Machines, Cambridge, UK). After the system was initialized, the microprocessor sent the command of measuring distance to GM3101 first and then was ready to receive the distance information from GM3101. For the information from GM3101, the microprocessor determines whether it is correct distance

The Realization of the Distance Measurement Sensor
The digital circuit hardware selection is shown in Table 2. A software program for the MSP430F149 microprocessor (Texas Instruments, Dallas, TX, USA) has been developed. The flowchart of the software is given in Figure 11. The program was written in C language on the platform of Keil uVision 4 IDE (Advanced RISC Machines, Cambridge, UK). After the system was initialized, the microprocessor sent the command of measuring distance to GM3101 first and then was ready to receive the distance information from GM3101. For the information from GM3101, the microprocessor determines whether it is correct distance information. If the information is right, it will be analyzed and calculated so that we can get the accurate distance S of the obstacle. Next, the distance S is compared with the setting thresholds in order to decide whether it is necessary to trigger the alarm. In the proposed system, there are three levels of alarm. When S ≤ 0.5 m, the LED will be lit and the buzzer will beep at the frequency 10 Hz. When 0.5 m < S ≤ 0.75 m, the LED will be lit and the buzzer will beep at the frequency 5 Hz. When 0.75 m < S ≤ 1 m, the LED will be lit and the buzzer will beep at the frequency 2 Hz. When S >1 m, the sound-light alarm will not be triggered. Moreover, the distance information will be displayed on the LCD12864. As can be seen in the Figure 11, after initializing the I/O ports and LCD12864, the microprocessor will transform the coordinates where the characters and images display on the LCD screen into the corresponding coordinates of the LCD screen inside, and then feeds the coordinates into LCD screen through parallel I/O ports. Finally, the microprocessor sends the characters and images that express obstacle distances to LCD still through parallel I/O ports.

Experimental Setup and System Errors
To test and verify the effectiveness of the novel transducer circuit and the practicality of the real-time measurement sensor, an experimental measurement has been performed with the intrinsically safe ultrasonic ranging sensor. The entire experimental setup is shown in Figure 12.
An ultrasonic transducer and target object were placed on an optical bench (300 cm in length) with an easily readable distance scale so that the actual distance value was controlled and read precisely by a simple way. In order to avoid the effect of other objects, the transducer and target objects simulating explosion-proof enclosure (25 cm × 25 cm) were fixed at an altitude of 50 cm by two metal rods. The 12 V switching power source provided basic electrical power for the proposed distance measurement sensor. Three types of measurements were performed.
The schematic diagram of the experiment platform (side view) is shown in Figure 13. From Figure 13, it can be observed that the value read from the standard gauge block is not the actual distance between ultrasonic transducer and target board, due to the errors of test platform. In fact, Figure 11. Flowchart of the software.
Next, the distance S is compared with the setting thresholds in order to decide whether it is necessary to trigger the alarm. In the proposed system, there are three levels of alarm. When S ď 0.5 m, the LED will be lit and the buzzer will beep at the frequency 10 Hz. When 0.5 m < S ď 0.75 m, the LED will be lit and the buzzer will beep at the frequency 5 Hz. When 0.75 m < S ď 1 m, the LED will be lit and the buzzer will beep at the frequency 2 Hz. When S >1 m, the sound-light alarm will not be triggered. Moreover, the distance information will be displayed on the LCD12864. As can be seen in the Figure 11, after initializing the I/O ports and LCD12864, the microprocessor will transform the coordinates where the characters and images display on the LCD screen into the corresponding coordinates of the LCD screen inside, and then feeds the coordinates into LCD screen through parallel I/O ports. Finally, the microprocessor sends the characters and images that express obstacle distances to LCD still through parallel I/O ports.

Experimental Setup and System Errors
To test and verify the effectiveness of the novel transducer circuit and the practicality of the real-time measurement sensor, an experimental measurement has been performed with the intrinsically safe ultrasonic ranging sensor. The entire experimental setup is shown in Figure 12.

Resolution and Blind Area
For the proposed intrinsically safe ultrasonic ranging sensor, the resolution is mainly determined by the GM3101 distance measurement chip. The details of the GM3101 can be found in the GM3101 datasheet, which indicates a resolution of 5 cm. Although there are higher resolution ultrasonic ranging sensors in existing products, the resolution is acceptable in the practical application considering the purpose of the developed equipment.
A test has been done in order to evaluate the different measuring performance between the proposed intrinsically safe ultrasonic ranging sensor and conventional ultrasonic ranging sensor. We chose several sample points and measured the distance of every sample points by using two categories of ranging sensor respectively. The measured results show that the blind is 30 cm and the maximum measuring range is 300 cm for the proposed intrinsically safe sensor. Within the measurement range of 30 cm to 300 cm, the same measurement results were obtained by adopting two categories of ranging sensor respectively.

Linearity
Linearity is used to evaluate the performance of the distance measurement sensor. In the experiment, the target object distance is decided by a 300 cm long optical bench, whose precision is 1 mm. Each time, the distance measured by the proposed sensor will be compared with the distance An ultrasonic transducer and target object were placed on an optical bench (300 cm in length) with an easily readable distance scale so that the actual distance value was controlled and read precisely by a simple way. In order to avoid the effect of other objects, the transducer and target objects simulating explosion-proof enclosure (25 cmˆ25 cm) were fixed at an altitude of 50 cm by two metal rods. The 12 V switching power source provided basic electrical power for the proposed distance measurement sensor. Three types of measurements were performed.
The schematic diagram of the experiment platform (side view) is shown in Figure 13. From Figure 13, it can be observed that the value read from the standard gauge block is not the actual distance between ultrasonic transducer and target board, due to the errors of test platform. In fact, there is a system error between them, and the actual distance can be expressed as follows: D a " D s´De (21) where D a is the actual distance between transceiver and target board, D s is the standard distance that read from the standard gauge block, D e is the system error. In these experiments D e is 5 cm.

Resolution and Blind Area
For the proposed intrinsically safe ultrasonic ranging sensor, the resolution is mainly determined by the GM3101 distance measurement chip. The details of the GM3101 can be found in the GM3101 datasheet, which indicates a resolution of 5 cm. Although there are higher resolution ultrasonic ranging sensors in existing products, the resolution is acceptable in the practical application considering the purpose of the developed equipment.

Resolution and Blind Area
For the proposed intrinsically safe ultrasonic ranging sensor, the resolution is mainly determined by the GM3101 distance measurement chip. The details of the GM3101 can be found in the GM3101 datasheet, which indicates a resolution of 5 cm. Although there are higher resolution ultrasonic ranging sensors in existing products, the resolution is acceptable in the practical application considering the purpose of the developed equipment.
A test has been done in order to evaluate the different measuring performance between the proposed intrinsically safe ultrasonic ranging sensor and conventional ultrasonic ranging sensor. We chose several sample points and measured the distance of every sample points by using two categories of ranging sensor respectively. The measured results show that the blind is 30 cm and the maximum measuring range is 300 cm for the proposed intrinsically safe sensor. Within the measurement range of 30 cm to 300 cm, the same measurement results were obtained by adopting two categories of ranging sensor respectively.

Linearity
Linearity is used to evaluate the performance of the distance measurement sensor. In the experiment, the target object distance is decided by a 300 cm long optical bench, whose precision is 1 mm. Each time, the distance measured by the proposed sensor will be compared with the distance measured by optical bench. According to the interpretation shown in Section 4, we know that the sensor has a period of time for aftershock shielding (T B ). In this paper, the ultrasonic transducer NU40A25TR-1 (Shenzhen JINCI Technology CO., LTD., Shenzhen, China) has been used, consider of the characteristics of it, T B was set as 1.7 ms. Hence, the measuring blind area can be obtained as follows: where D B is the distance of measuring blind area, C is the speed of sound and T B is the aftershock shielding time. Experimental results of the linearity test in a measuring range of 30 cm to 300 cm are shown in Figure 14. In Figure 14, it can be seen that the maximum error of this test is about´6 cm or 2.22% within the full scale span (FSS).
Sensors 2016, 16, 867 13 of 17 measured by optical bench. According to the interpretation shown in Section 4, we know that the sensor has a period of time for aftershock shielding (TB). In this paper, the ultrasonic transducer NU40A25TR-1 (Shenzhen JINCI Technology CO., LTD., Shenzhen, China) has been used, consider of the characteristics of it, TB was set as 1.7 ms. Hence, the measuring blind area can be obtained as follows: (22) where DB is the distance of measuring blind area, C is the speed of sound and TB is the aftershock shielding time. Experimental results of the linearity test in a measuring range of 30 cm to 300 cm are shown in Figure 14. In Figure 14, it can be seen that the maximum error of this test is about −6 cm or 2.22% within the full scale span (FSS). The following conclusions can be drawn from the above. Although the sensor is not able to display the merits of the high precision and a wide measuring range, it is able to satisfy the requirement of distance measurement in practical applications. Moreover, the most important advantage is that the proposed sensor is intrinsically safe.

Repeatability
In the experiment, the repeatability of the proposed sensor was also tested specially. Repeatability is the variation of measured value when a surveyor repeatedly measuring the identical characteristic on the same part using a specific measuring instrument. The relative error of repeatability is used for reliability evaluation of measurement sensor. For the proposed sensor, the relative error of repeatability can be expressed as: The following conclusions can be drawn from the above. Although the sensor is not able to display the merits of the high precision and a wide measuring range, it is able to satisfy the requirement of distance measurement in practical applications. Moreover, the most important advantage is that the proposed sensor is intrinsically safe.

Repeatability
In the experiment, the repeatability of the proposed sensor was also tested specially. Repeatability is the variation of measured value when a surveyor repeatedly measuring the identical characteristic on the same part using a specific measuring instrument. The relative error of repeatability is used for reliability evaluation of measurement sensor. For the proposed sensor, the relative error of repeatability can be expressed as: where E i is the relative error of repeatability of the sensor, L iMax is the maximum measured value of the i-th sample points, L iMin is the minimum measured value of the i-th sample points, and L i is the standard value of the i-th sample points. In the experiment, at each fixed target object distance, ten measurements are carried out repeatedly. It is observed that there is a small variation among the measurement results. After the measured data are processed, the relative error of repeatability of each sample point can be obtained and is shown in Figure 15, respectively. As shown in Figure 15, we have selected 15 sample points and carried out 100 measurements in the repeatability experiment. With the increase of the measured distance, in general, the relative error of repeatability of the sensor decreases gradually. The maximum repeatability error is 5 cm or 10.64% of actual value, when the actual value is 47 cm. The minimum repeatability error is 0 cm at several sample points. The relative error of repeatability at close range is seemingly relatively high, because the resolution of the proposed sensor is 5 cm. Moreover, it is necessary to mention that the maximum absolute error of repeatability is 5 cm in a long distance (from 30 cm to about 190 cm). In the range of 190 cm to 300 cm, the maximum absolute error of repeatability is 10 cm. Therefore, for such a wide measurement range, this repeatability of the proposed ranging sensor is excellent.

Short-Circuit Test
In order to verify the intrinsically safe feature of the proposed ranging sensor, we have carried out a short-circuit test. The output terminal of the energy limiting circuit is selected as the short-circuit point because the power source short circuit is the worst case. The test scheme is shown in Figure 16. As shown in Figure 15, we have selected 15 sample points and carried out 100 measurements in the repeatability experiment. With the increase of the measured distance, in general, the relative error of repeatability of the sensor decreases gradually. The maximum repeatability error is 5 cm or 10.64% of actual value, when the actual value is 47 cm. The minimum repeatability error is 0 cm at several sample points. The relative error of repeatability at close range is seemingly relatively high, because the resolution of the proposed sensor is 5 cm. Moreover, it is necessary to mention that the maximum absolute error of repeatability is 5 cm in a long distance (from 30 cm to about 190 cm). In the range of 190 cm to 300 cm, the maximum absolute error of repeatability is 10 cm. Therefore, for such a wide measurement range, this repeatability of the proposed ranging sensor is excellent.

Short-Circuit Test
In order to verify the intrinsically safe feature of the proposed ranging sensor, we have carried out a short-circuit test. The output terminal of the energy limiting circuit is selected as the short-circuit point because the power source short circuit is the worst case. The test scheme is shown in Figure 16.

Short-Circuit Test
In order to verify the intrinsically safe feature of the proposed ranging sensor, we have carried out a short-circuit test. The output terminal of the energy limiting circuit is selected as the short-circuit point because the power source short circuit is the worst case. The test scheme is shown in Figure 16. In Figure 16, the part indicated with red font is the schematic diagram of the short-circuit testing apparatus. K is a button switch. The sensor works normally when K is disconnected. However, the output terminal of the energy limiting circuit will be shortened when K is pressed down. The voltmeter and ammeter in testing apparatus are used to measure the voltage and current of the circuit. An oscilloscope is utilized to observe the state of voltage and current in the short-circuit process. The measured results are presented in Figure 17, respectively. In Figure 16, the part indicated with red font is the schematic diagram of the short-circuit testing apparatus. K is a button switch. The sensor works normally when K is disconnected. However, the output terminal of the energy limiting circuit will be shortened when K is pressed down. The voltmeter and ammeter in testing apparatus are used to measure the voltage and current of the circuit. An oscilloscope is utilized to observe the state of voltage and current in the short-circuit process. The measured results are presented in Figure 17, respectively. The transient responses of the short-circuit voltage and current are presented in Figure 17. As can be seen, the operating current was about 70 mA and the voltage was about 12 V under the normal state. At the time of 0 s, when the button switch S was pressed down, the measured voltage decreased to about 0 V within 0.4 μs. Furthermore, the current of sensor system surged to 1.5 A within 0.4 μs, and then reduced to 0 A quickly (within 35 μs). Consequently, the test proves that the proposed sensor system can be protected under short-circuit condition. In conclusion, the performance of the proposed intrinsically safe ultrasonic ranging sensor is summarized in Table 3.  The transient responses of the short-circuit voltage and current are presented in Figure 17. As can be seen, the operating current was about 70 mA and the voltage was about 12 V under the normal state. At the time of 0 s, when the button switch S was pressed down, the measured voltage decreased to about 0 V within 0.4 µs. Furthermore, the current of sensor system surged to 1.5 A within 0.4 µs, and then reduced to 0 A quickly (within 35 µs). Consequently, the test proves that the proposed sensor system can be protected under short-circuit condition. In conclusion, the performance of the proposed intrinsically safe ultrasonic ranging sensor is summarized in Table 3.

Conclusions
In this paper, an intrinsically safe ultrasonic ranging sensor was successfully designed and demonstrated according to the design requirements of intrinsically safe equipment. The design of the proposed sensor was a comprehensive work of digital circuit design, analog circuit design, and software compilation. The hardware and software of the sensor are developed, with which an intrinsically safe ultrasonic ranging sensor is fabricated. Additionally, as the key energy circuit of sensor, the driving circuit of the transducer is the mainly research object. The analysis of the existing driving circuits of transducers showed with a conventional driving circuit it is difficult to meet the intrinsic safety requirements due to the existence of a large energy storage inductor. Finally, a novel driving circuit approach based on a high-speed opto-coupler was designed. Moreover, its intrinsically safe characteristics were analyzed through detailed derivation and calculation. The calculation results show that the circuit is intrinsically safe. In order to improve the reliability of the sensor system, the energy limiting circuit is designed to provide dual over-voltage and over-current protection for the whole sensor so that the circuit will be protected immediately if the current or voltage exceed a critical value. Through the verification experiments in three aspects: over-voltage, over-current and short-circuit, the critical voltage and critical current are 12.45 V and 0.101 A respectively, and the short-circuit response time is 0.4 µs.
Compared to the traditional ultrasonic ranging sensor, it can be concluded from the experiments that the proposed ultrasonic ranging sensor has good performance and function, and it has an innovative intrinsically safe design. Therefore the proposed sensor is suitable for distance measurements and can be applied in complex hazardous environments such as coal mines, chemical, oil, gas plants and other circumstances. Accordingly, this proposed sensor extends the application of ultrasonic ranging sensors and provides a high security level with easy implementation. An improved version will be further developed to provide simpler circuits, better accuracy, and a smaller blind area.