{"id":16559361,"url":"https://github.com/anders94/raspberry-pi-home-automation","last_synced_at":"2025-10-13T00:52:52.772Z","repository":{"id":149692829,"uuid":"11202064","full_name":"anders94/raspberry-pi-home-automation","owner":"anders94","description":"A node.js based home automation system based around the Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2018-12-19T13:08:42.000Z","size":7,"stargazers_count":167,"open_issues_count":0,"forks_count":51,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-10-12T20:25:39.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/anders94.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}},"created_at":"2013-07-05T14:59:22.000Z","updated_at":"2024-04-04T13:47:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"beb47a4d-bb73-42d0-a393-9970bbfdd9b2","html_url":"https://github.com/anders94/raspberry-pi-home-automation","commit_stats":{"total_commits":11,"total_committers":4,"mean_commits":2.75,"dds":"0.36363636363636365","last_synced_commit":"69390af19c8e21e060514fc6eba12350cc3e3828"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anders94%2Fraspberry-pi-home-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anders94%2Fraspberry-pi-home-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anders94%2Fraspberry-pi-home-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anders94%2Fraspberry-pi-home-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anders94","download_url":"https://codeload.github.com/anders94/raspberry-pi-home-automation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221667601,"owners_count":16860623,"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-10-11T20:25:40.753Z","updated_at":"2025-10-13T00:52:47.741Z","avatar_url":"https://github.com/anders94.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","domotic"],"sub_categories":["USB GADGET"],"readme":"raspberry-pi-home-automation\n============================\nA node.js based home automation system based around the Raspberry Pi. For background around this project:\n\n[![The Well Tempered Hacker](http://img.youtube.com/vi/SEAQVXHSwg4/0.jpg)](http://www.youtube.com/watch?v=SEAQVXHSwg4)\n\nInstallation\n============\nTo get started, clone the repository and install the required dependencies.\n\n    git clone https://github.com/anders94/raspberry-pi-home-automation.git\n    cd raspberry-pi-home-automation\n    npm install\n\nHardware\n========\nThe Raspberry Pi needs a little bit of circuitry to protect and amplify its GPIO\nports. Here's schematics of the circuits I created for this project.\n\nProtected Pull-Up Switch\n------------------------\nIf you want to read from the GPIO pins on the Raspberry Pi, you shouldn't just \nswitch the pin between 3.3v+ and nothing. Rather, you should either pull it up\nto 3.3v+ through a small (1k) resistor or drain it down to ground through a \nlarger (10k + 1k = 11k) resistance.\n\n\u003ca href=\"http://anders.com/1offs/protected-pull-up-switch-circuit.png\"\u003e\u003cimg src=\"http://anders.com/1offs/protected-pull-up-switch-circuit.png\" width=\"640\" height=\"480\" alt=\"Protected Pull-Up Switch Circuit\"\u003e\u003c/a\u003e\n\nRelay Driver\n------------\nThe GPIO pins on the Raspberry Pi run at 3.3v which isn't really enough to \nsolidly throw relays. (in my case, I'm using a solid state relay but the \ntheory is the same) This circuit uses an NPN transistor to amplify the 3.3v\nGPIO output to a 5v output which is enough to throw the relay.\n\n\u003ca href=\"http://anders.com/1offs/relay-driver-circuit.png\"\u003e\u003cimg src=\"http://anders.com/1offs/relay-driver-circuit.png\" width=\"640\" height=\"480\" alt=\"Protected Pull-Up Switch Circuit\"\u003e\u003c/a\u003e\n\nServer\n======\nThe server uses MQTT, a lightweight messaging channel over TCP, and presents a\npub-sub like interface to clients. Clients connect and can publish messages which\nget copied to all other connected clients.\n\nTo start the server:\n\n    node server\n\nIt will connect and listen to 0.0.0.0:1883 by default.\n\nClients\n=======\nClients read from and optionally write to the GPIO pins on the Raspberry Pi. Light\nswitches are directly attached to 3.3v GPIO pins pushing them either high or low.\nSolid state relays to switch 120v AC loads are driven via 3.3v GPIO pins which are\nup-converted to 5v with a transistor. (3.3v isn't quite enough to solidly switch the\nSharp S216S02 solid state relays I'm using) You may need to access GPIO pins as root\ndepending on how you have things set up.\n\nwatch.js\n--------\nFires a callback when the GPIO pin state changes. Use this to test GPIO input \nfunctionality.\n\nblink.js\n--------\nBlinks GPIO pins on and off for 5 seconds so you can get your SSR setup working.\n\nlight-switch.js\n---------------\nSimple on or off lightswitch example, linking input and output. It does exactly\nwhat you think it does.\n\nmulti-light-switch.js\n---------------------\nConnects to the server (IP is manually set in the source) via MQTT and \npublishes light switch events. It works as a four position lightswitch \nfor two lights. See the video for a demonstration of this in action.\n\nTODO\n====\n\nPublish the SPI code and circuit schematic for the 120vAC current sensing capability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanders94%2Fraspberry-pi-home-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanders94%2Fraspberry-pi-home-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanders94%2Fraspberry-pi-home-automation/lists"}