Motorized WiFi IKEA Roller Blind




Introduction: Motorized WiFi IKEA Roller Blind

About: IT-professional by day, DIY hobbyist (among other things) on my free time. I always have one or more projects going on. Usually something to do with home improvement or a tech project or a combination of the t…

I confess. I have been sucked in to a home automation addiction. The next thing on my radar was to automate roller blinds. There are commercial products available but the ones I found are surprisingly expensive (about 80 - 90 USD). Since I need a bunch, it was hard to motivate the purchase (and less fun). I decided to design my own.

If you like this Instructable, please vote for it in the Microcontroller contest (press Vote above)!

These were my requirements:

  • WiFi capable
  • MQTT control (0% - 100%)
  • Manual push button operation
  • Use low cost standard electronic components and 3D-printable parts
  • Persist state on power off

This instructable is a followup to

Step 1: Bill of Materials

The motor parts add up to about 15-20 USD per unit. The shade itself is 19 USD.

Step 2: Wiring

  • Wire the motor to the shield as seen in the pictures. Take note of the colors.
  • Solder cables to the micro switch as seen in the picture. If you can, use red, black and white as in the picture.
  • Attach the button wires to (GPIO) 5 as seen in the picture

Step 3: Set Up a MQTT Broker

MQTT is a lightweight publish/subscribe protocol suitable for small IoT devices. The devices interact with a message broker which manages the distribution of messages. You can either use a local mqtt broker, e. g. Mosquitto inside your own network or connect to a cloud MQTT broker. Which option is best? It depends on your needs. If you want to be able to connect to the broker from anywhere you may prefer the cloud option. If you prefer to keep your IoT within you network you should use a local broker.

Setting up a cloud broker:

  1. Register at CludMQTT:
  2. Creat a new broker instance
  3. Click the instance info and keep the info handy
  4. For testing purposes, download MQTT.fx:
  5. Add a profile to MQTT.fx with the credentials from your newly created cloud broker.
  6. Connect. If it works you have successfully tested the connection to your fresh cloud broker.

Step 4: The Software

The ESP8266 on which the NodeMCU development board is a single chip computer with I/O capabilities and WiFi. The chip can be programmed in various ways. The two most popular options are the Arduino IDE and the Lua interpreter. For this project I chose Lua out of convenience. Some of the features in the software are easier in Lua because of the built in file system.

Flash the Lua Firmware

Even if your NodeMCU is pre-flashed with a Lua firmware I recommend that you re-flash it with a new firmware. That way you get a fresh version and can slim the binary to only contain the needed modules.

  1. Cook a LUA firmware here: Select the following modules: file, GPIO, MQTT, net, node, PWM, timer, WiFi and optionally enable SSL
  2. Wait for the email with the firmware download link, then download. It should only take a few minutes. You may want to check your spam filter for it. That's where mine was.
  3. Download Flash tool:
  4. Flash the firmware using the flash tool
    1. Run the tool
    2. Connect the NodeMCU holding the flash button
    3. Select the serial port
    4. Select the firmware file
    5. Press Flash

