{"id":3930,"date":"2026-05-19T09:00:00","date_gmt":"2026-05-19T09:00:00","guid":{"rendered":"https:\/\/pirhome.com\/?p=3930"},"modified":"2026-05-19T09:00:00","modified_gmt":"2026-05-19T09:00:00","slug":"pir-smart-mirror","status":"publish","type":"post","link":"https:\/\/www.pirhome.com\/?p=3930","title":{"rendered":"PIR Sensor for Smart Mirror: Motion-Activated Display"},"content":{"rendered":"<h2>Project Overview<\/h2>\n<p>This project creates a smart mirror that displays information (time, weather, calendar) when someone approaches, and turns off the display when no one is present. The PIR sensor detects motion and triggers the display via Raspberry Pi. The two-way mirror makes the display invisible when off.<\/p>\n<p><strong>Difficulty:<\/strong> Advanced<br \/>\n<strong>Estimated time:<\/strong> 4-6 hours<br \/>\n<strong>Estimated cost:<\/strong> $100-150<\/p>\n<h2>How It Works<\/h2>\n<p>A PIR sensor mounted on the mirror frame detects when someone approaches. A Raspberry Pi runs MagicMirror software that displays information. When motion is detected, the Pi turns on the monitor. After a period of no motion, it turns off the display.<\/p>\n<h2>Materials Needed<\/h2>\n<ul>\n<li>Raspberry Pi 4 (1)<\/li>\n<li>Monitor\/LCD panel (19-24 inch)<\/li>\n<li>Two-way acrylic mirror sheet cut to size<\/li>\n<li>Wood frame to hold mirror and monitor<\/li>\n<li>HC-SR501 PIR sensor (1)<\/li>\n<li>5V relay module to control monitor power<\/li>\n<li>Jumper wires<\/li>\n<li>USB power for Pi (5V 3A)<\/li>\n<li>Power strip for monitor and Pi<\/li>\n<\/ul>\n<h2>Smart Mirror Construction<\/h2>\n<ol>\n<li>Remove monitor bezel carefully, keeping LCD panel and controller board<\/li>\n<li>Build wooden frame slightly larger than LCD panel<\/li>\n<li>Secure LCD panel inside frame<\/li>\n<li>Place acrylic mirror sheet over LCD, shiny side facing out<\/li>\n<li>Secure Raspberry Pi and power strip behind mirror<\/li>\n<li>Drill small hole in frame and mount PIR sensor at bottom edge<\/li>\n<\/ol>\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>Raspberry Pi GPIO<\/th>\n<\/thead>\n<tbody>\n<th>PIR Sensor<\/th>\n<p> OUT<\/th>\n<p> GPIO 4<\/th>\n<th>Relay Module<\/th>\n<p> IN<\/th>\n<p> GPIO 17<\/th>\n<\/tbody>\n<p>\u8868<\/p>\n<h2>Raspberry Pi Setup<\/h2>\n<ol>\n<li>Install Raspberry Pi OS Lite<\/li>\n<li>Install MagicMirror\u00b2: git clone https:\/\/github.com\/MichMich\/MagicMirror<\/li>\n<li>Configure MagicMirror modules in config.js<\/li>\n<li>Set up autostart on boot<\/li>\n<\/ol>\n<h2>Python Script for Motion Detection<\/h2>\n<pre><code>#!\/usr\/bin\/env python3\nimport RPi.GPIO as GPIO\nimport subprocess\nimport time\n\nPIR_PIN = 4\nRELAY_PIN = 17\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(PIR_PIN, GPIO.IN)\nGPIO.setup(RELAY_PIN, GPIO.OUT)\nGPIO.output(RELAY_PIN, GPIO.LOW)\n\ndisplay_on = False\nlast_motion = 0\nTIMEOUT = 60\n\ndef monitor_on():\n    global display_on\n    if not display_on:\n        GPIO.output(RELAY_PIN, GPIO.HIGH)\n        subprocess.run(['vcgencmd', 'display_power', '1'])\n        display_on = True\n\ndef monitor_off():\n    global display_on\n    if display_on:\n        GPIO.output(RELAY_PIN, GPIO.LOW)\n        subprocess.run(['vcgencmd', 'display_power', '0'])\n        display_on = False\n\ntry:\n    while True:\n        motion = GPIO.input(PIR_PIN)\n        if motion:\n            last_motion = time.time()\n            monitor_on()\n        \n        if display_on and (time.time() - last_motion > TIMEOUT):\n            monitor_off()\n        \n        time.sleep(0.5)\n\nexcept KeyboardInterrupt:\n    monitor_off()\n    GPIO.cleanup()\n<\/code><\/pre>\n<h2>Installation Steps<\/h2>\n<ol>\n<li>Build mirror frame with LCD and two-way mirror<\/li>\n<li>Mount Raspberry Pi behind mirror<\/li>\n<li>Install PIR sensor on frame edge<\/li>\n<li>Connect relay to control monitor power<\/li>\n<li>Install software and motion script<\/li>\n<li>Approach mirror to test display activation<\/li>\n<li>Adjust timeout in script as desired<\/li>\n<\/ol>\n<h2>Project Extensions<\/h2>\n<ul>\n<li>Add microphone for voice commands<\/li>\n<li>Add camera for facial recognition<\/li>\n<li>Add touch overlay for interactive features<\/li>\n<li>Add DHT22 to display room conditions<\/li>\n<li>Display doorbell camera when motion detected<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>This smart mirror combines functionality and style, displaying useful information only when you need it with PIR activation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Project Overview This project creates a smart mirror that displays information (time, weather, calendar) when someone approaches, and turns off the display when no one is present. The PIR sensor detects motion and triggers the display via Raspberry Pi. The two-way mirror makes the display invisible when off. Difficulty: Advanced Estimated time: 4-6 hours Estimated [&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-3930","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 Smart Mirror: Motion-Activated Display - 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=3930\" \/>\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 Smart Mirror: Motion-Activated Display - PIRHOME\" \/>\r\n<meta property=\"og:description\" content=\"Project Overview This project creates a smart mirror that displays information (time, weather, calendar) when someone approaches, and turns off the display when no one is present. The PIR sensor detects motion and triggers the display via Raspberry Pi. The two-way mirror makes the display invisible when off. Difficulty: Advanced Estimated time: 4-6 hours Estimated [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"http:\/\/www.pirhome.com\/?p=3930\" \/>\r\n<meta property=\"og:site_name\" content=\"PIRHOME\" \/>\r\n<meta property=\"article:published_time\" content=\"2026-05-19T09: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\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930\"},\"author\":{\"name\":\"nic@nicsky.com\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\"},\"headline\":\"PIR Sensor for Smart Mirror: Motion-Activated Display\",\"datePublished\":\"2026-05-19T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930\"},\"wordCount\":355,\"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=3930#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930\",\"name\":\"PIR Sensor for Smart Mirror: Motion-Activated Display - PIRHOME\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\"},\"datePublished\":\"2026-05-19T09:00:00+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=3930\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3930#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.pirhome.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PIR Sensor for Smart Mirror: Motion-Activated Display\"}]},{\"@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 Smart Mirror: Motion-Activated Display - 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=3930","og_locale":"en_US","og_type":"article","og_title":"PIR Sensor for Smart Mirror: Motion-Activated Display - PIRHOME","og_description":"Project Overview This project creates a smart mirror that displays information (time, weather, calendar) when someone approaches, and turns off the display when no one is present. The PIR sensor detects motion and triggers the display via Raspberry Pi. The two-way mirror makes the display invisible when off. Difficulty: Advanced Estimated time: 4-6 hours Estimated [&hellip;]","og_url":"http:\/\/www.pirhome.com\/?p=3930","og_site_name":"PIRHOME","article_published_time":"2026-05-19T09: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":"http:\/\/www.pirhome.com\/?p=3930#article","isPartOf":{"@id":"http:\/\/www.pirhome.com\/?p=3930"},"author":{"name":"nic@nicsky.com","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3"},"headline":"PIR Sensor for Smart Mirror: Motion-Activated Display","datePublished":"2026-05-19T09:00:00+00:00","mainEntityOfPage":{"@id":"http:\/\/www.pirhome.com\/?p=3930"},"wordCount":355,"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=3930#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.pirhome.com\/?p=3930","url":"http:\/\/www.pirhome.com\/?p=3930","name":"PIR Sensor for Smart Mirror: Motion-Activated Display - PIRHOME","isPartOf":{"@id":"http:\/\/www.pirhome.com\/#website"},"datePublished":"2026-05-19T09:00:00+00:00","breadcrumb":{"@id":"http:\/\/www.pirhome.com\/?p=3930#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.pirhome.com\/?p=3930"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.pirhome.com\/?p=3930#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.pirhome.com\/"},{"@type":"ListItem","position":2,"name":"PIR Sensor for Smart Mirror: Motion-Activated Display"}]},{"@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\/3930","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=3930"}],"version-history":[{"count":1,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/3930\/revisions"}],"predecessor-version":[{"id":4669,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/3930\/revisions\/4669"}],"wp:attachment":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}