{"id":156,"date":"2022-06-03T09:04:00","date_gmt":"2022-06-03T09:04:00","guid":{"rendered":"https:\/\/vegaprocessors.in\/blog\/?p=156"},"modified":"2022-10-12T10:34:36","modified_gmt":"2022-10-12T10:34:36","slug":"pir-motion-sensor-with-vega-processors","status":"publish","type":"post","link":"https:\/\/vegaprocessors.in\/blog\/pir-motion-sensor-with-vega-processors\/","title":{"rendered":"PIR Motion Sensor with ARIES V2 Board"},"content":{"rendered":"\n<p>In this tutorial, we will see how we can interface <strong>HC-SR501 PIR motion sensor<\/strong> with ARIES V2 board. Passive Infrared (PIR) Sensors are small, inexpensive low power sensors used to sense motion. They detect whenever an object moves out of the sensor\u2019s range. They are made of <strong>pyro-electric sensor<\/strong> which can detect levels of infrared radiations by converting change in temperature caused by radiations to electric signals. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>HC-SR501 PIR Sensor<\/strong><\/h2>\n\n\n\n<p>Every objects emits some level of radiations (living or non living). The sensor in PIR consists of two IR Sensitive Slots. When sensor is in idle state, the slots sense same amount of radiation. When there is a movement in the sensors range, there is difference in the amount of radiations between two slots. Based on these differential output, motion is detected.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/pir-sensor-module-1-800x800-1.jpg\" alt=\"\" class=\"wp-image-157\" width=\"324\" height=\"324\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/pir-sensor-module-1-800x800-1.jpg 800w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/pir-sensor-module-1-800x800-1-300x300.jpg 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/pir-sensor-module-1-800x800-1-150x150.jpg 150w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/pir-sensor-module-1-800x800-1-768x768.jpg 768w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Circuit Diagram<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/10\/PIR_SENSOR_01-1-1024x768.webp\" alt=\"\" class=\"wp-image-2155\" height=\"576\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/10\/PIR_SENSOR_01-1-1024x768.webp 1024w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/10\/PIR_SENSOR_01-1-300x225.webp 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/10\/PIR_SENSOR_01-1-768x576.webp 768w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/10\/PIR_SENSOR_01-1-1536x1152.webp 1536w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/10\/PIR_SENSOR_01-1-2048x1536.webp 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The<strong> HC-SR501<\/strong> has three pins: VCC, Digital Out and GND. Connect VCC and GND to +5V and GND respectively (Refer <a href=\"https:\/\/datasheetspdf.com\/pdf-file\/775434\/ETC\/HC-SR501\/1\">HC-SR 501 datasheet<\/a>). Then connect the Digital Out Pin of the PIR sensor to the GPIO0 of ARIES v2 board.<\/p>\n\n\n\n<p>Now, for powering up the ARIES v2 board via USB port of a Laptop\/Desktop\/PC and burning the code into the ARIES v2 board, we have to use a micro USB type B to USB type A cable. The cable should be connected to <strong>UART0<\/strong> port of the ARIES v2 board, and the Laptop\/Desktop\/PC should be preinstalled with VEGA SDK and Toolchain.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-white-background-color has-background\"><tbody><tr><td><strong>HC-SR501<\/strong> <\/td><td><strong>ARIES V2 board<\/strong><\/td><\/tr><tr><td>VCC<\/td><td>+3.3V<\/td><\/tr><tr><td>OUT<\/td><td>GPIO0<\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><\/tbody><\/table><figcaption><strong><em>Connection pins of HC-SR501 Module with Aries v2.0 Board<\/em><\/strong><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Procedure<\/h2>\n\n\n\n<p>After setting up the toolchain and SDK path environments, clean the executable using <strong>make clean<\/strong> command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd examples\/gpio\/PIR_motion_sensor<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>make clean<\/code><\/pre>\n\n\n\n<p>Build the example program for PIR motion sensor by using <strong>make<\/strong> command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make <\/code><\/pre>\n\n\n\n<p>Before transferring the built program to board, ensure that you have connected the UART0 connector of the board to the PC.<\/p>\n\n\n\n<p>Open a new terminal, execute the following command <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo minicom aries<\/code><\/pre>\n\n\n\n<p>Now you can see the minicom terminal opened and the board UART terminal is ready.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"689\" data-id=\"593\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-5.png\" alt=\"\" class=\"wp-image-593\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-5.png 820w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-5-300x252.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-5-768x645.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>Use <strong>CTRL+A S<\/strong> to enter file sending menu and select <strong>xmodem<\/strong> by pressing <strong>Enter<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"143\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/Screenshot-from-2021-04-30-16-14-03.png\" alt=\"\" class=\"wp-image-230\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/Screenshot-from-2021-04-30-16-14-03.png 615w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/04\/Screenshot-from-2021-04-30-16-14-03-300x70.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p>In the next window, with <strong>Space bar<\/strong> select the <strong>pir_pgm.bin<\/strong> file to be transferred. By pressing <strong>Enter<\/strong>, transfer process starts.<\/p>\n\n\n\n<p>Wait until the process is completed. The screen should display how much data has been transferred.<\/p>\n\n\n\n<p>After completing transfer the Program will start to execute.<\/p>\n\n\n\n<p>&#8220;motion detected&#8221; is displayed in minicom UART terminal when movement is detected in the vicinity of the sensor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"819\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/pir-min-1.png\" alt=\"\" class=\"wp-image-599\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/pir-min-1.png 893w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/pir-min-1-300x275.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/pir-min-1-768x704.png 768w\" sizes=\"auto, (max-width: 893px) 100vw, 893px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\"><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will see how we can interface HC-SR501 PIR motion sensor with ARIES V2 board. Passive Infrared (PIR) Sensors are small, inexpensive low power sensors used to sense motion. They detect whenever an object moves out of the sensor\u2019s range. They are made of pyro-electric sensor which can detect levels of infrared [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,20,15,1],"tags":[75,76,68,79,26,31,78],"class_list":["post-156","post","type-post","status-publish","format-standard","hentry","category-application-development","category-general","category-getting-started","category-uncategorized","tag-aries-v2-board","tag-c-dac","tag-gpio","tag-hc-sr501","tag-thejas-64","tag-thejas32","tag-vegaprocessors"],"_links":{"self":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":31,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":2156,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/156\/revisions\/2156"}],"wp:attachment":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}