Curtain automation is one of the most satisfying smart home upgrades you can build. Imagine your curtains opening automatically at sunrise, closing at sunset, or responding to your voice command — “Hey Google, close the bedroom curtains.” With a stepper motor, a motor driver, and an Arduino or ESP32, you can automate any existing curtain rod for under ₹1,000. No need to buy expensive commercial smart curtain systems that cost ₹5,000–₹20,000.
This guide covers the mechanical design, electronics, and code for building a reliable curtain automation system suited to Indian homes.
Why Automate Your Curtains?
- Energy savings: Close curtains during afternoon sun to reduce AC load by 15–25%
- Natural wake-up: Curtains open gradually at your wake-up time, letting natural light in
- Security: Automated curtains simulate presence when you are away on holiday
- Privacy: Close curtains automatically at sunset — no more neighbours peeking in
- Convenience: Essential for hard-to-reach curtains (high windows, behind furniture)
Choosing the Right Motor
28BYJ-48 Stepper Motor (Budget Choice)
The 28BYJ-48 is a small, inexpensive stepper motor that works well for lightweight curtains:
- Torque: ~3.4 mN·m — sufficient for net curtains and light fabric
- Speed: Slow and quiet (about 15 RPM)
- Cost: ₹60–₹100 (with ULN2003 driver)
- Best for: Sheer curtains, vertical blinds, light drapes
NEMA 17 Stepper Motor (Heavy Curtains)
For heavier curtains (blackout curtains, thick drapes), the NEMA 17 provides much more torque but needs a more powerful driver like the A4988.
Components Required
| Component | Price (₹) |
|---|---|
| 28BYJ-48 stepper motor | 60–100 |
| ULN2003 driver board | 40–70 |
| ESP32 or Arduino Nano | 200–350 |
| GT2 timing belt + pulleys | 150–250 |
| 3D printed or metal brackets | 50–150 |
| 5V power supply | 80–120 |
| Push buttons (2 pcs) | 20–30 |
| Total | ₹600–₹1,070 |
Mechanical Design and Mounting
The most reliable mechanism for curtain automation is a timing belt system:
- Motor mounting: Fix the stepper motor at one end of the curtain rod using a 3D printed bracket or an L-shaped metal bracket
- Timing belt: Attach a GT2 timing belt pulley to the motor shaft. Run the GT2 belt along the length of the curtain rod
- Curtain attachment: Attach the curtain hook carrier to the timing belt using a small clamp
- Idler pulley: Mount an idler bearing at the opposite end of the rod to guide the belt around
When the motor rotates clockwise, the belt pulls the curtain open. Counter-clockwise closes it.
Alternative mechanism: For simple vertical blinds, attach the motor directly to the tilt rod using a coupler. No belt needed.
Arduino Code for Curtain Control
#include <Stepper.h>
#define STEPS_PER_REV 2048 // 28BYJ-48 in full-step mode
#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11
#define BTN_OPEN 2
#define BTN_CLOSE 3
// Adjust based on your curtain width
#define FULL_OPEN_STEPS 10000 // Steps to fully open curtain
Stepper stepper(STEPS_PER_REV, IN1, IN3, IN2, IN4); // Note wire order!
int currentPosition = 0; // 0 = closed, FULL_OPEN_STEPS = open
void setup() {
Serial.begin(9600);
stepper.setSpeed(10); // RPM - keep low for quiet operation
pinMode(BTN_OPEN, INPUT_PULLUP);
pinMode(BTN_CLOSE, INPUT_PULLUP);
Serial.println("Curtain Controller Ready");
Serial.println("Press OPEN or CLOSE button");
}
void openCurtain() {
int stepsNeeded = FULL_OPEN_STEPS - currentPosition;
if (stepsNeeded <= 0) {
Serial.println("Already fully open");
return;
}
Serial.println("Opening curtain...");
stepper.step(stepsNeeded);
currentPosition = FULL_OPEN_STEPS;
disableMotor(); // Save power when not moving
Serial.println("Curtain OPEN");
}
void closeCurtain() {
int stepsNeeded = currentPosition;
if (stepsNeeded <= 0) {
Serial.println("Already fully closed");
return;
}
Serial.println("Closing curtain...");
stepper.step(-stepsNeeded);
currentPosition = 0;
disableMotor();
Serial.println("Curtain CLOSED");
}
void disableMotor() {
// Turn off coils to save power and reduce heat
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}
void loop() {
if (digitalRead(BTN_OPEN) == LOW) {
delay(50); // debounce
openCurtain();
while (digitalRead(BTN_OPEN) == LOW); // Wait for release
}
if (digitalRead(BTN_CLOSE) == LOW) {
delay(50);
closeCurtain();
while (digitalRead(BTN_CLOSE) == LOW);
}
}
Adding Smart Features
Light-Based Automation
Add an LDR sensor to automatically open curtains at sunrise and close at sunset:
#define LDR_PIN A0
#define DAWN_THRESHOLD 400 // Adjust based on your room
#define DUSK_THRESHOLD 200
void checkLightLevel() {
int light = analogRead(LDR_PIN);
if (light > DAWN_THRESHOLD && currentPosition == 0) {
openCurtain(); // Dawn - open curtains
}
else if (light 0) {
closeCurtain(); // Dusk - close curtains
}
}
WiFi and Voice Control
Use an ESP32 instead of Arduino to add WiFi, web control, and Google Assistant integration via Sinric Pro. Map the open and close actions to virtual switch states.
Timer-Based Schedules
With an RTC (Real Time Clock) module or NTP time sync on ESP32, set specific times for curtain operation:
- Open at 6:30 AM on weekdays
- Open at 8:00 AM on weekends
- Close at 7:00 PM daily
Frequently Asked Questions
Can the 28BYJ-48 handle heavy blackout curtains?
The 28BYJ-48 is best for lightweight curtains. For heavy blackout curtains, use a NEMA 17 stepper motor with an A4988 driver. NEMA 17 provides 10–20 times more torque but costs ₹300–₹500 more.
Is the motor noisy?
The 28BYJ-48 is one of the quietest stepper motors available. At 10 RPM, it produces a gentle humming sound that is barely audible. Mounting it on rubber dampeners further reduces vibration noise.
How does the system know the curtain position after a power cut?
After a power cut, the system loses position tracking. Solutions: (1) Add limit switches at both ends and run a homing sequence on startup, (2) Store position in EEPROM/flash memory and restore on boot, (3) Use an encoder on the motor shaft for absolute position tracking.
Can I partially open the curtain?
Yes. Instead of calling openCurtain() (full open), call stepper.step(halfSteps) to open to any position. Add a “half open” button or a slider control in the Blynk app.
What about roller blinds?
Roller blinds are even easier to automate — connect the motor directly to the roller shaft using a coupler. No belt needed. The motor rotates to roll the blind up or down.
Conclusion
Curtain automation is a surprisingly practical smart home upgrade that improves both comfort and energy efficiency. Opening curtains to natural light instead of an alarm clock makes mornings more pleasant, and automated evening closing gives you consistent privacy without remembering to do it. At under ₹1,000 for a basic setup, it is one of the most affordable comfort upgrades for any Indian home.
Get your stepper motor, driver board, and ESP32 from Zbotic.in and start automating your curtains today.
Add comment