{"id":4144,"date":"2026-05-18T09:00:00","date_gmt":"2026-05-18T09:00:00","guid":{"rendered":"https:\/\/pirhome.com\/?p=3929"},"modified":"2026-05-18T09:00:00","modified_gmt":"2026-05-18T09:00:00","slug":"pir-solar-pathway-lighting-2","status":"publish","type":"post","link":"https:\/\/www.pirhome.com\/?p=4144","title":{"rendered":"PIR Sensor for Solar Pathway Lighting"},"content":{"rendered":"<h2>Project Overview<\/h2>\n<p>This project creates solar-powered pathway lights that automatically turn on when someone walks by. The system uses a PIR sensor to detect motion and turns on LED strips for a set duration. Solar charging keeps the battery topped up during the day.<\/p>\n<p><strong>Difficulty:<\/strong> Intermediate<br \/>\n<strong>Estimated time:<\/strong> 2-3 hours<br \/>\n<strong>Estimated cost:<\/strong> $30-45<\/p>\n<h2>How It Works<\/h2>\n<p>A solar panel charges a lithium battery during the day. A PIR sensor mounted on the pathway detects approaching pedestrians. When motion is detected, the system turns on LED lights for 30-60 seconds. A light sensor can be added to ensure lights only activate at night.<\/p>\n<h2>Materials Needed<\/h2>\n<ul>\n<li>ESP32 or ATtiny85 (1)<\/li>\n<li>HC-SR501 PIR sensor (1)<\/li>\n<li>Solar panel (5V, 5-10W)<\/li>\n<li>18650 lithium battery (1-2)<\/li>\n<li>TP4056 charging module<\/li>\n<li>Boost converter to 5V<\/li>\n<li>LED strip (12V or 5V)<\/li>\n<li>MOSFET or relay for switching<\/li>\n<li>LDR photoresistor optional<\/li>\n<li>Waterproof enclosure<\/li>\n<\/ul>\n<h2>Circuit Diagram<\/h2>\n<h3>Power Section<\/h3>\n<pre>\nSolar Panel (+) --- TP4056 IN+ --- 18650 Battery (+)\nSolar Panel (-) --- TP4056 IN- --- 18650 Battery (-)\nBattery (+) --- Boost Converter (3.7V \u2192 5V) --- ESP32 VIN\n<\/pre>\n<h2>Arduino Code (ATtiny85 &#8211; Ultra Low Power)<\/h2>\n<pre><code>\/\/ Solar Pathway Lighting with ATtiny85\n#include &lt;avr\/sleep.h&gt;\n\nconst int pirPin = 0;\nconst int ledPin = 1;\nconst int ldrPin = 2;\n\nunsigned long lastTrigger = 0;\nconst unsigned long lightDuration = 30000;\n\nvoid setup() {\n  pinMode(pirPin, INPUT);\n  pinMode(ledPin, OUTPUT);\n  pinMode(ldrPin, INPUT);\n  digitalWrite(ledPin, LOW);\n  delay(30000);\n}\n\nbool isDark() {\n  return analogRead(ldrPin) < 500;\n}\n\nvoid goToSleep() {\n  set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n  sleep_enable();\n  sleep_cpu();\n  sleep_disable();\n}\n\nvoid loop() {\n  bool motion = digitalRead(pirPin) == HIGH;\n  bool dark = isDark();\n  \n  if (motion &#038;&#038; dark) {\n    digitalWrite(ledPin, HIGH);\n    lastTrigger = millis();\n  }\n  \n  if (digitalRead(ledPin) == HIGH &#038;&#038; (millis() - lastTrigger > lightDuration)) {\n    digitalWrite(ledPin, LOW);\n  }\n  \n  if (!motion && !digitalRead(ledPin)) {\n    attachInterrupt(0, wakeUp, RISING);\n    goToSleep();\n    detachInterrupt(0);\n  }\n  \n  delay(100);\n}\n\nvoid wakeUp() {}\n<\/code><\/pre>\n<h2>Installation Steps<\/h2>\n<ol>\n<li>Assemble power system with solar panel and battery<\/li>\n<li>Test charging in sun to verify voltage increases<\/li>\n<li>Mount PIR sensor at 1m height along pathway<\/li>\n<li>Install LED strips along pathway edges<\/li>\n<li>Enclose electronics in waterproof enclosure with solar panel on top<\/li>\n<li>Walk along pathway at night to test lights<\/li>\n<\/ol>\n<h2>Project Extensions<\/h2>\n<ul>\n<li>Use RGB LEDs that change color based on battery level<\/li>\n<li>Add second PIR for direction detection<\/li>\n<li>Add LoRa to report battery level and events<\/li>\n<li>Connect to Home Assistant via MQTT<\/li>\n<li>Add microphone for sound-reactive lighting<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>These solar-powered pathway lights add safety and beauty to your walkway without increasing your electric bill.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Project Overview This project creates solar-powered pathway lights that automatically turn on when someone walks by. The system uses a PIR sensor to detect motion and turns on LED strips for a set duration. Solar charging keeps the battery topped up during the day. Difficulty: Intermediate Estimated time: 2-3 hours Estimated cost: $30-45 How It [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4144","post","type-post","status-publish","format-standard","hentry","category-projects"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>PIR Sensor for Solar Pathway Lighting - 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=\"https:\/\/www.pirhome.com\/?p=4144\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"PIR Sensor for Solar Pathway Lighting - PIRHOME\" \/>\r\n<meta property=\"og:description\" content=\"Project Overview This project creates solar-powered pathway lights that automatically turn on when someone walks by. The system uses a PIR sensor to detect motion and turns on LED strips for a set duration. Solar charging keeps the battery topped up during the day. Difficulty: Intermediate Estimated time: 2-3 hours Estimated cost: $30-45 How It [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/www.pirhome.com\/?p=4144\" \/>\r\n<meta property=\"og:site_name\" content=\"PIRHOME\" \/>\r\n<meta property=\"article:published_time\" content=\"2026-05-18T09:00:00+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\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144\"},\"author\":{\"name\":\"nic@nicsky.com\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\"},\"headline\":\"PIR Sensor for Solar Pathway Lighting\",\"datePublished\":\"2026-05-18T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144\"},\"wordCount\":261,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"articleSection\":[\"Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pirhome.com\\\/?p=4144#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144\",\"url\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144\",\"name\":\"PIR Sensor for Solar Pathway Lighting - PIRHOME\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\"},\"datePublished\":\"2026-05-18T09:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pirhome.com\\\/?p=4144\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pirhome.com\\\/?p=4144#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.pirhome.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PIR Sensor for Solar Pathway Lighting\"}]},{\"@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":"PIR Sensor for Solar Pathway Lighting - 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":"https:\/\/www.pirhome.com\/?p=4144","og_locale":"en_US","og_type":"article","og_title":"PIR Sensor for Solar Pathway Lighting - PIRHOME","og_description":"Project Overview This project creates solar-powered pathway lights that automatically turn on when someone walks by. The system uses a PIR sensor to detect motion and turns on LED strips for a set duration. Solar charging keeps the battery topped up during the day. Difficulty: Intermediate Estimated time: 2-3 hours Estimated cost: $30-45 How It [&hellip;]","og_url":"https:\/\/www.pirhome.com\/?p=4144","og_site_name":"PIRHOME","article_published_time":"2026-05-18T09:00:00+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":"https:\/\/www.pirhome.com\/?p=4144#article","isPartOf":{"@id":"https:\/\/www.pirhome.com\/?p=4144"},"author":{"name":"nic@nicsky.com","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3"},"headline":"PIR Sensor for Solar Pathway Lighting","datePublished":"2026-05-18T09:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pirhome.com\/?p=4144"},"wordCount":261,"commentCount":0,"publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"articleSection":["Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pirhome.com\/?p=4144#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pirhome.com\/?p=4144","url":"https:\/\/www.pirhome.com\/?p=4144","name":"PIR Sensor for Solar Pathway Lighting - PIRHOME","isPartOf":{"@id":"http:\/\/www.pirhome.com\/#website"},"datePublished":"2026-05-18T09:00:00+00:00","breadcrumb":{"@id":"https:\/\/www.pirhome.com\/?p=4144#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pirhome.com\/?p=4144"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pirhome.com\/?p=4144#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.pirhome.com\/"},{"@type":"ListItem","position":2,"name":"PIR Sensor for Solar Pathway Lighting"}]},{"@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\/4144","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=4144"}],"version-history":[{"count":1,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4144\/revisions"}],"predecessor-version":[{"id":4668,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4144\/revisions\/4668"}],"wp:attachment":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}