{"id":3043,"date":"2024-09-21T05:21:35","date_gmt":"2024-09-21T05:21:35","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=3043"},"modified":"2024-09-21T06:47:25","modified_gmt":"2024-09-21T06:47:25","slug":"pwm-small-radar","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=3043","title":{"rendered":"PWM : Small Radar"},"content":{"rendered":"\n<p class=\"has-text-color has-link-color wp-elements-d6d75aca48bf8bc90870a42f2132970e wp-block-paragraph\" style=\"color:#5c5c5c\">In this article we interface servo motor &amp; use ultrasonic sensor to detect small object. In our case the servo motor will rotate 45<sup>0<\/sup> in each step and ultrasonic sensor detects any object nearby. Before start first go through my <a href=\"https:\/\/iotthinghub.com\/?p=1771\" target=\"_blank\" rel=\"noreferrer noopener\">servo motor control<\/a> &amp; <a href=\"https:\/\/iotthinghub.com\/?p=1677\" target=\"_blank\" rel=\"noreferrer noopener\">ultrasonic sensor<\/a> article. In our basic timer part we learn about prescaler &amp; counter period (ARR). For servo motor we need 50Hz frequency signal. In this article we use system clock as 48MHz internal clock. For PWM the formula is-<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-5755e738ed1ea5c669fc708cbd87e0b6 wp-block-paragraph\" style=\"color:#252525\">\u00a0\u00a0\u00a0\u00a0 PWM frequency f<sub>PWM<\/sub> = f<sub>cpu<\/sub>\/((1+Prescaler)*(1+ARR)) <\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-7407798f90f19e2735b47a910798317d wp-block-paragraph\" style=\"color:#5c5c5c\">Let ARR=19999 then Prescaler will be 47. It will generate 20ms wave signal. Servo motor works on duty cycle. The CCRx register of timer determine the duty cycle. So if we went to generate .025% duty cycle, the CCRx register value will be (0.025*(1+ARR)-1) = (0.025*(1+19999)-1)=499. For every rotation the CCRx value will be-<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"295\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-8-1-1024x295.jpg\" alt=\"\" class=\"wp-image-3049\" style=\"width:795px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-8-1-1024x295.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-8-1-300x86.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-8-1-768x221.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-8-1.jpg 1475w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-fb988fc3cdd80a619c1ed17f5c55fd26 wp-block-paragraph\" style=\"color:#5c5c5c\">Here I use TIM1 Channel 1 as PWM timer PIN, so for each direction our desire value will be-<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"985\" height=\"210\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-9-1.jpg\" alt=\"\" class=\"wp-image-3051\" style=\"width:497px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-9-1.jpg 985w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-9-1-300x64.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-9-1-768x164.jpg 768w\" sizes=\"(max-width: 985px) 100vw, 985px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-6f825af5fa2d0b4d115ec46eb6d97409 wp-block-paragraph\" style=\"color:#5c5c5c\">Every 45<sup>0<\/sup> change cycle we need some delay function for the servo motor to change position. If we use HAL_delay function the system clock will halt and no farther execution. In our case we use system clock as delay function. In every direction we measure the distance using ultrasonic sensor. For interfacing ultrasonic sensor we need an EXIT pin &amp; GPIO pin. Since for our delay function we use system clock, in ultrasonic sensor Trigger pin we use system delay function as follow-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_9,GPIO_PIN_SET);\n  for(uint16_t i=0;i&lt;780;i++)\n  __ASM volatile (&quot;NOP&quot;);     \/\/F_CPU=48MHz and every cycle 0.020833us time \n  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_9,GPIO_PIN_RESET);\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-07f3218d250db168d5fb3c39d6de11b2 wp-block-paragraph\" style=\"color:#5c5c5c\">Here we use assembly language NOP (No Operation ) function for delay &amp; GPIOC Pin 9 as trig pin. When we trigger the trig pin of ultrasonic sensor, it send 8cycle ultrasonic burst. The ECHO pin will go high and remain high until an ultrasonic burst is detecting back. Since sound wave travels at 3.43m\/s, we need timer to calculate time. We use TIM17 for time count. Set prescaler value 47 &amp; counter period (ARR) 65535, so every pulse will be 1us. In our previous IR Decode principle we learn about pulse detection using EXIT. Initialize EXIT with rising\/falling edge detection. In rising pulse start the counter &amp; at falling edge stop the counter.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"204\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-10-1024x204.jpg\" alt=\"\" class=\"wp-image-3057\" style=\"width:723px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-10-1024x204.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-10-300x60.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-10-768x153.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/function-10.jpg 1348w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-226f0183c11e14b178b80f1053ba970d wp-block-paragraph\" style=\"color:#5c5c5c\">The pulse detection program as follow-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nextern TIM_HandleTypeDef htim17;\nif(flag)\n  {\n    pulse_width=TIM17 -&gt; CNT ;\n    pulse_width=pulse_width\/200; \/\/ since it reflect\n    distance=(3.43*pulse_width); \/\/ Distance in cm  \n    switch(direction)\n    {\n        case 1: sprintf(display_direction,&quot;West:%.2fcm   &quot;,distance);\n        OLCD_write_string(2,0,display_direction);\n        break;\n        case 2: sprintf(display_direction,&quot;SW:%.2fcm    &quot;,distance);\n        OLCD_write_string(2,0,display_direction);\n        break;\n        case 3: sprintf(display_direction,&quot;South:%.2fcm  &quot;,distance);\n        OLCD_write_string(2,0,display_direction);\n        break;\n        case 4: sprintf(display_direction,&quot;WE:%.2fcm   &quot;,distance);\n        OLCD_write_string(2,0,display_direction);\n        break;\n        case 0: sprintf(display_direction,&quot;East:%.2fcm   &quot;,distance);\n        OLCD_write_string(2,0,display_direction);\n        break;\n    }\n    TIM17-&gt;CNT=0;\n    flag=0;\n  }\nelse\n  {\n   HAL_TIM_Base_Start(&amp;htim17);\n   flag=1;\n   TIM17-&gt;CNT=0;\n  }\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-f0a6d5e23e3b534e83c76b5c7f9d6b5a wp-block-paragraph\" style=\"color:#5c5c5c\">Here we use I<sup>2<\/sup>C1 for 0.91&#8243; OLED for display. For controlling servo motor &amp; ultrasonic sensor trigger we use another timer in this case. In my case I use TIM16 for schedule servo motor &amp; ultrasonic sensor. Setting for TIM16 as prescaler 4799 &amp; Counter Period (ARR) 65535, so frequency of TIM16 is-<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-a2d4bf66d88b8c09f3e1b60b6d79828e wp-block-paragraph\" style=\"color:#252525\">         \u00a0Frequency of TIM16 f<sub>TIM16<\/sub> = 48MHz\/(1+4799) = 10kHz\u00a0\u00a0\u00a0 or T<sub>TIM16 <\/sub>= 0.1ms<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-ab7aeea8f6ce06500f5c5231380912af wp-block-paragraph\" style=\"color:#5c5c5c\">So that Timer Interrupt occurs at every T<sub>int <\/sub>= 0.1ms*65535 = 6.5535s. Enable global Interrupt for TIM16 &amp; in TIM16 interrupt service routine the coding as follow-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nswitch(direction)\n    {\n        case 0: TIM1-&gt;CCR1=499;      \/\/ West side\n\t    for(uint16_t j=0;j&lt;8000;j++)\n         for(uint16_t i=0;i&lt;4800;i++)   \/\/ .8s\n          __ASM volatile (&quot;NOP&quot;);   \/\/ F_CPU=48MHz and every cycle 0.020833us time \n        break;\n        case 1: TIM1-&gt;CCR1=999;     \/\/ South-West side\n        break;\n        case 2: TIM1-&gt;CCR1=1499;    \/\/ South side\n        break;\n        case 3: TIM1-&gt;CCR1=1999;    \/\/ South-East side\n        break;\n        case 4: TIM1-&gt;CCR1=2499;    \/\/ East side\n        break;\n    }\n\tfor(uint16_t j=0;j&lt;8000;j++)\n     for(uint16_t i=0;i&lt;480;i++)   \/\/ 80ms\n         __ASM volatile (&quot;NOP&quot;);   \/\/ F_CPU=48MHz and every cycle 0.020833us time \n  direction++;\n  if(direction&gt;=5) direction=0;    \n  \/******             Ultrasonic Sensor Function               ******************\/\n  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_9,GPIO_PIN_SET);\n  for(uint16_t i=0;i&lt;780;i++)\n  __ASM volatile (&quot;NOP&quot;);     \/\/F_CPU=48MHz and every cycle 0.020833us time \n  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_9,GPIO_PIN_RESET); \n  \/******************************************************************************\/\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-6ca4ce3354418b3a7fb29d723c2b310e wp-block-paragraph\" style=\"color:#5c5c5c\">Every 6.5535s the Timer 16 generates an interrupt and PWM frequency would change &amp; trig pin of ultrasonic sensor would activate. Here we use system clock as delay function. For every frequency change the servo motor need some time to reach destination. All coding has done in stm32f0xx_it.c file. In main program file is just initialization.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include &quot;ssd1306.h&quot;\nHAL_TIM_PWM_Start(&amp;htim1,TIM_CHANNEL_1); \/\/ PWM start for channel 1 TIM1\nHAL_TIM_Base_Start_IT(&amp;htim16); \/\/ Global interrupt for TIM16\ninit_OLED();\nclear_display();\nOLCD_write_string(0,0,&quot;Small Rader&quot;);\nwhile(1){\n}\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-b4833ba0ea3da5eed8fa6b7b807dc53c wp-block-paragraph\" style=\"color:#5c5c5c\">Some useful function of PWM-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nHAL_TIM_PWM_Start(TIM_HandleTypeDef *htim, uint32_t Channel);\nHAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);\nHAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);\nHAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);\nHAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData,uint16_t Length);\nHAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"STM32 Small Radar\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/T7j2bhy7Wxc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"340\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Rader-1024x340.jpg\" alt=\"\" class=\"wp-image-3069\" style=\"width:786px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Rader-1024x340.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Rader-300x100.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Rader-768x255.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Rader.jpg 1181w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-3e41869c wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Radar-STM32F0308.rar\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--50)\">download<\/a><\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-text-color has-link-color wp-elements-27ec0c04d1a5d5648947e22fd6b92005 wp-block-paragraph\" style=\"color:#252525;font-size:18px\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/Small-Radar-STM32F0308.rar\">Small Radar STM32F0308<\/a><\/p>\n<\/div>\n<\/div>\n\n\n<style type=\"text\/css\">\n#foogallery-gallery-3073 .fg-image { width: 200px; }<\/style>\n\t\t\t<div class=\"foogallery foogallery-container foogallery-carousel foogallery-lightbox-foogallery fg-carousel fg-ready fg-light fg-border-thin fg-shadow-outline fg-loading-default fg-loaded-fade-in fg-caption-hover fg-hover-fade fg-hover-zoom\" id=\"foogallery-gallery-3073\" data-foogallery=\"{&quot;item&quot;:{&quot;showCaptionTitle&quot;:true,&quot;showCaptionDescription&quot;:true},&quot;lazy&quot;:true,&quot;template&quot;:{&quot;maxItems&quot;:5,&quot;scale&quot;:0.11999999999999999555910790149937383830547332763671875,&quot;gutter&quot;:{&quot;min&quot;:-40,&quot;max&quot;:-20,&quot;unit&quot;:&quot;%&quot;},&quot;autoplay&quot;:{&quot;time&quot;:5,&quot;interaction&quot;:&quot;pause&quot;},&quot;centerOnClick&quot;:true,&quot;align&quot;:&quot;center&quot;,&quot;activePosition&quot;:&quot;center&quot;}}\" data-foogallery-lightbox=\"{&quot;thumbs&quot;:&quot;bottom&quot;,&quot;thumbsCaptions&quot;:false,&quot;thumbsBestFit&quot;:false,&quot;thumbsSmall&quot;:false,&quot;thumbsCaptionsAlign&quot;:&quot;default&quot;,&quot;info&quot;:&quot;bottom&quot;,&quot;infoVisible&quot;:true,&quot;infoOverlay&quot;:true,&quot;infoAlign&quot;:&quot;default&quot;,&quot;transition&quot;:&quot;fade&quot;,&quot;hoverButtons&quot;:false,&quot;fitMedia&quot;:false,&quot;noScrollbars&quot;:true,&quot;preserveButtonSpace&quot;:true,&quot;buttons&quot;:{&quot;fullscreen&quot;:true,&quot;info&quot;:true,&quot;thumbs&quot;:false},&quot;video&quot;:{&quot;autoPlay&quot;:true}}\" style=\"--fg-title-line-clamp: 0; --fg-description-line-clamp: 0;\" >\n\t<button type=\"button\" class=\"fg-carousel-prev\" title=\"Previous\"><\/button>\n\t<div class=\"fg-carousel-inner\">\n\t\t<div class=\"fg-carousel-center\"><\/div>\n\t\t<div class=\"fg-item fg-type-image fg-idle\"><figure class=\"fg-item-inner\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/setting-1.jpg\" data-attachment-id=\"3074\" data-type=\"image\" class=\"fg-thumb\"><span class=\"fg-image-wrap\"><img decoding=\"async\" width=\"200\" height=\"200\" class=\"skip-lazy fg-image\" data-src-fg=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/cache\/2024\/09\/setting-1\/2807009329.jpg\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3C%2Fsvg%3E\" loading=\"eager\"><\/span><span class=\"fg-image-overlay\"><\/span><\/a><\/figure><div class=\"fg-loader\"><\/div><\/div><div class=\"fg-item fg-type-image fg-idle\"><figure class=\"fg-item-inner\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/setting-2.jpg\" data-attachment-id=\"3075\" data-type=\"image\" class=\"fg-thumb\"><span class=\"fg-image-wrap\"><img decoding=\"async\" width=\"200\" height=\"200\" class=\"skip-lazy fg-image\" data-src-fg=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/cache\/2024\/09\/setting-2\/1024926975.jpg\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3C%2Fsvg%3E\" loading=\"eager\"><\/span><span class=\"fg-image-overlay\"><\/span><\/a><\/figure><div class=\"fg-loader\"><\/div><\/div><div class=\"fg-item fg-type-image fg-idle\"><figure class=\"fg-item-inner\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/setting-3.jpg\" data-attachment-id=\"3076\" data-type=\"image\" class=\"fg-thumb\"><span class=\"fg-image-wrap\"><img decoding=\"async\" width=\"200\" height=\"200\" class=\"skip-lazy fg-image\" data-src-fg=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/cache\/2024\/09\/setting-3\/1702535066.jpg\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3C%2Fsvg%3E\" loading=\"eager\"><\/span><span class=\"fg-image-overlay\"><\/span><\/a><\/figure><div class=\"fg-loader\"><\/div><\/div><div class=\"fg-item fg-type-image fg-idle\"><figure class=\"fg-item-inner\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/setting-4.jpg\" data-attachment-id=\"3077\" data-type=\"image\" class=\"fg-thumb\"><span class=\"fg-image-wrap\"><img decoding=\"async\" width=\"200\" height=\"200\" class=\"skip-lazy fg-image\" data-src-fg=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/cache\/2024\/09\/setting-4\/2865889813.jpg\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3C%2Fsvg%3E\" loading=\"eager\"><\/span><span class=\"fg-image-overlay\"><\/span><\/a><\/figure><div class=\"fg-loader\"><\/div><\/div><div class=\"fg-item fg-type-image fg-idle\"><figure class=\"fg-item-inner\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/setting-5.jpg\" data-attachment-id=\"3078\" data-type=\"image\" class=\"fg-thumb\"><span class=\"fg-image-wrap\"><img decoding=\"async\" width=\"200\" height=\"200\" class=\"skip-lazy fg-image\" data-src-fg=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/cache\/2024\/09\/setting-5\/3425852511.jpg\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3C%2Fsvg%3E\" loading=\"eager\"><\/span><span class=\"fg-image-overlay\"><\/span><\/a><\/figure><div class=\"fg-loader\"><\/div><\/div><div class=\"fg-item fg-type-image fg-idle\"><figure class=\"fg-item-inner\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/09\/setting-6.jpg\" data-attachment-id=\"3079\" data-type=\"image\" class=\"fg-thumb\"><span class=\"fg-image-wrap\"><img decoding=\"async\" width=\"200\" height=\"200\" class=\"skip-lazy fg-image\" data-src-fg=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/cache\/2024\/09\/setting-6\/2278608682.jpg\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3C%2Fsvg%3E\" loading=\"eager\"><\/span><span class=\"fg-image-overlay\"><\/span><\/a><\/figure><div class=\"fg-loader\"><\/div><\/div>\t<\/div>\n\t<div class=\"fg-carousel-bottom\"><\/div>\n\t<div class=\"fg-carousel-progress\"><\/div>\n\t<button type=\"button\" class=\"fg-carousel-next\" title=\"Next\"><\/button>\n<\/div>\n\n\n\n<p class=\"has-text-align-center has-text-color has-link-color has-medium-font-size wp-elements-586aeba09fc4477bbcc445936c23210a wp-block-paragraph\" style=\"color:#252525\">All Parameter Setting<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we interface servo motor &amp; use ultrasonic sensor to detect small object. In our case the servo motor will rotate 450 in each step and ultrasonic sensor detects any object nearby. Before start first go through my servo motor control &amp; ultrasonic sensor article. In our basic timer part we learn about [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-3043","post","type-post","status-publish","format-standard","hentry","category-stm-arm-tutorials"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3043"}],"version-history":[{"count":16,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3043\/revisions"}],"predecessor-version":[{"id":3081,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3043\/revisions\/3081"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}