{"id":67,"date":"2024-02-11T15:35:36","date_gmt":"2024-02-11T15:35:36","guid":{"rendered":"https:\/\/blog.kkaragoz.com\/?p=67"},"modified":"2024-02-15T13:07:20","modified_gmt":"2024-02-15T13:07:20","slug":"how-ultrasonic-transmitter-works","status":"publish","type":"post","link":"https:\/\/blog.kkaragoz.com\/index.php\/2024\/02\/11\/how-ultrasonic-transmitter-works\/","title":{"rendered":"Introduction to Ultrasonic Transducer Driver Circuit"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\">Distance Measurement with Ultrasonic Sensors<\/h5>\n\n\n\n<p>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&#8217;s calculate the distance we can measure for the ultrasonic sensor triggered by a 40kHz continuous PWM signal.<\/p>\n\n\n\n<p>The sound of speed in air is about 343 m\/s. For 40kHz PWM signal, the period of it is 25 microseconds. <\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\"><\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\[distance = 25 \\cdot 10^{-6} \\cdot 343\\]\n\\[distance = 8.575 \\cdot 10^{-3}\\]<script src=\"https:\/\/blog.kkaragoz.com\/wp-includes\/js\/dist\/hooks.min.js?ver=dd5603f07f9220ed27f1\" id=\"wp-hooks-js\"><\/script>\n<script src=\"https:\/\/blog.kkaragoz.com\/wp-includes\/js\/dist\/i18n.min.js?ver=c26c3dc7bed366793375\" id=\"wp-i18n-js\"><\/script>\n<script id=\"wp-i18n-js-after\">\nwp.i18n.setLocaleData( { 'text direction\\u0004ltr': [ 'ltr' ] } );\n\/\/# sourceURL=wp-i18n-js-after\n<\/script>\n<script  async src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/mathjax\/2.7.7\/MathJax.js?config=TeX-MML-AM_CHTML\" id=\"mathjax-js\"><\/script>\n<\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Generating PWM Signals<\/h5>\n\n\n\n<h6 class=\"wp-block-heading\">SG3525 &#8211; 40kHz PWM with 50% Duty Cycle<\/h6>\n\n\n\n<p>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:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-174957-1024x572.png\" alt=\"SG3525 40kHz PWM Circuit\" class=\"wp-image-80\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-174957-1024x572.png 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-174957-300x168.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-174957-768x429.png 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-174957-421x235.png 421w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-174957.png 1106w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 1 <\/strong>&#8211; SG3525 40kHz PWM Signal with 50% Duty Cycle<\/figcaption><\/figure>\n\n\n\n<p>For more detail, you can read the datasheet of SG3525 from<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-2-color\"> <a href=\"https:\/\/pdf1.alldatasheet.com\/datasheet-pdf\/view\/556041\/STMICROELECTRONICS\/SG3525A.html\" data-type=\"link\" data-id=\"https:\/\/pdf1.alldatasheet.com\/datasheet-pdf\/view\/556041\/STMICROELECTRONICS\/SG3525A.html\">here<\/a>.<\/mark><\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\[f = \\frac{1}{C_T(0.7R_T+3R_D)}\\]<\/div>\n\n\n\n<p>To drive an ultrasonic sensor there is no need a dead-zone. So, R_D equal to zero. Then formula turns into:<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\[f = \\frac{1}{0.7\\times C_T \\times R_T}\\]<\/div>\n\n\n\n<p>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<a href=\"https:\/\/pdf1.alldatasheet.com\/datasheet-pdf\/view\/556041\/STMICROELECTRONICS\/SG3525A.html\"> Block Diagram (p.2) on datasheet.<\/a> We can analyse the SG3525 PWM circuit with Proteus, LTSpice or any other analysis software. Here is the simulation of LTSpice:<\/p>\n\n\n\n<div class=\"wp-block-columns are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"714\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144317.png\" alt=\"LTSpice SG3525 Simulation Schematic\" class=\"wp-image-105\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144317.png 727w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144317-300x295.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144317-305x300.png 305w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 2 <\/strong>&#8211; LTSpice SG3525 Simulation Schematic<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"863\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144444.png\" alt=\"LTSpice SG3525 Simulation Result\" class=\"wp-image-107\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144444.png 936w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144444-300x277.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144444-768x708.png 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-144444-325x300.png 325w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 3 <\/strong>&#8211; LTSpice SG3525 Simulation Result<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h6 class=\"wp-block-heading\">NE555 Timer &#8211; 240Hz PWM with 95% Duty Cycle<\/h6>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\[f = \\frac{1}{T}\\]\n\\[f = \\frac{1.44}{(R_1+2 R_2)C}\\]<\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\n<\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\[T_1 = 0.694(R_1 + R_2)C\\]\n\\[T_0 = 0.694R_2C\\]\n\\[Duty Cycle = \\frac{T_1}{T}\\times100\\]<\/div>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"316\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-150016.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-150016.png 643w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-150016-300x147.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-150016-421x207.png 421w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 4<\/strong>&#8211; Microsoft Excel Sheet to Calculate Astable Mode 555 Component Values<\/figcaption><\/figure>\n\n\n\n<p>The values of R1, R2 and Ct are determined as shown Figure 4.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"696\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-175514.png\" alt=\"LM555 Timer IC generates 280Hz PWM with 95% Duty Cycle\" class=\"wp-image-82\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-175514.png 823w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-175514-300x254.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-175514-768x649.png 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-175514-355x300.png 355w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 5<\/strong> &#8211; Altium LM555 Timer Schematic <\/figcaption><\/figure>\n\n\n\n<p>Let&#8217;s simulate the circuit that shown above and analyse the signal with a simulation tool. Here is the simulation schematic and results.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"617\" height=\"459\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145123.png\" alt=\"LTSpice NE555 Timer 240Hz with 95% Duty Cycle\" class=\"wp-image-108\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145123.png 617w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145123-300x223.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145123-403x300.png 403w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 6<\/strong> &#8211; LTSpice NE555 Timer 240Hz with 95% Duty Cycle<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"855\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145546.png\" alt=\"NE555 Simulation Result\" class=\"wp-image-109\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145546.png 944w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145546-300x272.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145546-768x696.png 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-15-145546-331x300.png 331w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 7<\/strong> &#8211; NE555 Simulation Result<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>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:<\/p>\n\n\n\n<div class=\"wp-block-columns alignwide is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit-1024x1024.jpg\" alt=\"SG3525 Circuit\" class=\"wp-image-121\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit-1024x1024.jpg 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit-300x300.jpg 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit-150x150.jpg 150w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit-768x768.jpg 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit-1536x1536.jpg 1536w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Circuit.jpg 1541w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 8<\/strong> &#8211; SG3525 Circuit<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"758\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Output-1024x758.jpg\" alt=\"SG3525 Output\" class=\"wp-image-124\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Output-1024x758.jpg 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Output-300x222.jpg 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Output-768x568.jpg 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Output-405x300.jpg 405w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/SG3525-Output.jpg 1261w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 9 <\/strong>&#8211; SG3525 Output<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>Let&#8217;s realize the circuit to generate 240Hz square wave with 95% duty cycle. Here is the real-life experiment and results:<\/p>\n\n\n\n<div class=\"wp-block-columns alignwide are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Circuit-768x1024.jpg\" alt=\"NE555 Circuit\" class=\"wp-image-122\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Circuit-768x1024.jpg 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Circuit-225x300.jpg 225w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Circuit-1152x1536.jpg 1152w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Circuit-rotated.jpg 1354w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 10<\/strong> &#8211; NE555 Circuit<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"765\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Output-1024x765.jpg\" alt=\"NE555 Output\" class=\"wp-image-125\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Output-1024x765.jpg 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Output-300x224.jpg 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Output-768x574.jpg 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Output-401x300.jpg 401w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/NE555-Output.jpg 1239w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 11<\/strong> &#8211; NE555 Output<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h6 class=\"wp-block-heading\">Signal Inverter<\/h6>\n\n\n\n<p>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: <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"644\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-180211.png\" alt=\"Signal inverter circuit with a npn BJT\" class=\"wp-image-85\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-180211.png 731w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-180211-300x264.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/Ekran-goruntusu-2024-02-11-180211-341x300.png 341w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 12 <\/strong>&#8211; Common-Emitter Topology Signal Inverter Circuit<\/figcaption><\/figure>\n\n\n\n<p>Common-Emitter topology offers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>High current gain, <\/li>\n\n\n\n<li>Medium input resistance <\/li>\n\n\n\n<li>High output resistance.<\/li>\n<\/ul>\n\n\n\n<p>Also, common-emitter topology inverts the output signal. Now, it is time to simulate.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/signal-inverter-circuit-1024x544.png\" alt=\"Signal Inverter Circuit\" class=\"wp-image-101\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/signal-inverter-circuit-1024x544.png 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/signal-inverter-circuit-300x159.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/signal-inverter-circuit-768x408.png 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/signal-inverter-circuit-421x223.png 421w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/02\/signal-inverter-circuit.png 1507w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 13<\/strong> &#8211; Signal Inverter Circuit<\/figcaption><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Amplitude Modulation<\/h5>\n\n\n\n<p>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&#8217;s trigger pin as preliminary information.<\/p>\n\n\n\n<p>With these three circuits, we get the carrier signal with 5% duty cycle. Now, it&#8217;s time to examine the HC-SR04 module to be ensure about we are on the right path. <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"383\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis-1024x383.png\" alt=\"\" class=\"wp-image-68\" style=\"width:920px;height:auto\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis-1024x383.png 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis-300x112.png 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis-768x287.png 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis-421x158.png 421w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis-800x300.png 800w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/ultrasonic_analysis.png 1315w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 14<\/strong> &#8211; HC-SR04 Trigger Pin Signal Examination<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"757\" src=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/period_calculation-1024x757.jpg\" alt=\"\" class=\"wp-image-70\" srcset=\"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/period_calculation-1024x757.jpg 1024w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/period_calculation-300x222.jpg 300w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/period_calculation-768x568.jpg 768w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/period_calculation-406x300.jpg 406w, https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2024\/01\/period_calculation.jpg 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Figure 15<\/strong> &#8211; HC-SR04 Trigger Pin Evaluation of Duty Cycle, Frequency and Period <\/figcaption><\/figure>\n\n\n\n<p>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.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>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, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":50,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-antenna"],"better_featured_image":{"id":50,"alt_text":"HC-SR04 front view","caption":"HC-SR04 front view","description":"HC-SR04 front view","media_type":"image","media_details":{"width":1280,"height":1280,"file":"2023\/12\/HC-SR04-Front-View.jpg","filesize":184658,"sizes":{"medium":{"file":"HC-SR04-Front-View-300x300.jpg","width":300,"height":300,"mime-type":"image\/jpeg","filesize":11644,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-300x300.jpg"},"large":{"file":"HC-SR04-Front-View-1024x1024.jpg","width":1024,"height":1024,"mime-type":"image\/jpeg","filesize":113605,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-1024x1024.jpg"},"thumbnail":{"file":"HC-SR04-Front-View-150x150.jpg","width":150,"height":150,"mime-type":"image\/jpeg","filesize":3802,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-150x150.jpg"},"medium_large":{"file":"HC-SR04-Front-View-768x768.jpg","width":768,"height":768,"mime-type":"image\/jpeg","filesize":65695,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-768x768.jpg"},"post-thumbnail":{"file":"HC-SR04-Front-View-300x300.jpg","width":300,"height":300,"mime-type":"image\/jpeg","filesize":11644,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-300x300.jpg"},"bravada-featured":{"file":"HC-SR04-Front-View-421x300.jpg","width":421,"height":300,"mime-type":"image\/jpeg","filesize":18535,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-421x300.jpg"},"bravada-featured-lp":{"file":"HC-SR04-Front-View-620x300.jpg","width":620,"height":300,"mime-type":"image\/jpeg","filesize":31018,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-620x300.jpg"},"bravada-featured-half":{"file":"HC-SR04-Front-View-800x300.jpg","width":800,"height":300,"mime-type":"image\/jpeg","filesize":42356,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-800x300.jpg"},"bravada-featured-third":{"file":"HC-SR04-Front-View-512x300.jpg","width":512,"height":300,"mime-type":"image\/jpeg","filesize":24093,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-512x300.jpg"},"bravada-lpbox-1":{"file":"HC-SR04-Front-View-310x250.jpg","width":310,"height":250,"mime-type":"image\/jpeg","filesize":11386,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-310x250.jpg"},"bravada-lpbox-2":{"file":"HC-SR04-Front-View-413x300.jpg","width":413,"height":300,"mime-type":"image\/jpeg","filesize":17985,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View-413x300.jpg"}},"image_meta":{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0","keywords":[]}},"post":null,"source_url":"https:\/\/blog.kkaragoz.com\/wp-content\/uploads\/2023\/12\/HC-SR04-Front-View.jpg"},"_links":{"self":[{"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":31,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/posts\/67\/revisions\/137"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/media\/50"}],"wp:attachment":[{"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kkaragoz.com\/index.php\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}