{"id":4048,"date":"2026-04-14T09:00:00","date_gmt":"2026-04-14T09:00:00","guid":{"rendered":"https:\/\/pirhome.com\/?p=3910"},"modified":"2026-04-14T09:00:00","modified_gmt":"2026-04-14T09:00:00","slug":"pir-halloween-ghost-decoration-2","status":"publish","type":"post","link":"https:\/\/www.pirhome.com\/?p=4048","title":{"rendered":"PIR Halloween Ghost Decoration (Motion-Activated)"},"content":{"rendered":"<h2>Project Overview<\/h2>\n<p>Create a fun Halloween decoration that comes to life when trick-or-treaters approach. When the PIR sensor detects motion, the ghost lights up with eerie LEDs, plays spooky sounds, and can even move using a servo motor.<\/p>\n<p><strong>Difficulty:<\/strong> Beginner<br \/>\n<strong>Estimated time:<\/strong> 2 hours<br \/>\n<strong>Estimated cost:<\/strong> $20-30<\/p>\n<h2>How It Works<\/h2>\n<p>A PIR sensor detects motion. When triggered, the system activates LEDs (in the ghost&#8217;s eyes or body), plays a spooky sound through a speaker, and optionally moves a servo to make the ghost shake or wave. After a few seconds, it returns to standby mode.<\/p>\n<h2>Materials Needed<\/h2>\n<ul>\n<li>Arduino Uno or Nano (1)<\/li>\n<li>HC-SR501 PIR sensor (1)<\/li>\n<li>DFPlayer Mini MP3 module (1)<\/li>\n<li>MicroSD card with spooky sound files<\/li>\n<li>Small speaker (3W, 4-8\u03a9)<\/li>\n<li>LEDs (white or color, 2-4)<\/li>\n<li>220\u03a9 resistors (for LEDs)<\/li>\n<li>Servo motor (SG90, optional)<\/li>\n<li>White fabric (for ghost costume)<\/li>\n<li>Wire or PVC pipe (for ghost frame)<\/li>\n<li>Jumper wires<\/li>\n<li>Power supply (5V 2A or battery pack)<\/li>\n<\/ul>\n<h2>Circuit Diagram<\/h2>\n<h3>Connection Table<\/h3>\n<table border=\"1\">\n<thead>\n<th>Component<\/th>\n<th>Pin<\/th>\n<th>Arduino Pin<\/th>\n<\/thead>\n<tbody>\n<th>PIR Sensor<\/th>\n<p> VCC<\/th>\n<p> 5V<\/th>\n<th>PIR Sensor<\/th>\n<p> GND<\/th>\n<p> GND<\/th>\n<th>PIR Sensor<\/th>\n<p> OUT<\/th>\n<p> Digital Pin 2<\/th>\n<th>DFPlayer Mini<\/th>\n<p> TX<\/th>\n<p> Digital Pin 11<\/th>\n<th>DFPlayer Mini<\/th>\n<p> RX<\/th>\n<p> Digital Pin 10 (via 1k\u03a9)<\/th>\n<th>DFPlayer Mini<\/th>\n<p> SPK+<\/th>\n<p> Speaker (+)<\/th>\n<th>DFPlayer Mini<\/th>\n<p> SPK-<\/th>\n<p> Speaker (-)<\/th>\n<th>LEDs (parallel)<\/th>\n<p> Anodes<\/th>\n<p> Digital Pin 9 (via 220\u03a9)<\/th>\n<th>Servo<\/th>\n<p> Signal<\/th>\n<p> Digital Pin 3<\/th>\n<\/tbody>\n<p>\u8868<\/p>\n<h2>Arduino Code<\/h2>\n<pre><code>#include &lt;SoftwareSerial.h&gt;\n#include &lt;DFRobotDFPlayerMini.h&gt;\n#include &lt;Servo.h&gt;\n\nSoftwareSerial mySoftwareSerial(10, 11);\nDFRobotDFPlayerMini myDFPlayer;\nServo ghostServo;\n\nconst int pirPin = 2;\nconst int ledPin = 9;\nconst int servoPin = 3;\n\nunsigned long lastTriggerTime = 0;\nconst unsigned long effectDuration = 5000;\nbool isActive = false;\n\nconst int ghostMoan = 1;\nconst int spookyLaugh = 2;\n\nvoid setup() {\n  Serial.begin(9600);\n  \n  pinMode(pirPin, INPUT);\n  pinMode(ledPin, OUTPUT);\n  digitalWrite(ledPin, LOW);\n  \n  ghostServo.attach(servoPin);\n  ghostServo.write(90);\n  \n  mySoftwareSerial.begin(9600);\n  if (!myDFPlayer.begin(mySoftwareSerial)) {\n    while (true);\n  }\n  myDFPlayer.volume(25);\n  \n  delay(60000);\n}\n\nvoid activateGhost() {\n  isActive = true;\n  lastTriggerTime = millis();\n  \n  digitalWrite(ledPin, HIGH);\n  \n  int randomSound = random(1, 3);\n  myDFPlayer.play(randomSound);\n  \n  for (int i = 0; i < 3; i++) {\n    ghostServo.write(60);\n    delay(150);\n    ghostServo.write(120);\n    delay(150);\n  }\n  ghostServo.write(90);\n  \n  for (int i = 0; i < 3; i++) {\n    digitalWrite(ledPin, LOW);\n    delay(100);\n    digitalWrite(ledPin, HIGH);\n    delay(100);\n  }\n}\n\nvoid deactivateGhost() {\n  isActive = false;\n  digitalWrite(ledPin, LOW);\n  ghostServo.write(90);\n}\n\nvoid loop() {\n  bool motionDetected = digitalRead(pirPin) == HIGH;\n  \n  if (motionDetected &#038;&#038; !isActive) {\n    activateGhost();\n  }\n  \n  if (isActive &#038;&#038; (millis() - lastTriggerTime > effectDuration)) {\n    deactivateGhost();\n  }\n  \n  delay(50);\n}\n<\/code><\/pre>\n<h2>Ghost Construction<\/h2>\n<h3>Frame<\/h3>\n<ol>\n<li>Use wire hanger or PVC pipe to create a frame about 2-3 feet tall<\/li>\n<li>Mount servo motor at the top if using moving ghost<\/li>\n<li>Attach LEDs at eye positions<\/li>\n<li>Position PIR sensor at chest height facing forward<\/li>\n<\/ol>\n<h3>Costume<\/h3>\n<ol>\n<li>Drape white fabric (old sheet or cheesecloth) over the frame<\/li>\n<li>Cut eye holes or use transparent material over LEDs<\/li>\n<li>Drape the fabric to create a ghost shape<\/li>\n<li>Secure with tape or wire ties<\/li>\n<\/ol>\n<h2>Installation Steps<\/h2>\n<ol>\n<li>Assemble electronics on breadboard and test<\/li>\n<li>Load sound files to microSD card<\/li>\n<li>Build ghost frame and attach servo<\/li>\n<li>Mount PIR, LEDs, and speaker to frame<\/li>\n<li>Drape fabric over frame<\/li>\n<li>Connect battery or USB power<\/li>\n<li>Walk in front to trigger the ghost<\/li>\n<\/ol>\n<h2>Project Extensions<\/h2>\n<ul>\n<li>Use WS2812B addressable LEDs for color-changing effects<\/li>\n<li>Add a small fog machine for an eerie effect<\/li>\n<li>Use multiple PIR sensors to track movement across yard<\/li>\n<li>Add Bluetooth to trigger ghost from phone<\/li>\n<li>Use ESP-NOW to synchronize multiple decorations<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>This motion-activated ghost is a fun and engaging Halloween decoration that delights trick-or-treaters. With simple materials and basic electronics, you can create a memorable spooky experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Project Overview Create a fun Halloween decoration that comes to life when trick-or-treaters approach. When the PIR sensor detects motion, the ghost lights up with eerie LEDs, plays spooky sounds, and can even move using a servo motor. Difficulty: Beginner Estimated time: 2 hours Estimated cost: $20-30 How It Works A PIR sensor detects motion. [&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-4048","post","type-post","status-publish","format-standard","hentry","category-projects"],"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>PIR Halloween Ghost Decoration (Motion-Activated) - 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=4048\" \/>\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 Halloween Ghost Decoration (Motion-Activated) - PIRHOME\" \/>\r\n<meta property=\"og:description\" content=\"Project Overview Create a fun Halloween decoration that comes to life when trick-or-treaters approach. When the PIR sensor detects motion, the ghost lights up with eerie LEDs, plays spooky sounds, and can even move using a servo motor. Difficulty: Beginner Estimated time: 2 hours Estimated cost: $20-30 How It Works A PIR sensor detects motion. [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"http:\/\/www.pirhome.com\/?p=4048\" \/>\r\n<meta property=\"og:site_name\" content=\"PIRHOME\" \/>\r\n<meta property=\"article:published_time\" content=\"2026-04-14T09: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=\"3 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=4048#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4048\"},\"author\":{\"name\":\"nic@nicsky.com\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\"},\"headline\":\"PIR Halloween Ghost Decoration (Motion-Activated)\",\"datePublished\":\"2026-04-14T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4048\"},\"wordCount\":394,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"articleSection\":[\"Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=4048#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4048\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4048\",\"name\":\"PIR Halloween Ghost Decoration (Motion-Activated) - PIRHOME\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\"},\"datePublished\":\"2026-04-14T09:00:00+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4048#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=4048\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4048#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.pirhome.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PIR Halloween Ghost Decoration (Motion-Activated)\"}]},{\"@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 Halloween Ghost Decoration (Motion-Activated) - 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=4048","og_locale":"en_US","og_type":"article","og_title":"PIR Halloween Ghost Decoration (Motion-Activated) - PIRHOME","og_description":"Project Overview Create a fun Halloween decoration that comes to life when trick-or-treaters approach. When the PIR sensor detects motion, the ghost lights up with eerie LEDs, plays spooky sounds, and can even move using a servo motor. Difficulty: Beginner Estimated time: 2 hours Estimated cost: $20-30 How It Works A PIR sensor detects motion. [&hellip;]","og_url":"http:\/\/www.pirhome.com\/?p=4048","og_site_name":"PIRHOME","article_published_time":"2026-04-14T09:00:00+00:00","author":"nic@nicsky.com","twitter_card":"summary_large_image","twitter_misc":{"Written by":"nic@nicsky.com","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.pirhome.com\/?p=4048#article","isPartOf":{"@id":"http:\/\/www.pirhome.com\/?p=4048"},"author":{"name":"nic@nicsky.com","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3"},"headline":"PIR Halloween Ghost Decoration (Motion-Activated)","datePublished":"2026-04-14T09:00:00+00:00","mainEntityOfPage":{"@id":"http:\/\/www.pirhome.com\/?p=4048"},"wordCount":394,"commentCount":0,"publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"articleSection":["Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.pirhome.com\/?p=4048#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.pirhome.com\/?p=4048","url":"http:\/\/www.pirhome.com\/?p=4048","name":"PIR Halloween Ghost Decoration (Motion-Activated) - PIRHOME","isPartOf":{"@id":"http:\/\/www.pirhome.com\/#website"},"datePublished":"2026-04-14T09:00:00+00:00","breadcrumb":{"@id":"http:\/\/www.pirhome.com\/?p=4048#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.pirhome.com\/?p=4048"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.pirhome.com\/?p=4048#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.pirhome.com\/"},{"@type":"ListItem","position":2,"name":"PIR Halloween Ghost Decoration (Motion-Activated)"}]},{"@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\/4048","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=4048"}],"version-history":[{"count":1,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions"}],"predecessor-version":[{"id":4376,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions\/4376"}],"wp:attachment":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}