{"id":20931570,"url":"https://github.com/johnwargo/garage-controller-particle-simple","last_synced_at":"2025-12-25T09:48:11.583Z","repository":{"id":261644615,"uuid":"884828172","full_name":"johnwargo/garage-controller-particle-simple","owner":"johnwargo","description":"a simple garage door controller using Particle Photon","archived":false,"fork":false,"pushed_at":"2024-11-08T00:10:05.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T19:09:51.806Z","etag":null,"topics":[],"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/johnwargo.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":"2024-11-07T13:14:12.000Z","updated_at":"2024-11-08T00:10:08.000Z","dependencies_parsed_at":"2024-11-07T17:47:36.494Z","dependency_job_id":null,"html_url":"https://github.com/johnwargo/garage-controller-particle-simple","commit_stats":null,"previous_names":["johnwargo/garage-controller-particle-simple"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fgarage-controller-particle-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fgarage-controller-particle-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fgarage-controller-particle-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fgarage-controller-particle-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnwargo","download_url":"https://codeload.github.com/johnwargo/garage-controller-particle-simple/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243324506,"owners_count":20273113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-18T21:44:12.966Z","updated_at":"2025-12-25T09:48:11.542Z","avatar_url":"https://github.com/johnwargo.png","language":"C++","funding_links":["https://www.buymeacoffee.com/johnwargo"],"categories":[],"sub_categories":[],"readme":"# Garage Controller Particle Simple\n\nThis repository contains the Arduino sketch for a simple garage door opener based on the [Particle Photon](https://store.particle.io/products/photon-2) platform. I built this years ago when I first discovered the Particle Platform and a version of this software has been running on a Particle device in my garage ever since.\n\nThe project is really simple, it defines a single function `pushButton` that, when executed, turns a relay on for a half of a second (500ms) then turns it off.\n\n```c\nint pushButton(String param){\n    // Turn the relay on \n    digitalWrite(relayPin, HIGH);\n    // Wait half a second\n    delay(500);\n    // Turn the relay off\n    digitalWrite(relayPin, LOW);  \n    // must return something, so return a zero (-1 means failure)\n    return 0;\n}\n```\n\nThe relay connects across the two wires that you'll find connected between the opener button and the garage door opener. When the relay shorts the wires (by turning the relay on) it looks to the garage door opener like you pushed the button and the garage door opener triggers (up or down depending on where it is at that time). \n\n**Note:** Most modern garage door openers use a wireless connection between the remote button and the garage door opener, so this will only work on ones that actually have wires.\n\nMy favorite part of the Particle platform is the cloud service that comes with it. Remember that function I described earlier? Well, through the Particle platform you can remotely trigger that function's execution through an API call to the Particle Platform or even by triggering the function from directly within the Particle Platform portal.\n\nHere's the code that registers the local function in the Particle cloud for remote execution\n\n```c\n//======================================================\n// Define the external function call to push the button\n//======================================================\nParticle.function(\"pushButton\", pushButton);\n```\n\n## Opening the Garage Door\n\nWhat I did for my implementation was build a native application in [Java (for Android)](https://github.com/johnwargo/particle-garage-controller-app-android) that allowed me to open and close the garage door from my phone. Since I wanted this to work on Android and iOS, I built an [Ionic](https://ionicframework.com/) app for it. My most recent iteration is a Flutter application that I've not yet published the source code for.\n\n## Implementation Advice\n\nEven though the sketch herein has a `.ino` extension, don't open it in the Arduino IDE; use the IDE built into the Particle Platform. The cloud IDE allows you to build and deploy over the network.\n\n---\n\nYou can find information on many different topics on my [personal blog](http://www.johnwargo.com). Learn about all of my publications at [John Wargo Books](http://www.johnwargobooks.com).\n\nIf you find this code useful and feel like thanking me for providing it, please consider \u003ca href=\"https://www.buymeacoffee.com/johnwargo\" target=\"_blank\"\u003eBuying Me a Coffee\u003c/a\u003e, or making a purchase from [my Amazon Wish List](https://amzn.com/w/1WI6AAUKPT5P9).\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwargo%2Fgarage-controller-particle-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnwargo%2Fgarage-controller-particle-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwargo%2Fgarage-controller-particle-simple/lists"}