Affordable Smart Curtains Control Sunlight
Tired of opening and closing your own curtains like some kind of peasant? Then check out Donutsorelse's affordable smart curtains project.
I would argue that one of humanity's greatest achievements was our subjugation of light. Fire and then electric light let us continue being productive deep into the night, while houses and blackout curtains allowed us to keep the sunlight at bay long into the afternoon. In an ideal world, we'd live in windowless homes and rely on artificial lighting. But architects and society seem to frown on that, so we have to cover our windows. To control light levels without manual labor, Donutsorelse designed some affordable smart curtains.
This project should appeal to many of you, because it will work with a wide variety of window treatments. As long as you have curtains on curtain rods, you can probably duplicate the work done by Donutsorelse. His smart curtains can follow a simple schedule or respond to voice commands. The scheduling is perfect for opening the curtains around the time you wake up and closing them in the evening. The voice commands fill in the gaps, letting you close the curtains when you need some privacy, darkness for a movie, or ideal napping conditions.
On the mechanical side, this is quite simple. A motor turns a spool to pull fishing line attached to the curtain. That loops around the end of the curtain rod opposite the motor, so rotating the motor in one direction opens the curtains and rotating the motor in the other direction closes the curtains. An ESP8266 development board controls the motor through a basic L298N motor driver.
If all you wanted to do was open and close the curtains at specific times, the code would be very basic: just pull the network time from Wi-Fi. But Donutsorelse wanted them to open at sunrise and close at sunset times that change throughout the year. To find those times for a particular day, Donutsorelse used the Adafruit.io service to connect to IFTTT and the Open Weather Map API.
The use of IFTTT also allows for integration with Google Assistant. That enables voice commands that override the standard sunrise/sunset schedule. Google Assistant gets a little bit confused with some commands that sound similar to popular search terms, so you may need to experiment to find reliable voice commands. Donutsorelse chose to use the phrase "theater mode," but you may be able to use something else.