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
CartYou'll need
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.
- Cut a circular gear from wood or chipboard (diameter depends on your blind cord length).
- Glue wooden circles on both sides to prevent the cord from slipping out.
- Build a wooden frame with a hole to hold the stepper motor in a stable position.
- Mount the stepper motor on the frame.
- 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.
- Connect the stepper motor's 4-wire cable to the ULN2003 driver module.
- Connect the driver module to Arduino: IN1→Pin 11, IN2→Pin 10, IN3→Pin 9, IN4→Pin 8.
- Place the power supply module on the breadboard.
- Connect Arduino GND to the breadboard's GND rail.
- 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.
- Open Arduino IDE and create a new sketch.
- Copy the complete stepper control sketch below.
- Upload to your Arduino.
- The Arduino will listen for serial commands from the Raspberry Pi.
#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.
- On Raspberry Pi, open a terminal.
- Run: sudo raspi-config
- Navigate to Interface Options → Serial Port.
- Enable serial hardware but disable serial login shell.
- Reboot your Raspberry Pi.
- Install Python serial library: sudo apt-get install python-serial
- Also install: sudo pip install pyserial
- Connect Arduino to Raspberry Pi via USB.
- Find the port: ls /dev/tty*
- 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.
- Create a new Python file on Raspberry Pi: nano blinds_control.py
- Copy the Python interface code (available in the full tutorial source).
- The interface creates 3 buttons: Roll Up, Roll Down, and Stop.
- Adjust the serial port in the code if needed (default is /dev/ttyACM0).
- 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.
- Run the Python interface: python3 blinds_control.py
- A window with 3 buttons should appear.
- Click 'Roll Up' and watch the motor turn clockwise.
- Click 'Roll Down' and watch it turn counterclockwise.
- 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
- Arduino Blinds ControlBuild another automated blinds project.
- More Arduino projectsExplore intermediate Arduino and Pi builds.
Stuck? Contact Vilros Support with your board model and what you see on screen.