Introduction to Ultrasonic Transducer Driver Circuit
Introduction to Ultrasonic Transducer Driver Circuit

Introduction to Ultrasonic Transducer Driver Circuit

Distance Measurement with Ultrasonic Sensors

Ultrasonics sensor has a crystal which can resonates with 40kHz signal. To drive the ultrasonic sensor, we should generate 40kHz square wave with 50% duty cycle. Fundamental logic behind measuring the distance with ultrasonic sensor using 40kHz PWM signal is phase shift between trigger and echo signals of transducers. Then, the phase shift will be up to 40 kHz at most. Let’s calculate the distance we can measure for the ultrasonic sensor triggered by a 40kHz continuous PWM signal.

The sound of speed in air is about 343 m/s. For 40kHz PWM signal, the period of it is 25 microseconds.

\[distance = 25 \cdot 10^{-6} \cdot 343\] \[distance = 8.575 \cdot 10^{-3}\]
Generating PWM Signals
SG3525 – 40kHz PWM with 50% Duty Cycle

It is easy to see the distance is pretty low to measure distance or scan any part of room. So, we should modulate the 40kHz PWM signal with a specific frequency and a duty cycle. We can easily generate 40kHz PWM signal with SG3525 integrated circuit. Here is the circuit diagram:

SG3525 40kHz PWM Circuit
Figure 1 – SG3525 40kHz PWM Signal with 50% Duty Cycle

For more detail, you can read the datasheet of SG3525 from here.

\[f = \frac{1}{C_T(0.7R_T+3R_D)}\]

To drive an ultrasonic sensor there is no need a dead-zone. So, R_D equal to zero. Then formula turns into:

\[f = \frac{1}{0.7\times C_T \times R_T}\]

Key point of the SG3525 IC is frequency stands for frequency of oscillator. Therefore, if 40kHz PWM signal desired, calculations must be done with 80kHz oscillator frequency. For more detailed information you can examine the Block Diagram (p.2) on datasheet. We can analyse the SG3525 PWM circuit with Proteus, LTSpice or any other analysis software. Here is the simulation of LTSpice:

LTSpice SG3525 Simulation Schematic
Figure 2 – LTSpice SG3525 Simulation Schematic
LTSpice SG3525 Simulation Result
Figure 3 – LTSpice SG3525 Simulation Result
NE555 Timer – 240Hz PWM with 95% Duty Cycle

To trigger the ultrasonic transmitter, we should generate 40kHz PWM signal and generate 240Hz carrier square wave with 5% duty cycle. I built the circuit of 40kHz PWM signal above. Now, it is time to build 240kHz carrier square wave with 555 timer ic.

First of all, values of R1, R2 and C_t should be calculated. NE555 timer integrated circuit will be used in astable mode. The frequency formula is:

\[f = \frac{1}{T}\] \[f = \frac{1.44}{(R_1+2 R_2)C}\]
\[T_1 = 0.694(R_1 + R_2)C\] \[T_0 = 0.694R_2C\] \[Duty Cycle = \frac{T_1}{T}\times100\]

An excel sheet will be suit well to calculate those values quickly and repeatedly. Increase C to increase the period and reduce the frequency. Increase R1 to increase High Time (T1) without affecting the Low Time (T0). Increase R2 to increase High Time (T1), increase Low Time (T0) and decrease Duty Cycle.

Figure 4– Microsoft Excel Sheet to Calculate Astable Mode 555 Component Values

The values of R1, R2 and Ct are determined as shown Figure 4.

LM555 Timer IC generates 280Hz PWM with 95% Duty Cycle
Figure 5 – Altium LM555 Timer Schematic

Let’s simulate the circuit that shown above and analyse the signal with a simulation tool. Here is the simulation schematic and results.

LTSpice NE555 Timer 240Hz with 95% Duty Cycle
Figure 6 – LTSpice NE555 Timer 240Hz with 95% Duty Cycle
NE555 Simulation Result
Figure 7 – NE555 Simulation Result

But there could be occur some problems in real life. Most common case is frequency could be disrupted from error rates of the resistor and the duty cycle could be disrupted from floating capacitance of breadboard. To analyse this kind of situations, after achieving successful results on simulation it is better to test the same circuit in real life. Here is the real-life experiment of SG3525 40kHz PWM with 50% duty cycle:

SG3525 Circuit
Figure 8 – SG3525 Circuit
SG3525 Output
Figure 9 – SG3525 Output

Let’s realize the circuit to generate 240Hz square wave with 95% duty cycle. Here is the real-life experiment and results:

NE555 Circuit
Figure 10 – NE555 Circuit
NE555 Output
Figure 11 – NE555 Output
Signal Inverter

Generate PWM with 95% duty cycle is easier than generating with 5% duty cycle. So, I preferred to generate the carrier signal with 95%. But we need to invert the signal. But how? Of course with using a BJT. Common-Emitter topology could be used as shown below:

Signal inverter circuit with a npn BJT
Figure 12 – Common-Emitter Topology Signal Inverter Circuit

Common-Emitter topology offers:

  • High current gain,
  • Medium input resistance
  • High output resistance.

Also, common-emitter topology inverts the output signal. Now, it is time to simulate.

Signal Inverter Circuit
Figure 13 – Signal Inverter Circuit
Amplitude Modulation

This circuit could be used but we will not use. I prefer to use emitter-follower topology for AM (Amplitude Modulation). I will not build the circuit that we need in this post. But I will examine the HC-SR04 module’s trigger pin as preliminary information.

With these three circuits, we get the carrier signal with 5% duty cycle. Now, it’s time to examine the HC-SR04 module to be ensure about we are on the right path.

Figure 14 – HC-SR04 Trigger Pin Signal Examination
Figure 15 – HC-SR04 Trigger Pin Evaluation of Duty Cycle, Frequency and Period

We can easily see the same thing from the images above. There are 8 40kHz PWM signals enveloped with 5% duty cycled 238 Hz carrier wave. In this position, we have 40kHz signal, 240Hz signal with 95% and 5% duty cycle. In a next post, I will examine the Amplitude Modulation to achieve desired results to drive an ultrasonic transmitter.

Leave a Reply

Your email address will not be published. Required fields are marked *