Skip to content

Smart Home Automated Blinds

Build your first smart home device: automated window blinds controlled by Arduino and Raspberry Pi with a stepper motor.

  • Arduino
  • Intermediate
  • 120–150 minutes
  • 6 steps

Shop this project

Cart

Prices from vilros.com. Tax and shipping at checkout.

Before you start, you'll need

  • Arduino Mega 2560 (or Uno)
  • Raspberry Pi 4 (any model with GPIO)
  • Stepper motor (28BYJ-48 recommended)
  • ULN2003 stepper motor driver module
  • Breadboard
  • Power supply module
  • Wood or chipboard for frame
  • Glue, screws
  • Jumper wires

Build the gear mechanism

About 30 minutes

Create a wooden gear to pull the blind cord.

  1. Cut a circular gear from wood or chipboard (diameter depends on your blind cord length).
  2. Glue wooden circles on both sides to prevent the cord from slipping out.
  3. Build a wooden frame with a hole to hold the stepper motor in a stable position.
  4. Mount the stepper motor on the frame.
  5. Attach the gear to the motor shaft (use a bottle cap with a hole as a coupler if needed).

You should see

The gear is attached to the motor shaft and rotates smoothly when the motor turns.

Connect the stepper motor

About 20 minutes

Wire the ULN2003 driver and stepper motor to Arduino.

  1. Connect the stepper motor's 4-wire cable to the ULN2003 driver module.
  2. Connect the driver module to Arduino: IN1→Pin 11, IN2→Pin 10, IN3→Pin 9, IN4→Pin 8.
  3. Place the power supply module on the breadboard.
  4. Connect Arduino GND to the breadboard's GND rail.
  5. Connect the ULN2003 driver's GND and power pins to the breadboard.

You should see

All connections are made and the driver module powers on.

Program the Arduino

About 15 minutes

Upload stepper control code to Arduino.

  1. Open Arduino IDE and create a new sketch.
  2. Copy the complete stepper control sketch below.
  3. Upload to your Arduino.
  4. The Arduino will listen for serial commands from the Raspberry Pi.
cpp
#include <Stepper.h>

const int stepsPerRevolution = 2048;
const int rolePerMinute = 10;

Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);

void setup() {
  myStepper.setSpeed(rolePerMinute);
  Serial.begin(9600);
}

String RecentInput = "";

void loop() {
  if (Serial.available() > 0) {
    String IncomingInput = Serial.readString();
    RecentInput = IncomingInput;
    
    if (RecentInput == "ROLL UP!") {
      Serial.println("clockwise");
      myStepper.step(stepsPerRevolution);
    }
    
    if (RecentInput == "ROLL DOWN!") {
      Serial.println("counterclockwise");
      myStepper.step(-stepsPerRevolution);
    }
  }
}

The stepper motor uses 2048 steps per full revolution. Adjust rolePerMinute for speed.

You should see

The sketch uploads successfully to Arduino.

Configure Raspberry Pi serial

About 15 minutes

Enable serial communication between Pi and Arduino.

  1. On Raspberry Pi, open a terminal.
  2. Run: sudo raspi-config
  3. Navigate to Interface Options → Serial Port.
  4. Enable serial hardware but disable serial login shell.
  5. Reboot your Raspberry Pi.
  6. Install Python serial library: sudo apt-get install python-serial
  7. Also install: sudo pip install pyserial
  8. Connect Arduino to Raspberry Pi via USB.
  9. Find the port: ls /dev/tty*
  10. Look for /dev/ttyACM0 or similar.

You should see

Serial is enabled and Arduino is detected at /dev/ttyACM0.

Create the control interface

About 25 minutes

Build a Python GUI to control the blinds.

  1. Create a new Python file on Raspberry Pi: nano blinds_control.py
  2. Copy the Python interface code (available in the full tutorial source).
  3. The interface creates 3 buttons: Roll Up, Roll Down, and Stop.
  4. Adjust the serial port in the code if needed (default is /dev/ttyACM0).
  5. Save and exit (Ctrl+X, Y, Enter).

You should see

The Python file is saved and ready to run.

Test the smart blinds

About 15 minutes

Verify the complete system works.

  1. Run the Python interface: python3 blinds_control.py
  2. A window with 3 buttons should appear.
  3. Click 'Roll Up' and watch the motor turn clockwise.
  4. Click 'Roll Down' and watch it turn counterclockwise.
  5. Attach the blind cord to the gear and test with actual blinds.

You should see

The motor responds to button clicks and can control the blind cord.

It didn't work
  • Motor doesn't turn.

    Check all wiring connections. Verify the Arduino is receiving power and is connected to the Raspberry Pi. Check Serial Monitor on Arduino to see if commands are arriving.

  • Python serial error.

    Verify the serial port name. Try /dev/ttyACM1 or /dev/ttyUSB0 if ACM0 doesn't work. Ensure pyserial is installed.

What to do next

Stuck? Contact Vilros Support with your board model and what you see on screen.