Automated Blinds with WiFi and NTP

Motor for Blinds Motor Setup Blinds in Action Blinds in Action Blinds in Action Blinds in Action

Project Overview

This project revolves around an automated blinds system that operates using WiFi and a NEMA 23 stepper motor controlled by an ESP32 microcontroller. The motor was initially too weak to lift the blinds by itself, so I applied a physical solution by incorporating a planetary gearbox. This gearbox amplifies the torque by a factor of 4-5, thanks to its design where one central "sun" gear is surrounded by four "planet" gears. These planetary gears mesh together, distributing the load evenly and allowing for greater torque output without needing to use a larger, more power-hungry motor. This setup enabled smooth, reliable movement of the blinds even under load.

How the System Works

The blinds are controlled through an ESP32 connected to a local WiFi network. The system is synced with NTP (Network Time Protocol) to ensure the blinds operate according to the correct time. It opens in the morning at 6 AM on weekdays and at 9 AM on weekends for a more relaxed start to the day. The blinds automatically close at 10 PM every night to provide privacy and security.

Manual Control and "Sovmorgon" Feature

The system includes manual control via physical buttons on the ESP32. You can press the buttons to move the blinds up or down at specific times, such as 6 AM on weekdays or 9 AM on weekends. The blinds also close at 10 PM every day. If you'd like to skip the automatic operation for a morning, you can press the button to delay or bypass the scheduled opening. This "Sovmorgon" (lie-in) feature allows you to sleep in on weekends or weekdays by disabling the scheduled operation for that day, ensuring the blinds don't open at their usual time.

Key Features

  • The motor’s torque is boosted by a planetary gearbox, improving its performance by 4-5 times.
  • The system syncs with NTP to ensure accurate time-based automation.
  • Manual control via buttons allows for flexible scheduling and manual override.
  • The system saves the last known position of the blinds using EEPROM memory, ensuring they return to the correct position after a power failure.
  • Additionally, my Yeelight lamp is connected to the system to gradually wake me up by simulating a sunrise on weekdays.
View Source Code on GitHub