{"id":69,"date":"2021-05-22T20:54:06","date_gmt":"2021-05-22T15:24:06","guid":{"rendered":"https:\/\/pravysoft.org\/blog\/?p=69"},"modified":"2021-05-22T20:54:06","modified_gmt":"2021-05-22T15:24:06","slug":"ultrasonic-sensor","status":"publish","type":"post","link":"https:\/\/pravysoft.org\/eduserver\/ultrasonic-sensor\/","title":{"rendered":"Ultrasonic sensor"},"content":{"rendered":"<p>The ultrasonic sensor works on the same principles as a radar system. An ultrasonic sensor can convert electrical energy into acoustic waves and vice versa. The acoustic signal is an ultrasonic wave moving at a frequency above 18kHz. The famous HC SR04 ultrasonic sensor generates ultrasonic waves at a frequency of 40kHz.<br \/>\n<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-medium wp-image-70\" src=\"https:\/\/pravysoft.org\/blog\/wp-content\/uploads\/2021\/05\/hcsr04-300x179.png\" alt=\"\" width=\"300\" height=\"179\" \/><\/p>\n<p>In general, a microcontroller is used to communicate with an ultrasonic sensor. To start measuring the distance, the microcontroller sends a trigger signal to the ultrasonic sensor. The duty cycle of this trigger signal is 10\u00b5S for the HC-SR04 ultrasonic sensor. When triggered, the ultrasonic sensor generates eight bursts of acoustic waves (ultrasonic) and triggers a time counter. As soon as the reflected signal (echo) is received, the counter stops. The output of the ultrasonic sensor is a high pulse of the same duration as the time difference between the transmitted ultrasonic bursts and the received echo signal.<\/p>\n<figure id=\"attachment_71\" aria-describedby=\"caption-attachment-71\" style=\"width: 437px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\" wp-image-71\" src=\"https:\/\/pravysoft.org\/blog\/wp-content\/uploads\/2021\/05\/hcsr04-1-300x187.png\" alt=\"Representation of trigger signal, acoustic bursts, reflected signal and output of echo pin\" width=\"437\" height=\"272\" \/><figcaption id=\"caption-attachment-71\" class=\"wp-caption-text\">Representation of trigger signal, acoustic bursts, reflected signal and output of echo pin<\/figcaption><\/figure>\n<p>The microcontroller interprets the time signal into distance using the following functions:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-72\" src=\"https:\/\/pravysoft.org\/blog\/wp-content\/uploads\/2021\/05\/hcsr04-2-300x108.png\" alt=\"\" width=\"328\" height=\"118\" \/><\/p>\n<p>Theoretically, the distance can be calculated using the TRD (time\/rate\/distance) measurement formula. Since the calculated distance is the distance travelled between the ultrasonic transducer and the object &#8211; and vice versa &#8211; it is a two-way trip. By dividing this distance by 2, you can determine the actual distance between the transducer and the object. Ultrasonic waves travel at the speed of sound (343 m\/s at 20\u00b0C).<\/p>\n<p>The distance between the object and the transducer is equal to half the distance travelled by the sound wave.<\/p>\n<p>The following equation can be used to calculate the distance of an object placed in front of an ultrasonic sensor:<br \/>\n<strong>distance=(travel time*speed of sound)\/2<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ultrasonic sensor works on the same principles as a radar system&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":70,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[293,297],"tags":[303,304,305,306],"class_list":["post-69","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-education","category-electronics","tag-hcsr04","tag-sensor","tag-ultrasonic","tag-working"],"_links":{"self":[{"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/posts\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":0,"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/posts\/70"}],"wp:attachment":[{"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pravysoft.org\/eduserver\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}