{"id":26871230,"url":"https://github.com/codeadamca/arduino-motion-sensor","last_synced_at":"2026-05-16T06:36:28.889Z","repository":{"id":115326343,"uuid":"301225015","full_name":"codeadamca/arduino-motion-sensor","owner":"codeadamca","description":"A basic script to detect motion using an Arduino and a motion sensor.","archived":false,"fork":false,"pushed_at":"2025-01-26T22:04:41.000Z","size":101,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-08T14:03:40.601Z","etag":null,"topics":["arduino","cplusplus","motion-sensor"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeadamca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-04T20:51:44.000Z","updated_at":"2025-01-26T22:04:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"1707f3ac-e80d-4be2-9fe5-721825757b89","html_url":"https://github.com/codeadamca/arduino-motion-sensor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codeadamca/arduino-motion-sensor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Farduino-motion-sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Farduino-motion-sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Farduino-motion-sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Farduino-motion-sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/arduino-motion-sensor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Farduino-motion-sensor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33092719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","cplusplus","motion-sensor"],"created_at":"2025-03-31T07:18:49.864Z","updated_at":"2026-05-16T06:36:28.871Z","avatar_url":"https://github.com/codeadamca.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino and a Motion Sensor\n\nA basic example of reacting to the status of a motion sensor using an Arduino and the built-in LED.\n\n## Arduino Code\n\nOpen up [Arduino Create](https://create.arduino.cc/editor/) and add the following code:\n\n```csharp\n// Define a variable to store the pin number\nint motionPin = 2;\n\n// The setup function runs once when you press reset or power the board\nvoid setup(){\n\n  Serial.begin(9600);\n  pinMode(motionPin, INPUT);\n\n  pinMode(LED_BUILTIN, OUTPUT);\n\n}\n\n// The loop function runs over and over again forever\nvoid loop (){\n\n  // Add a delay between each loop\n  delay(1000);\n\n  // Fetch the current motion sensor status\n  int motionResult = digitalRead(motionPin);\n\n  // Output the current motion sensor result\n  Serial.println(motionResult);\n\n  // Turn the bulit-in LED on or off based on the motino sensor status\n  if (motionResult == HIGH) {\n    digitalWrite(LED_BUILTIN, HIGH);\n  } else {\n    digitalWrite(LED_BUILTIN, LOW);\n  }\n\n}\n```\n\n\u003e [View the Arduino code on Arduino Create](https://create.arduino.cc/editor/professoradam/67d42c97-02ab-4f79-9f4b-fd4c3e68fd5c/preview)\n\nYou will need to setup the following circuit using your Arduino:\n\n![Tinkercad Circuit](_readme/tinkercad-motion-sensor.png)\n\n\u003e [View the Circuit on Tinkercad](https://www.tinkercad.com/things/jDkGCF2jfv1)\n\n\u003e Full tutorial URL:  \n\u003e https://codeadam.ca/learning/arduino-motion-sensor.html\n\n***\n\n## Repo Resources\n\n- [Arduino Create](https://create.arduino.cc/editor)\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Farduino-motion-sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Farduino-motion-sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Farduino-motion-sensor/lists"}