# [DIY smart window blinds that work with Homekit and Alexa](https://blog.hirnschall.net/diy-smart-window-blinds/)

author: [Sebastian Hirnschall](https://blog.hirnschall.net/about/)

meta description: Automate window blinds with an ESP8266 for under $10. Includes full schematic, Arduino code, and Homebridge setup for Alexa and Apple HomeKit integration.

meta title: DIY WiFi Smart Blinds for $10 — Alexa & HomeKit

date published: 14.08.2020 (DD.MM.YYYY format)
date last modified: 03.04.2026 (DD.MM.YYYY format)

---

Yes, I LOVE Alexa. Unfortunately, I could not find a product to upgrade my existing window blinds to work with Alexa. So, let's go through the design process and how you can upgrade your own blinds to be smart.

Design considerations
---------------------

As always, I like to start with a list of features around which we can design the product.

The smart window blinds upgrade has to be:

* small, unobtrusive and quiet
* compatible with Alexa over wifi
* cheap
* work with my existing window blinds
* ideally also work with Apple Homekit as I am using an iPhone

Parts
-----

At first, I wanted to use a stepper motor to open the blinds, but it was too big and way too noisy. Instead, we'll use a small 9g servo combined with an esp wifi module. We'll need the following parts for one window:

| Component | Quantity | Where to buy |
| --- | --- | --- |
| [esp8266 (12F or 01 recommended)](https://www.amazon.com/gp/product/B07SDMHYY8/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07SDMHYY8&linkId=a2780fd2e9b5d7abc644a1da280efb41) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B07SDMHYY8/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07SDMHYY8&linkId=a2780fd2e9b5d7abc644a1da280efb41) * [Amazon.de](https://www.amazon.de/gp/product/B07DBC7KWN/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B07DBC7KWN&linkId=081fbb3bc96753cce6325506821beb93) |
| [5V to 3.3V step-down converter](https://www.amazon.com/gp/product/B07FSLGPR8/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07FSLGPR8&linkId=ac000a2f4948cc4f2f1dfa7037a9c289) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B07FSLGPR8/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07FSLGPR8&linkId=ac000a2f4948cc4f2f1dfa7037a9c289) * [Amazon.de](https://www.amazon.de/gp/product/B07KQC571X/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B07KQC571X&linkId=9bd3f9b04081b9d0d62a78465b67c674) |
| [9g servo](https://www.amazon.com/gp/product/B07F7VJQL5/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07F7VJQL5&linkId=3b4c47aa9a71196a01ae6acf3a500920) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B07F7VJQL5/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07F7VJQL5&linkId=3b4c47aa9a71196a01ae6acf3a500920) * [Amazon.de](https://www.amazon.de/gp/product/B07FQMTLD4/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B07FQMTLD4&linkId=db000d4162c8900a36cc04758b6e2976) |
| [cheap USB phone charger](https://www.amazon.com/gp/product/B017TXGM4I/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B017TXGM4I&linkId=9754e53935d8b8e1814cd329d7ab39d5) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B017TXGM4I/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B017TXGM4I&linkId=9754e53935d8b8e1814cd329d7ab39d5) * [Amazon.de](https://www.amazon.de/gp/product/B07VQ5JJQK/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B07VQ5JJQK&linkId=9ae72758d8da406e69359ec5266b285a) |
| #CommissionsEarned | | |

We will also (temporarily) need an Arduino to program the esp and one raspberry pi acting as a hub for all Alexa/Homekit projects combined.

| Component | Quantity | Where to buy |
| --- | --- | --- |
| [Arduino Uno](https://www.amazon.com/gp/product/B008GRTSV6/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B008GRTSV6&linkId=1c6cb7b1c28b255f152991f42a7f985c) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B008GRTSV6/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B008GRTSV6&linkId=1c6cb7b1c28b255f152991f42a7f985c) * [Amazon.de](https://www.amazon.de/gp/product/B008GRTSV6/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B008GRTSV6&linkId=0145d74f9e9dedd4686aeed60d74ac70) |
| [Raspberry Pi](https://www.amazon.com/gp/product/B07BC7BMHY/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07BC7BMHY&linkId=44f53ae493089027ad093aaa72a8aec6) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B07BC7BMHY/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07BC7BMHY&linkId=44f53ae493089027ad093aaa72a8aec6) * [Amazon.de](https://www.amazon.de/gp/product/B07DDCRFP6/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B07DDCRFP6&linkId=ef7191994b0abba5e69b8a3a45c2af7d) |
| [microSD Card (for Raspberry Pi)](https://www.amazon.com/gp/product/B06XWN9Q99/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B06XWN9Q99&linkId=2c0e53839c4246a7b9f8eee40a553a72) | × 1 | * [Amazon.com](https://www.amazon.com/gp/product/B06XWN9Q99/ref=as_li_tl?ie=UTF8&tag=bloghirnsch0b-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B06XWN9Q99&linkId=2c0e53839c4246a7b9f8eee40a553a72) * [Amazon.de](https://www.amazon.de/gp/product/B08GY9NYRM/ref=as_li_tl?ie=UTF8&tag=bloghirnschal-21&camp=1638&creative=6742&linkCode=as2&creativeASIN=B08GY9NYRM&linkId=ad861100ee87aaca36d1e3ef4920248c) |
| #CommissionsEarned | | |

### Cost

As most smart home accessories require some sort of hub, we will not consider the raspberry pi's cost. So, all in all, this project is about $6 to $7 per window.

Schematic
---------

As the esp8266 uses 3.3V and the USB charger outputs 5V, we'll use a cheap step down converter. The servo itself uses 5V. You can see how to connect everything in the schematic below. You can (as always) download everything you need to build this project yourself in the download section.

![smart window blinds schematic](https://blog.hirnschall.net/diy-smart-window-blinds/resources/img/sketch.png)


Figure 3.1: Schematic for smart window blinds

Assembly
--------

### Enclosure

To make this project really stand out, I decided to 3d print a custom enclosure. This is not required as you can use any plastic box and make the necessary cutouts with a sharp knife. (Tip: heat the knife up using a lighter to cut through plastic easily).

### Wiring

I used speaker-wire as it is very thick (thanks to all audiophiles), long and cheap. We can cut through a cheap USB cable we no longer need and connect the red (+) and black (-) wire to the speaker-wire.

![finished smart window blinds electronics inside 3d printed enclosure](https://blog.hirnschall.net/diy-smart-window-blinds/resources/img/IMG_3053.png)
![finished smart window blinds electronics inside 3d printed enclosure](https://blog.hirnschall.net/diy-smart-window-blinds/resources/img/IMG_3079.png)


Figure 4.1: Window blinds electronics inside 3d printed enclosure

Software
--------

### Homebridge (Alexa and Homekit integration)

To use our own product with Alexa and Homekit, we'll use Homebridge on a raspberry pi. Please take a look at <https://github.com/homebridge/homebridge-raspbian-image> for detailed instructions on how to install Homebridge.

We will also use the homebridge-alexa plugin and the http-window-blind plugin. http-plugins allow us to easily add DIY smart home products using http and an esp.

### ESP code

We can take a look at the http-window-blind plugin to see how the esp is supposed to respond to requests.

The plugin will use a get variable named "pos" to pass a value between 0 and 100 to the esp, and it expects the response to be json. E.g. {"position":"20"} where 20 is 20% open.

Implementing this is straight forward. Upon an http-request, we map the "pos" value to an angle between 0 and 180 degrees and set the servo position accordingly. You can download the code for this project below.

Now all that's left is to program the esp using an Arduino. We can do this with the Arduino IDE, as seen in this post: [How to program an esp8266 with Arduino.](https://blog.hirnschall.net/how-to-program-an-esp-with-arduino/)

Automation
----------

As the new window blinds work with both Alexa and Homekit, we can use an apple tv for automation. I like my blinds to open and close at sunrise/sunset. Another great feature is automatically closing them when I leave and open them when I arrive at home.

Résumé
------

I am really happy with this project. One of the main goals was to automatically close the blinds as soon as it gets dark outside to prevent people from seeing inside when the lights are on. This works great, and it is a great project to show off :) After all, we automated our window blinds ourselves!

[


DIY automated window blinds in action!
](resources/vid/showoff.webm)


Figure 7.1: DIY smart window blinds in action