{"id":1018,"date":"2026-02-19T21:35:32","date_gmt":"2026-02-19T13:35:32","guid":{"rendered":"https:\/\/pirhome.com\/?p=1017"},"modified":"2026-02-19T21:35:32","modified_gmt":"2026-02-19T13:35:32","slug":"arduino-pir-not-triggering","status":"publish","type":"post","link":"https:\/\/www.pirhome.com\/?p=1018","title":{"rendered":"Arduino PIR Sensor Not Triggering? Code and Wiring Check"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>You&#8217;ve connected a PIR sensor to your Arduino, uploaded a sketch, but nothing happens when you wave your hand. Let&#8217;s systematically debug the issue.<\/p>\n<h2>1. Verify Hardware Connections<\/h2>\n<p>The most common mistake is incorrect wiring. For HC-SR501:<\/p>\n<ul>\n<li>VCC \u2192 5V (or 3.3V if sensor supports it)<\/li>\n<li>GND \u2192 GND<\/li>\n<li>OUT \u2192 any digital pin (e.g., pin 2)<\/li>\n<\/ul>\n<p>Double-check pin order\u2014some modules have VCC, OUT, GND; others have VCC, GND, OUT. Check the silkscreen labeling.<\/p>\n<h2>2. Power the Sensor Correctly<\/h2>\n<p>Measure voltage at the sensor&#8217;s VCC and GND pins. It should be within spec (4.5-20V for HC-SR501). If using a 3.3V Arduino, ensure the sensor can run at 3.3V (some can, some can&#8217;t).<\/p>\n<h2>3. Wait for Warm-Up<\/h2>\n<p>After power-up, the sensor needs 30-60 seconds to stabilize. During this time, it may trigger a few times, then settle. Don&#8217;t test immediately.<\/p>\n<h2>4. Test the Sensor Alone<\/h2>\n<p>Disconnect the sensor from Arduino. Power it with a 5V supply and connect an LED with a resistor between OUT and GND (anode to OUT, cathode to GND via resistor). Wave your hand; the LED should light. If not, sensor may be faulty.<\/p>\n<h2>5. Check Your Code<\/h2>\n<p>Here&#8217;s a minimal working example:<\/p>\n<pre><code>const int pirPin = 2;\nconst int ledPin = 13;\n\nvoid setup() {\n  pinMode(pirPin, INPUT);\n  pinMode(ledPin, OUTPUT);\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  int pirState = digitalRead(pirPin);\n  if (pirState == HIGH) {\n    digitalWrite(ledPin, HIGH);\n    Serial.println(\"Motion detected\");\n  } else {\n    digitalWrite(ledPin, LOW);\n  }\n  delay(100);\n}\n<\/code><\/pre>\n<p>Make sure your pin number matches the wiring.<\/p>\n<h2>6. Input Pull-up Confusion<\/h2>\n<p>Some tutorials suggest using <code>pinMode(pirPin, INPUT_PULLUP)<\/code>. Do <strong>not<\/strong> use internal pull-up for PIR sensors\u2014they have their own output stage. Use plain <code>INPUT<\/code>.<\/p>\n<h2>7. Signal Inversion<\/h2>\n<p>Some PIR sensors output LOW when motion is detected. If your sensor behaves opposite, swap HIGH\/LOW in code or check if your module has an active-low output.<\/p>\n<h2>8. Check with Serial Monitor<\/h2>\n<p>Add <code>Serial.println(digitalRead(pirPin));<\/code> to see the raw value. If it stays constant (0 or 1) regardless of motion, wiring or sensor is suspect.<\/p>\n<h2>9. Try a Different Pin<\/h2>\n<p>Some pins may be used for other functions. Move to another digital pin (e.g., pin 3) to rule out pin issues.<\/p>\n<h2>10. Still Not Working?<\/h2>\n<p>If all else fails, try a different sensor. It&#8217;s possible the sensor is DOA.<\/p>\n<h2>Conclusion<\/h2>\n<p>Most Arduino-PIR issues are wiring or warm-up related. Follow this checklist and you&#8217;ll likely find the culprit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction You&#8217;ve connected a PIR sensor to your Arduino, uploaded a sketch, but nothing happens when you wave your hand. Let&#8217;s systematically debug the issue. 1. Verify Hardware Connections The most common mistake is incorrect wiring. For HC-SR501: VCC \u2192 5V (or 3.3V if sensor supports it) GND \u2192 GND OUT \u2192 any digital pin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1018","post","type-post","status-publish","format-standard","hentry","category-troubleshooting"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>Arduino PIR Sensor Not Triggering? Code and Wiring Check - PIRHOME<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"http:\/\/www.pirhome.com\/?p=1018\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Arduino PIR Sensor Not Triggering? Code and Wiring Check - PIRHOME\" \/>\r\n<meta property=\"og:description\" content=\"Introduction You&#8217;ve connected a PIR sensor to your Arduino, uploaded a sketch, but nothing happens when you wave your hand. Let&#8217;s systematically debug the issue. 1. Verify Hardware Connections The most common mistake is incorrect wiring. For HC-SR501: VCC \u2192 5V (or 3.3V if sensor supports it) GND \u2192 GND OUT \u2192 any digital pin [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"http:\/\/www.pirhome.com\/?p=1018\" \/>\r\n<meta property=\"og:site_name\" content=\"PIRHOME\" \/>\r\n<meta property=\"article:published_time\" content=\"2026-02-19T13:35:32+00:00\" \/>\r\n<meta name=\"author\" content=\"nic@nicsky.com\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"nic@nicsky.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018\"},\"author\":{\"name\":\"nic@nicsky.com\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\"},\"headline\":\"Arduino PIR Sensor Not Triggering? Code and Wiring Check\",\"datePublished\":\"2026-02-19T13:35:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018\"},\"wordCount\":344,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"articleSection\":[\"Troubleshooting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=1018#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018\",\"name\":\"Arduino PIR Sensor Not Triggering? Code and Wiring Check - PIRHOME\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\"},\"datePublished\":\"2026-02-19T13:35:32+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=1018\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=1018#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.pirhome.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino PIR Sensor Not Triggering? Code and Wiring Check\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/\",\"name\":\"PIRHOME\",\"description\":\"PIR &amp; Motion Sensor\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/www.pirhome.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\",\"name\":\"PIRHOME\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pirhome.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pirhome.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg\",\"width\":512,\"height\":512,\"caption\":\"PIRHOME\"},\"image\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\",\"name\":\"nic@nicsky.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"caption\":\"nic@nicsky.com\"},\"sameAs\":[\"http:\\\/\\\/www.pirhome.com\"],\"url\":\"https:\\\/\\\/www.pirhome.com\\\/?author=1\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino PIR Sensor Not Triggering? Code and Wiring Check - PIRHOME","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.pirhome.com\/?p=1018","og_locale":"en_US","og_type":"article","og_title":"Arduino PIR Sensor Not Triggering? Code and Wiring Check - PIRHOME","og_description":"Introduction You&#8217;ve connected a PIR sensor to your Arduino, uploaded a sketch, but nothing happens when you wave your hand. Let&#8217;s systematically debug the issue. 1. Verify Hardware Connections The most common mistake is incorrect wiring. For HC-SR501: VCC \u2192 5V (or 3.3V if sensor supports it) GND \u2192 GND OUT \u2192 any digital pin [&hellip;]","og_url":"http:\/\/www.pirhome.com\/?p=1018","og_site_name":"PIRHOME","article_published_time":"2026-02-19T13:35:32+00:00","author":"nic@nicsky.com","twitter_card":"summary_large_image","twitter_misc":{"Written by":"nic@nicsky.com","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.pirhome.com\/?p=1018#article","isPartOf":{"@id":"http:\/\/www.pirhome.com\/?p=1018"},"author":{"name":"nic@nicsky.com","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3"},"headline":"Arduino PIR Sensor Not Triggering? Code and Wiring Check","datePublished":"2026-02-19T13:35:32+00:00","mainEntityOfPage":{"@id":"http:\/\/www.pirhome.com\/?p=1018"},"wordCount":344,"commentCount":0,"publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"articleSection":["Troubleshooting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.pirhome.com\/?p=1018#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.pirhome.com\/?p=1018","url":"http:\/\/www.pirhome.com\/?p=1018","name":"Arduino PIR Sensor Not Triggering? Code and Wiring Check - PIRHOME","isPartOf":{"@id":"http:\/\/www.pirhome.com\/#website"},"datePublished":"2026-02-19T13:35:32+00:00","breadcrumb":{"@id":"http:\/\/www.pirhome.com\/?p=1018#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.pirhome.com\/?p=1018"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.pirhome.com\/?p=1018#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.pirhome.com\/"},{"@type":"ListItem","position":2,"name":"Arduino PIR Sensor Not Triggering? Code and Wiring Check"}]},{"@type":"WebSite","@id":"http:\/\/www.pirhome.com\/#website","url":"http:\/\/www.pirhome.com\/","name":"PIRHOME","description":"PIR &amp; Motion Sensor","publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.pirhome.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/www.pirhome.com\/#organization","name":"PIRHOME","url":"http:\/\/www.pirhome.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.pirhome.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pirhome.com\/wp-content\/uploads\/2026\/02\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg","contentUrl":"https:\/\/www.pirhome.com\/wp-content\/uploads\/2026\/02\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg","width":512,"height":512,"caption":"PIRHOME"},"image":{"@id":"http:\/\/www.pirhome.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3","name":"nic@nicsky.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","caption":"nic@nicsky.com"},"sameAs":["http:\/\/www.pirhome.com"],"url":"https:\/\/www.pirhome.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/1018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1018"}],"version-history":[{"count":1,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/1018\/revisions"}],"predecessor-version":[{"id":3036,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/1018\/revisions\/3036"}],"wp:attachment":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}