Install the rollerblind code

  1. Download the roller blind code here:
  2. Download ESPlorer IDE:
  3. Open Esplorer
    1. Select the serial port
    2. Connect
    3. Open all the lua files
    4. Edit settings.lua and enter WiFi and MQTT settings
    5. Upload all lua files (Save to ESP)
    6. Reset device

    Step 5: Dry Run

    Now would be a good time to check the software and wiring.

    • Open up esplorer and connect
    • Run the following command line (see picture). The motor should rotate 1000 steps (about a quarter of a turn.

    Step 6: 3D Printed Parts

    I designed the parts in Fusion 360.

    Download the parts from and start printing!

    Step 7: Assembly

    This is what you need to do for assembly (watch video):

    1. Heat the soldering iron to about 200 degrees C (400 F).
    2. Embed the nut inserts into the plastics by placing the insert over the tip (so it heats up) and gently push it into the plastic sockets (see picture).
    3. Remove the lever from the micro switch
    4. Loosen the plastic hinge on the lid button (gently push it out and back in)
    5. Push the micro switch in place
    6. Push the motor shield into place
    7. Insert the motor
    8. Screw the plastic parts

    Important note on power: I have found that if you have a narrow window or short travel distance you are fine with just USB power (5v) but for wider and longer blinds you need external power (max 9v DC). You attach external power to the motor shield. Make sure you disconnect USB before you do or you are likely to fry something.

    Step 8: Mount Rollerblind

    Replace the springloaded end mount and insert of the Ikea rollerblind with the printed motor mount and printed insert.

    Step 9: Calibration

    Windows are of different heights; hence the gadget has to be calibrated. This is how:

    1. Long press the button (> 2s)
    2. The shade starts going down
    3. When the shade reaches desired bottom position, short press
    4. When the shade reaches derired top position, short press again
    5. Done!

    Step 10: MQTT Control

    • Download MQTT.fx from here:
    • Start MQTT.fx
    • Create a profile to match the broker you already set up
    • Connect
    • Subscribe to the topic from config.lua e. g. "/house/masterbedroom/#" wihtout the quotes. If you don't have anything else on your broker bus you can subscribe to everything (e. g. "#")
    • You should see heartbeat messages sent out from the device every two minutes
    • To control the device, publish to the topic matching config.lua "/house/masterbedroom/rollerblind/0/set"

    Of course, this setup is obviously not terribly useful for daily operation but it will help you weed out any potential problems. If you just want to control mqtt devices you can download a MQTT cotrol dashboard on you phone. If you want to use other general home automation software I think you should find that most support MQTT integration.

    Step 11: Integration With Openhab (optional)

    I will give you an example of integration with the home automation solution I am using. If you have a pre-installed openhab home automation solution or would like to set one up (there are guides on their home page), this is what you should do to integrate the roller blind.

    1. Install and configure the openhab according to their instructions
    2. Install MQTT binding
    3. Configure MQTT binding for your previously configured broker (local or cloud)
    4. Add the roller blind to your items and sitemap file. See example below.


    Dimmer masterbedr_blind1 "Rullgardin 1" <rollershutter> { mqtt=">[ohab:/house/masterbedroom/rollerblind/0/set:command:*:${command}],<[ohab:/house/masterbedroom/rollerblind/0/status:state:default]" } 


    Slider item=masterbedr_blind1
    Microcontroller Contest 2017

    Runner Up in the
    Microcontroller Contest 2017

    7 People Made This Project!


    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    148 Discussions


    3 years ago

    I have an issue, when the blind goes down, the lights on my stepper driver stay lit. I do not think the power to the coils is being turned off.

    When the blind goes up, the lights turn off at the end and the power to the coils stop.

    Why would the power to the coils stay on when the blind goes down? I have looked at the code and cannot see any reason why.

    In the morning when the motor should open the blind it fails due to being really hot.


    Reply 3 years ago

    In the original code I left one pin active when the blind is down. The reason was that I was having problems with gravity pulling the blind down further than I wanted if there was no power. In retrospect, keeping it powered was not the best solution. I belive I changed the code in the repo a while back so that it turns all pins off but I'm not sure. There are (at least) two much better ways to fix the gravity problem. 1) cut the blind (at the top) so that when it is down it is all the way out. 2) modify and use the original spring to counteract gravity. This was suggested by another reader. Remove the spring lock and put the spring on the opposite side from the motor.


    4 months ago

    Hey, did anyone already work on controlling multiple blinds with one esp? i have 4 big windows in a row and think i will have to use an arduino instead esp.


    Question 4 months ago

    How well does this integrate with Alexa?

    Can this be configured in OpenHAB to have different states? Looking to schedule a blind opening and closing at sunrise/sunset.


    5 months ago

    Anyone have any idea which alternative IKEA roller blinds use this same mechanism? I bought the parts and most of them are here only to see that TUPPLUR is not on the website anymore... (I was waiting for them to get stock again).


    5 months ago

    Pay attention to the presence of the jumper. Delivery goes without it.

    If you do not use it, power will not go to the motor and must be supplied separately. This is necessary when you use a power supply for the motor greater than 9v, so as not to spoil the board


    8 months ago

    Hello everybody,
    First of all, thank you to ehsmaes for this nice project. I'm relatively new to this world, and I have two questions:
    - I would like to do this project, but since I have an IR-FR (broadlink rm pro) controller, I would like to send the order to the controller by this method. Can you recommend me some alternative to this development board but without wifi?I would like to do it this way because I imagine the power consumption will be lower, and use the other device.
    - My blinder model is 2 meters long, and I don't know if this small motor will be able to do the job. Do you think the 12V version will be enough or should I choose another type, like a NEMA 17?.
    Thank you in advance for your help.


    Reply 5 months ago

    I tried 1.8 meters, made of polyester. The motor is missing. Tried 5v and 12v. Both in full step and half step mode.


    Reply 7 months ago

    Curious about this as well


    Question 6 months ago

    I have tried to finish this project, i used Svenn github code and Lua version 1.54. Everything seems to work fine, however when I try to send step_move command, my motor just vibrates instead of moving.
    Wiring is connected the same way as on the pictures above. I am using USB cable connected to PC and ESP8266 to power up the setup.

    Some advice to fix this?


    Answer 5 months ago

    The first is the wrong motor connection. I also encountered this when I cut the board inside the motor. I tried to make it more powerful, turn it into a bipolar one.

    In the code, Svenn prescribed what connects where. Check
    stepper_pins = {1,3,2,4} -- (A-)blue, (A+)pink, (B-)yellow, (B+)orange


    7 months ago

    I managed to get my motor spinning. Im though very uncertain that that small motor will be able to pull my 180cm curtain.. Will try tomorrow. Struggled a lot with the firmware and the fix for me was to use the 1.5 version of lua and not version 2.0


    Tip 1 year ago on Step 11

    I had sucess with this project, but I struggled big time. Follow this guide, but
    1. Use ssvens files
    2.Connect a 5 volt external power supply to the sheild.
    3.When you make a lua firmware chose the older one 1.50
    if you do this you should be good to go


    Reply 1 year ago

    What did you use for the external 5v power supply to the shield? I've done red to gnd and the motor is still not turning


    Reply 1 year ago

    I am having the same problem, no motor movement. Did you solve this?


    Reply 1 year ago

    No not yet


    Reply 8 months ago



    Question 2 years ago on Step 7

    Do you have any instructions for hooking up an external power supply on the motor shield? My blinds are quite long and so the motor seems to have not enough power to get the blind back up.



    Answer 1 year ago

    Did you find any solutions or guides on this? Because I will be having the same problem