banner
Home / Blog / Marek Fiala's ESP32
Blog

Marek Fiala's ESP32

Jul 12, 2023Jul 12, 2023

Student Marek Fiala has penned a guide to building your own smart curtain system for existing drapes — using, of course, the company's ESP32 system-on-chip, in the form of the ESP32-DevKitC development board mounted on a custom PCB.

"Recently, I’ve been sitting behind my computer, which is unluckily situated against a window. Sharp late-afternoon sunlight made me think about some intelligent system that recognizes this light and closes the curtains," Fiala explains. "As home automation has become more and more widespread in recent years, there are many options available on the market that solve most of the common problems we have daily. However, talking about intelligent curtains systems, most of the available solutions require replacing the whole curtains’ holders like rods or rails. I wanted to develop a system adaptable to curtains that are already in use."

Fiala's aftermarket add-on for existing curtains is built around an Espressif ESP32-DevKitC development board, connected to a NEMA17 stepper motor and driver, a thermistor to detect overheat conditions in the motor should the curtains get stuck, a light sensor to decide when the curtains should be opened or closed, and a DC/DC buck converter to power the development board from a 12V supply. There's also a reed switch, Fiala notes.

"A key feature to call this system automated is the reed switch," Fiala explains. "After plugging the system into electricity, it automatically starts moving the curtains. Neodymium magnets are placed on the belt, which are detected with the reed switch when the system is fully opened or closed. That’s how the system is initialized and ready to move to certain positions."

The finished project includes three operation modes, programmed using the Arduino IDE. In "light mode," the curtains are automatically opened and closed depending on ambient light levels detected by the light sensor. In "time mode," the curtains operate based on a weekly timetable. In "manual mode," finally, the user can choose to open or close the curtains on-demand via MQTT messaging handled through a Home Assistant server.

Fiala's full project write-up is available on the ESP Journal now; the project GitHub repository has source code, a schematic, and Autodesk Fusion files for 3D-printed parts for the project under an unspecified open source license.