{"id":23586528,"url":"https://github.com/andrewl/motion-detector","last_synced_at":"2026-04-18T02:08:06.969Z","repository":{"id":138547743,"uuid":"306150167","full_name":"andrewl/motion-detector","owner":"andrewl","description":"Motion detection and Slack notification for Arduino/ESP8266","archived":false,"fork":false,"pushed_at":"2024-04-17T18:30:51.000Z","size":296,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T04:06:49.647Z","etag":null,"topics":["arduino","esp8266","iot","motion-detection","slack"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-21T21:18:00.000Z","updated_at":"2024-04-17T18:33:30.000Z","dependencies_parsed_at":"2024-04-17T19:33:01.271Z","dependency_job_id":null,"html_url":"https://github.com/andrewl/motion-detector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrewl/motion-detector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fmotion-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fmotion-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fmotion-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fmotion-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewl","download_url":"https://codeload.github.com/andrewl/motion-detector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fmotion-detector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp8266","iot","motion-detection","slack"],"created_at":"2024-12-27T04:11:30.710Z","updated_at":"2026-04-18T02:08:06.960Z","avatar_url":"https://github.com/andrewl.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Motion Sensor to Slack Notification\n==\n\nWhat is this?\n--\nThis shows you how to hook up some low-cost hardware to periodically send a message to Slack if motion was detected recently.\n\nWhy?\n--\nWe have an elderly relative who recently had a fall necessitating hospital treatment. This is a simple solution to help assure us that they're still moving around - but without being as intrusive as a camera might be.\n\nCouldn't you buy something to do this?\n--\nI did. A D-Link or TP-Link something or other with [IFTTT](https://www.ifttt.com) integration through the vendors app.\n\nBut the manufacturer withdrew support after 18 months though and now it's just more [e-waste](https://en.wikipedia.org/wiki/Electronic_waste)\n\nOK, How do I build one?\n--  \n*Hardware*\n\nYou'll need\n\n- a [Wemos D1](https://www.wemos.cc/en/latest/d1/d1_mini_lite.html) or similar board (there are plenty of clones available)\n- a PIR sensor, such as https://shop.rasp.io/products/pir-motion-sensor-2\n\n\nIt's a really simple build, you don't even need a breadboard or resistors.\n\n1. Attach the PIR sensor to the board as per the schematic below.. You just need to connect the 5v, ground and a digital pin that has no internal pull-up (so that by default if reads LOW - D0 on a Wemos D1 is a good choice).\n\n2. Set the delay setting on the sensor to minimum (consult your sensor's documentation - but with these sensors there's often a screw-type adjustment on them to alter delay and sensitivity.)\n\n![Schematic](./motion-detector.png) \n\n*Software*\n\n1. Install the [Arduino IDE](https://www.arduino.cc/en/software) with the ESP8266 board package.\n\n2. Copy secrets.EXAMPLE.h to secrets.h and fill in your WiFi credentials and Slack webhook URL. These are the **initial** defaults — all settings can be changed later via the web UI without reflashing.\n\n3. Compile and upload the sketch to your board.\n\nRunning\n--\nAfter powering on the device it will connect to WiFi and start a web server, then wait 1 minute for the sensor to warm up. During warmup the web UI is already accessible.\n\nIt then polls the sensor every 5 seconds — if motion is detected it lights the internal LED and notes that motion has occurred.\n\nAt the end of each notification interval (default: 1 hour) it sends a message to the webhook reporting whether motion was detected. The number prefixed to each message is the uptime in seconds, useful for remote debugging.\n\n![Slack Screenshot](./screenshot.jpg)\n\nWeb UI\n--\nThe device runs a small web server on port 80. Find its IP address in the Arduino IDE Serial Monitor at startup, then open it in a browser.\n\n**Status page** (`http://\u003cip\u003e/`) — auto-refreshes every 10 seconds and shows:\n- Whether motion is being detected right now\n- Whether motion has been detected since the last notification\n- Time until the next notification\n- Uptime, WiFi network, and IP address\n- Number of messages pending in the outbox queue\n\n**Config page** (`http://\u003cip\u003e/config`) — lets you change all settings without reflashing:\n- Primary and secondary WiFi credentials\n- Webhook host, endpoint path, and API key\n- Notification interval (in minutes)\n\nSaving the config page restarts the device and applies the new settings immediately. Settings are stored in EEPROM and survive power cycles; secrets.h is only used as the initial default on a fresh flash.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewl%2Fmotion-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewl%2Fmotion-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewl%2Fmotion-detector/lists"}