{"id":18895475,"url":"https://github.com/cemrajc/smart-autocurtains","last_synced_at":"2026-02-27T22:30:15.721Z","repository":{"id":221445030,"uuid":"113276786","full_name":"CemraJC/smart-autocurtains","owner":"CemraJC","description":"An Arduino based smart-curtain implementation.","archived":false,"fork":false,"pushed_at":"2017-12-20T23:29:00.000Z","size":3022,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T07:43:55.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CemraJC.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}},"created_at":"2017-12-06T06:14:01.000Z","updated_at":"2024-11-01T18:23:36.000Z","dependencies_parsed_at":"2024-02-08T02:23:10.797Z","dependency_job_id":"97940fc0-d782-4bf9-9a31-5079a58edc3d","html_url":"https://github.com/CemraJC/smart-autocurtains","commit_stats":null,"previous_names":["cemrajc/smart-autocurtains"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemraJC%2Fsmart-autocurtains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemraJC%2Fsmart-autocurtains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemraJC%2Fsmart-autocurtains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemraJC%2Fsmart-autocurtains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CemraJC","download_url":"https://codeload.github.com/CemraJC/smart-autocurtains/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239870151,"owners_count":19710650,"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-08T08:28:17.108Z","updated_at":"2026-02-27T22:30:15.666Z","avatar_url":"https://github.com/CemraJC.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Auto-curtain System\n\nA foundational system for controlling a stepper motor based on remote input,\nambient light readings and locally measured temperature.\n\nEvery curtain system is different, so some independent design is required.\n\n**Please read this whole document before building! Seriously!** (I mean, c'mon,\nit's not that long - it'll save you a bunch of time in the setup)\n\n## What it does\n\nThe basic system will open or close curtains based on remote control input. In\nthe event of remote control failure, the system has two integrated buttons to\noperate the curtains.\n\n**However,** the system can do much more than simple remote operation. If\n\"Auto-brightness control\" is enabled, the system will close the blinds if\noutside light levels exceed a pre-determined threshold. This is to assist with\nsleeping in bright-early environments.\n\nAlso, depending on the local temperature (and your currently active settings),\nthe system may open the blinds to allow sunlight or air circulation.\n\nNote that the system does not use the local time to operate, because the\nhardware required adds unnecessary complexity to the setup and user operation of\nthe system.\n\n\n## System components:\n\n1. Arduino Nano\n    * Could be substituted for a different type of Arduino\n    * Minimum specs:\n    * Must have a regulated power supply\n2. Stepper Motor and controller (more info - todo)\n3. 5V power supply and cable (more info - check max rating for stepper)\n4. 2 momentary push buttons\n5. 1 photoresistor\n6. 1 temperature sensor\n7. 1 IR LED (for receiving remote signals)\n8. 1 RGB LED (or 3 separate red, green, blue LEDs - diffused!)\n9. Arbitrary IR remote (buttons will be programmed in)\n10. Perforated circuit board (minimum 300x250)\n11. Solid-core wire (cleaner than stranded)\n12. Resistors (220, 1k, 10k)\n13. Cardboard / MDF (more info when final casing completed)\n14. Bump-press limit switch (for homing the system)\n\n## Tools required:\n\n1. Soldering Iron and Small Fan (to evacuate soldering smoke)\n2. Wire strippers (optional, but highly recommended)\n3. Screwdriver\n\n## Building (TODO)\n\n\n# Set-up procedure\n\nThe Smart Autocurtains require the following setup:\n\n* Set the remote buttons\n* Set the \"away\" position\n\nThese settings are saved in the Arduino's non-volatile memory, so the settings\nare not wiped in a loss-of-power event. In other words, you should only have\nto set up the system once.\n\nBefore attempting setup, make sure that the power is on. The system should\nflash a green LED once when the power is turned on. Then, the curtains will\nautomatically seek the home position. If it is the first run, a red LED should\nturn on next.\n\n## Setting remote buttons\n\nWhen you first run the system (or run it after a user-reset), you will need to\nrecord the buttons on your remote. Every remote is different, however this\nshould still be a simple procedure. If you have difficulties, try changing the\nremote you are using and making sure the remote is functional.\n\nTo check that your remote has battery, point a smartphone camera at the IR LED\non the front. Then, press a button. If the camera shows a flash, then the\nremote is functional.\n\nSome remotes are more reliable than others. Hold the remote a least 2 feet\n(0.5 meters) away from the IR receiver and press each button quickly.\n\nTo record which buttons do what, follow these steps:\n\n1. Observe that a red LED is lit up on the device (first run only)\n1. Press the button on the remote that you want to correspond to \"open\"\n1. Keep pressing this button (it needs four consecutive signals). If the LED flashes Red/Blue (Purple) then the remote sent a partial signal and you need to start again. Make sure that each press is quick.\n1. Observe that the system flashes a blue LED exactly once\n1. Choose and press the \"close\" button on the remote (4 times again)\n1. Observe that the system flashes a blue LED exactly twice\n1. Choose and press the \"cancel\" button (same deal as with the others)\n1. Observe that the system flashes a blue LED exactly three times\n1. Choose and press the \"auto-dawn\" button (to enable/disable closing the curtains when it gets bright in the morning)\n1. Observe that the system flashes a blue LED exactly four times\n1. Choose and press the \"auto-temp\" button (to enable/disable force-opening the curtains when the temperature exceeds 28 degrees C)\n1. Observe that the system flashes a blue LED exactly five times and the curtains proceed to the home position\n\nNote that it will take about 30 seconds for the settings to be saved into the\npermanent memory, so don't power down the system at least until then.\n\n**Important:** on first run, be prepared to quickly power down the system in\nthe event that the homing switch does not function correctly. If the stepper\nis allowed to run past home, it may stall and/or cause damage to the device or\nyour curtains.\n\nNow is a good time to mention that we take no responsibility for any damages\ncaused by the system (although, to be fair, it's pretty unlikely that anything\nseriously bad could happen).\n\n\n## Setting home and away positions\n\n#### What are home and away positions?\n\nThe curtains have two key positions, \"home\" and \"away\". The home position is\nset by where the homing switch is placed. Depending on how the system is set\nup, home and away could be in very different places. Regardless, home is the\nposition the curtains should be in when _open_. Home is set automatically by\nthe system, assuming the limit switch is properly in place.\n\nOnce home is found (the system re-homes every time on startup), the \"away\"\nposition must be set by the user (if it has not been already). \n\n#### How to set the away position\n\nTo set the away position, wait for the \"red blue\" LED sequence (purple on an\nRGB system) and then proceed to press and hold the open/close buttons (on the\nremote, or the onboard buttons) to set the away position. If the directions\nare wrong (i.e the open button closes the curtains) then you will need to\nswitch the rails to which the curtains are clipped.\n\n_Note:_ Holding down a button may not work on some remotes. In this case, you\nwill need to repeatedly press the open/close remote buttons to step the\ncurtains into the desired position. Alternatively, press and hold the onboard\nsystem buttons (this should always work).\n\nOnce you are happy with the curtain's position as the \"away\" position, press\nand hold both onboard buttons for 2 seconds. The away position is now set, it\nshould not need to be set again (unless you reset the system).\n\n## All done!\n\nWhen the away position is set successfully, the device should flash a green\nLED. Your Smart Autocurtains are now ready for use!\n\n\n# How to use the Smart Autocurtains\n\nOnce the curtains are set up according to the above procedure, you can operate\nthe curtains in the following ways:\n\n## Using the remote\n\nWith a single press of the open or close buttons, the curtains will travel the\nfull distance to the home/away position respectively. If you only want the\ncurtains, say half-open, then press the cancel button halfway through the\nmotion.\n\nOnce a motion is canceled, a subsequent motion will pick back up from where\nthe curtains currently are.\n\nNote that, since this system is designed to be flexible, remote performance is\nnot always as good as if it was a native system.\n\n## Using the on-board buttons\n\nThere are two buttons, one to open, and one to close. If both buttons are\npressed at once, the curtains will cancel their current motion (assuming there\nis one being made).\n\n**WARNING:** When you first press a button, the system needs time to wake up\nfrom low power mode. Because of this, you may need to hold one of the buttons\nfor at most 1 second to get the system to respond. The system will re-enter\nlow power mode after 10 seconds of no user input.\n\nIf both buttons are pressed and held for 4 seconds, the entire system should\nreset - including clearing all settings, remote buttons and positions. The\nsystem will need to be setup from scratch if reset in this way.\n\n\n## With the \"smart\" features\n\nThere are two smart features, \"autodawn control\" and \"autotemp control\". These\nsmart features operate the curtains without user input in response to readings\nfrom light and temperature sensors.\n\nTo **enable/disable** these features individually, press the corresponding buttons\non the remote that were recorded during setup and observe that the system\nshould flash a red or green LED for \"off\" or \"on\" respectively.\n\n## Autodawn\n\nThis feature is the reason this system exists. Where I (the developer) live,\nit gets fairly bright at around 4 or 5am. I prefer to wake up at 7am, but the sun\nwon't let me. You get the idea.\n\nThe system uses a light sensor to determine if it is currently night. It does\nthis by waiting for the light levels to drop below a \"night-time\" threshold\nfor a minimum of 30 minutes. If it is night (or the system _thinks_ it is),\nthen the curtains will open, to allow air circulation.\n\nThen, when light levels exceed the \"night-time\" threshold level for at least\n30 minutes, the system will close the blinds to prevent early-brightness from\nwaking you up.\n\n## Autotemp\n\nHaving the curtains closed for brightness is only good as long as the\ntemperature is bearable. Based on external research, 28 degrees C is a general\nthreshold at which humans find it difficult to sleep. For this reason, if\nautotemp is enabled, the curtains will be forced to open to allow air\ncirculation - regardless of autodawn. Of course, user input will override the\nauto-temp setting (for up to 1 hour) unless autotemp is disabled, and then re-\nenabled.\n\nWhether or not this feature makes sense for you depends on your unique\ncircumstance. It also assumes that your windows are actually open - otherwise,\nall it does is let in sunlight and make things worse!\n\n\n# Common Issues\n\n## I have to hold the on-board button before it works\n\nThis is normal. When you first press a button, the system needs time to wake\nup from low power mode. Because of this, you may need to hold one of the\nbuttons for at most 1 second to get the system to respond. The system will re-\nenter low power mode after 10 seconds of no user input.\n\n## My remote doesn't work when I try to set it up\n\nTry another remote. The system should recognize most remotes, but there are a\nfew whacky ones out there that don't work for some reason. If you can't get a\n_normal_ Infra-Red TV remote to work, and you've tried other remotes, then you\nmay need to reset the system.\n\n## My remote doesn't work anymore - it used to!\n\nTo check that your remote has battery, point a smartphone camera at the IR LED\non the front. Then, press a button that you have recorded on the system. If\nthe camera shows a flash, then the remote is functional.\n\nIf your remote is working, but the system is not responding, then try holding\nthe remote really close to the IR receiver on the device, shielding if from\nthe environment with your hand. If this fixes the problem, you will need to\nidentify possible sources of infra-red interference and remove them from the\nenvironment.\n\nIf the system still doesn't work, follow the troubleshooting procedure below\nto cycle the power, and if necessary, reset the entire system.\n\n## I have some other problem\n\nFollow the troubleshooting procedure below. If this still does not resolve\nyour issue, then I'm out of ideas. If you find a problem that is not resolved\nby following the procedure below, don't hesitate to open a GitHub Issue and I\nwill try to work with you to resolve the problem.\n\n\n# Troubleshooting\n\n## Deep cycle the power\n\nIf the system is malfunctioning, follow these steps to try and resolve the issue:\n\n1. Turn the system off with the power switch, then turn off the switch at the wall.\n2. Wait for 5 seconds to ensure all power has drained from the system\n3. Turn the wall switch back on (nothing should be happening yet)\n4. Turn the device's power switch back on\n\nNow, you should see the system flash a green LED twice and the system should\ngo to home.\n\n## Well, that didn't fix it.\n\nPress and hold the onboard buttons for 4 seconds. The system should flash a\nred LED twice, then reset itself - clearing all settings. Then, go through the\nsetup procedure again and see if the system is now functioning correctly.\n\nYou should not have to do this often/at all. If you find yourself regularly\ndoing this, then check that the stepper is rotating _continuously_ (i.e. no\njumpiness or skips) when opening/closing the curtains. If it does not rotate\ncontinuously, then you will need to reduce the torque on the stepper by either\nadjusting the curtains, so they move with less friction, or by upgrading the\nstepper motor to one with higher torque. A stepper upgrade is difficult work,\nand is left as an exercise only to advanced users. \n\n## Something is probably broken.\n\nIf there are no green flashes on startup, confirm that the LEDs are functional.\nStill no flashes, then either there is something wrong with the code, or the\nArduino is malfunctioning - possibly due to loose connections, or a short\ncircuit. If you have made modifications to the code, you will need to debug it\nyourself.\n\nIf you do see two green flashes, the system should move the curtains\nto the home position. If the curtains do not move, and are not already at the\nhome position, check the wiring to the stepper motor and confirm that power is\nbeing correctly applied.\n\nIf the wiring is correct, and still no motion, use your fingers to test the\ntemperature of the motor and all the IC's (integrated circuit chips). They\nshould all be at room temperature, or only slightly warm. If any of the chips\nare too hot to touch, immediately power down the system and triple check the\nwiring, paying careful attention to potential short circuits due to faulty\nresistors/capacitors.\n\nIf the curtains move, but do not stop when they reach home (or they home too\nearly/at random positions) power down the system and confirm that the limit\nswitch is functioning correctly and is properly hooked up to the Arduino.\n\nIf the curtains do not reliably return to the home and away positions, go to\nthe previous section to check that the stepper is functioning correctly.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemrajc%2Fsmart-autocurtains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcemrajc%2Fsmart-autocurtains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemrajc%2Fsmart-autocurtains/lists"}