{"id":717,"date":"2024-06-22T15:41:25","date_gmt":"2024-06-22T15:41:25","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=717"},"modified":"2024-08-10T18:06:22","modified_gmt":"2024-08-10T18:06:22","slug":"pir-sensor","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=717","title":{"rendered":"PIR Sensor"},"content":{"rendered":"\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\" style=\"flex-basis:66.66%\">\n<p class=\"wp-block-paragraph\">The motion sensor can detect motion of an object. This motion sensor module uses the LH1778 passive infrared sensor and the BISS0001 IC to control how motion is detected. There are two variable register to control the sensitivity and time delay adjustment <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"88\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sw-res-1024x88.jpg\" alt=\"\" class=\"wp-image-720\" style=\"width:518px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sw-res-1024x88.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sw-res-300x26.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sw-res-768x66.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sw-res.jpg 1084w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There are two operating mode in the PIR sensor. They are the<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"42\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/L-mode-1024x42.jpg\" alt=\"\" class=\"wp-image-722\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/L-mode-1024x42.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/L-mode-300x12.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/L-mode-768x31.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/L-mode.jpg 1123w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"353\" height=\"317\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/PIR-sensor.jpg\" alt=\"\" class=\"wp-image-719\" style=\"width:244px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/PIR-sensor.jpg 353w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/PIR-sensor-300x269.jpg 300w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Low when IDLE(no motion detected). There is a problem in single mode that if any object comes again when output is high the sensor can\u2019t detected the next object. This can be overcome in Multi-trigger mode.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"348\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/mode-1024x348.jpg\" alt=\"\" class=\"wp-image-724\" style=\"width:800px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/mode-1024x348.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/mode-300x102.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/mode-768x261.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/mode.jpg 1372w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s turn on light when motion detect and stray high as long as the output high. The PIR motion sensor will works on single mode operation. The main program is very simple-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n\/*\n * Motion Sensor (Active High when motion detected)\n * Sensitivity Adjustment: 3m to 7m(CW--Increase CCW--Decrease)\n * Time Delay Adjustment : 1s-3min (CW--Increase CCW--Decrease)\n * LS Mode: Output High as time delay adj. after motion detected\n * HS Mode: Output High as time delay adj. after last motion detected\n * Author : sunny\n *\/ \n\n#include &lt;avr\/io.h&gt;\n#define PIR_SENSOR 0\n#define LOAD       1\nint main(void)\n{\n\tDDRA|=(1&lt;&lt;LOAD);        \/\/load to connect\n\tDDRA&amp;=~(1&lt;&lt;PIR_SENSOR); \/\/PIR sensor as input\n    while (1) \n    {\n\t\t(PINA&amp;(1&lt;&lt;PINA0))?(PORTA|=(1&lt;&lt;LOAD)):(PORTA&amp;=~(1&lt;&lt;LOAD));\n    }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\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\" style=\"flex-basis:33.33%\">\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 has-custom-font-size\" style=\"font-size:16px\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/4.-motion-Sensor.rar\" style=\"border-radius:15px;padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--40)\">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\" style=\"flex-basis:66.66%\">\n<p class=\"wp-block-paragraph\" style=\"font-size:18px\"><strong><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/4.-motion-Sensor.rar\">Download the full program with proteus simulation<\/a><\/strong><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The motion sensor can detect motion of an object. This motion sensor module uses the LH1778 passive infrared sensor and the BISS0001 IC to control how motion is detected. There are two variable register to control the sensitivity and time delay adjustment There are two operating mode in the PIR sensor. They are the Low [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9],"tags":[],"class_list":["post-717","post","type-post","status-publish","format-standard","hentry","category-basic-phepharials","category-i-o-port-operations"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/717","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=717"}],"version-history":[{"count":6,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/717\/revisions"}],"predecessor-version":[{"id":2536,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/717\/revisions\/2536"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}