DIY Smart Home Upgrade: Turn Your IKEA Curtains Into Smart Blinds

by MichielvanBeers in Circuits > Microcontrollers

8060 Views, 102 Favorites, 0 Comments

DIY Smart Home Upgrade: Turn Your IKEA Curtains Into Smart Blinds

High res demo IKEA curtain 20fps.gif

With being active in home automation for the last 5 years, I’ve by now (like most of you) automated all my lights and put temperature and humidity sensors on more places than strictly necessary. So, it only logical next step in my home automation journey is.. automating my curtains!

I quickly figured out that the off-the-shelf solutions are either expensiveneed charging or simply don’t exist for curtain rods. So the only logical step is to go the DIY route!

Supplies

3D printer for:

  • 1 timing belt clip,
  • 2 stepper motor mounts
  • 1 box for electronic
  • 1 lid

Installing the Hardware

Stepper motor.png
Timing clip.png
powerpnt_hvlsfyn6a3_DbXI4mlL45.png
Slide1.PNG
Enclosure.png
  1. Alright, so I’m going to assume that you already have a working curtain that moves — reasonably — smoothly. First, let’s connect the mount to the brackets.
  2. Next, let's add the timing belt and the clip around the stepper motors

We’re getting there!

The next step is to connect the belt clip to the belt and the curtains. Here you can find a schematic of how it will open and close the curtains. To connect the clips, I recommend first completely opening the curtains and then connecting the left curtain on the top of the timing belt and the right curtain on the bottom of the timing belt.

Now that the stepper motors are in place, it is time to wire everything up and put it in the enclosure to ensure WAF.

D1 > EN(ABLE) // Turns the steppers on/off before/after the operation 
D2 > DIR(ECTION) // Sets the direction of the stepper
D3 > STEP // Does the actual turning of the stepper motor
D4 > STEP // Linking D3 back to D4 and STEP allows keeping track of the number of pulses that have been sent to the A4988 and thus telling the device what the current position is

Though this overview is pretty straightforward, there are some things to keep in mind:

  1. I didn’t use a stepper motor parallel board but split one cable into two
  2. Make sure to use high-quality connectors (I had some issues with one stepper not working due to this. Definitely hard to debug)

Setting Up the Software

Config.png
Hotspot.png
Tasmotizer.png

To make the stepper motors spin, we will be using Tasmota. Though Tasmota is a peace of home automation software that can do a lot, I will focus on setting it up for only the blinds here.

Install Tasmota on ESP chip

  1. Download Tasmotizer.
  2. Open Tasmotizer
  3. Click on the Refresh button
  4. Note down which COM ports are already shown
  5. Connect your ESP8266 via USB
  6. Click on refresh again and select the newly added COM device
  7. Under ‘Select image’ click Release
  8. Click Tasmotize!
  9. Wait until done

Setup wifi

  1. Look for and connect to a wifi network called tasmota_XXXX
  2. Connect.
  3. A browser should open automatically. If not, go to http://192.168.4.1
  4. Fill in the Wifi SSID and Password.
  5. Save
  6. Connect to the same network and look up the IP-address
  7. You should be seeing the

Configuring Tasmota

Right, we’re getting there. Now it is time to configure the module so it knows which pins to use

  1. Go to Configuration > Configure Module
  2. Set Module Type to ‘Generic (0)’
  3. Save and wait until rebooted
  4. Go again to Configuration > Configure Module
  5. Set the following configuration:
  6. D3 > PWM 1
  7. D4 > Counter 1
  8. D2 > Relay 2
  9. D1 > Relay_i 1
  10. Save and wait until rebooted
  11. Click on Console
  12. Enter the following commands in the console, tapping enter after every line (directly taken from the Tasmota documentation):
a) Set ShutterMode 4 Backlog PulseTime1 0; PulseTime2 0 // for relay Relay1i and Relay2 
Interlock OFF // this is a global variable for all Relays or at least the RELAYS NOT in the Interlock group PWM1 and COUNTER1 defined

b) Enable Shutters SetOption80 1 // this is a global variable for all Shutters

c) Configure Shutter 1 and test ShutterMode 1 is working ShutterRelay1 1 // for relay Relay1i and Relay2

d) Set the stepper motor speed (optional setting) ShutterFrequency 1500 // this is a global variable for all steppers (1000rpm by default)

e) Set at least a small ramp-up/ramp down period 1.0 second (optional) ShutterMotorDelay1 1.0 // Stepper do not like infinite momentum. Ramp up/down speed allow much higher frequencies.

f) Restart Tasmota Restart 1

Testing and doing shutter calibration

Now that we have everything wired up and the module configured, we should be able to control the steppers, nice! Let’s test them:

  1. Navigate to the console
  2. Enter ‘ShutterOpen1’ in the console (NB: Make sure to have the ShutterStop1 command ready since your motors will start spinning immediately! If it is the wrong way, they might get stuck)
  3. Enter ‘ShutterClose1’ to close them
  4. Optionally set ‘ShutterInvert1’ they are spinning the wrong way
  5. If your blinds are currently open, enter ‘ShutterSetOpen1’. If they are closed, enter ‘ShutterSetClose1’
  6. Set an initial number for the number of seconds it should take to open or close the current. Set these by entering ‘ShutterOpenDuration X’ and ‘ShutterCloseDuration X’
  7. Click on Main Menu and use the up and down arrow to try your setup
  8. Adjust the timings until you have something fully opens and closes the curtain
  9. Use the slider to set the curtain to 50% open
  10. Enter ‘ShutterSetHalfway1 50’ to also calibrate what 50% open is

Congratulations 🎉 !! You are now the official owner of a one-of-a-kind smart IKEA curtain that can be controlled while lying on the couch.

Optionally: Connect With Home Assistant

chrome_nOWXswGdfI.png

Of course, an IoT curtain is fun, but what we really want is to be able to run some automations so everything goes automagically. Some automations I have at home:

  1. Open/close the curtain at sunrise/sunset.
  2. Auto-close the curtain when the sun is shining bright to prevent the floor from discolouring.
  3. Auto-close the curtain when I lock the backdoor and the sun is below the horizon.

Home Assistant is one of the best (if not the best) tools out there for running these kinds of automations. If you haven’t heard of them yet, check them out here.

What do you need to connect the curtain to Home Assistant?

  1. Go to the Console
  2. Enter ‘SetOption19 0’
  3. Go to the Main Menu > Configuration > Configure MQTT
  4. Enter the following values:
  5. Host > IP address of your broker, most likely the same as Home Assistant
  6. Port > Don’t change
  7. Client > Don’t change
  8. User > Enter User of MQTT Broker
  9. Password > Enter Password user in MQTT Broker
  10. Topic > Don’t change
  11. Full Topic > Don’t change
  12. Click Save
  13. Go to Home Assistant > Integrations > + Add Integration
  14. Search for Tasmota and click on it (more details here)
  15. Your curtain should show up under the Tasmota integration ready to be used 💃🏻

Wrap-up

That is it! For me personally, this was one of the tougher projects to get right, since they are a lot of custom things. I hope that I have been able to help you get started with your own smart curtains or inspire a completely different approach. 


Additional Readings and Acknowledgements

Since this project runs on loads of cool open-source projects I would definitely recommend checking out the documentation and showing some ❤️ to the people who created those.