Automatic Window Curtains

36,373

237

20

Posted

Introduction: Automatic Window Curtains

Isnt' it a pain to have to actually get up off of the couch to close the curtains? Well I thought so, which led to this project, wireless, automatic curtains that can be controlled over bluetooth and can be set to open/close at a certain time or light level. Documented below is how I went about doing this. I hope you enjoy!

Step 1: Electronics

I like to start all of my project with the electrical part. This is my area of knowledge so I know that I can usually get it done pretty quick. Then the rest of time I can spend on the mechanical parts, with help from friends. Below is what we need to get started for the electronics of this project.

Step 2: Materials Used

All of the components for this can be purchased from GearBest.com for a relatively inexpensive cost.

  • 1x Arduino Nano - link
  • 1x 12V power supply- link
  • 1x Stepper motor- link
  • 1x Stepper driver- link
  • 1x Protoboard- link
  • 1x Bluetooth module- link
  • 1x Real time clock- link

Step 3: Required Tools

  • Soldering iron
  • Solder - link
  • Mini vise - link
  • Brass sponge - link
  • Watch maker glasses - link

I use a mini vise to help me hold the PCB while I solder, these are very handy to have around for any project. I prefer using a brass sponge for cleaning my soldering iron tip over a damp kitchen sponge. The brass ones seem to just work better for me and also last a lot longer, as they are not very prone to heat damage. The watch maker glasses are great for inspecting solder joints. Throughout this project I had a couple of minor shorts caused from the way I decided to assemble this project. these things can be pretty helpful at finding small stands shorting pins. They would also be great for SMD assembly!

Step 4: Layout Components

Before you get to soldering components down, you want to lay them out and make sure that they will fit, of course, if you are using a custom PCB this isn't something that would really be done. I wanted my finished item to have a pretty small footprint and I think I have accomplished that pretty well without a custom PCB.

I decided to put my stepper driver on sideways because it wouldn't really fit the other way. Since the pads on this PCB are not connected, this was not a problem. Once I started soldering, I ended up flipping the stepper driver to the opposite side of the board, as shown in later steps. With only three components it wasn't too difficult to decide where to put things. Regardless of where, the same amount of wiring would be needed.

Step 5: Solder Down Components and Wire

Once I had the components where I wanted them, I stuck the PCB in the vise and got to soldering. Once the main components were in place it was time to start wiring them all together. I intentionally didn't cut the long leads of the components so that I could use them to solder to. On the wires that I actually put through a hole, I created a solder bridge between it and whatever pin it was being connected to.

Here are the connections that I made...

Arduino D2 -> Bluetooth RX

Arduino D3 -> Bluetooth TX

Arduino D10 -> stepper driver ENABLE pin

Arduino D11 -> stepper driver STEP pin

Arduino D12 -> stepper driver DIRECTION pin

Power Supply V+ -> Arduino Vin -> stepper driver VMOT pin

Power Supply V- -> Arduino GND -> stepper driver GND pins -> bluetooth GND

Arduino +5V -> stepper driver VDD -> bluetooth VCC

Stepper driver 1B -> stepper motor GRAY wire

Stepper driver 1A -> stepper motor RED wire

Stepper driver 2A -> stepper motor YELLOW wire

Stepper driver 2B -> stepper motor GREEN wire

NOTE: Not all stepper motors will have the same color pinout!

Step 6: Finished Assembly

My final assembly came out a little messier than I would have liked, but it works! I'm calling this a 'permanent prototype'. If I was not making this to be permanent then I would have likely used headers instead of soldering the Arduino, stepper driver and bluetooth directly to the board.

Step 7: Arduino Code

The code for this is simple. Since the bluetooth module works just like a serial port, I am using the SoftwareSerial library in Arduino to access the signal, allowing me to leave the standard RX/TX pins free so I don't have to disconnect the bluetooth to make program changes. I am using the bluetooth to read a single character that I send to it. Based on the character that it receives, it will either spin the stepper motor clockwise or counter clockwise, opening and closing the curtain. Based on the circumference of the pulleys that I used, I could determine how many revolutions the motor needed to turn. Then take this and determine the correct number of steps that it must turn. I have attached my code. This code has a spot to set the time of a real time clock as well which I will be adding in later.

Step 8: Android Control

To be able to control this curtain from your phone I am going to create an Android app with an open/close button, along with a feature that will let you set the time of the RTC as well as set when you want it to open and close. I will probably be using App Inventor, but I may try my hand using Android Studio. In the meantime, I am using Bluetooth spp pro, which is a free download from the Google Play store. Sending an 'o' will open the curtains, sending a 'c' will close them. It's just that simple!

Step 9: Mechanical Assembly - Parts Used

Here is the list of materials that I used for the mechanical portion.

  • 2x Stepper motor pulleys- link
  • 1x Nema 17 motor mount - had one laying around
  • 1x 5mm bolt
  • 2x 5mm nuts
  • 1x Angle bracket - had one laying around
  • Some screws to mount stuff to the wall
  • Fishing line or other type of string

Step 10: Tools Used

  • Scissors
  • Super glue
  • Drill

Step 11: Mounting the Motor and Free Pulley to the Window

To mount the motor, I simply held up my mount to the wall, and screwed it in, pretty simple right? I did the same thing for the free pulley, check out the pictures to see how I attached the pulley to the right angle bracket. Since there is about a 6'-7' distance between the motor and the pulley, I wasn't terribly concerned with making sure that the two lined up perfectly. I just eyeballed it.

Step 12: Connecting the Fishing Line

Connecting the fishing line was the hardest part of this project. I started by using a high strength, low stretch type of line but realized that have no play was not going to be a good idea. I switched to standard fishing line that can stretch pretty easily. I put one wrap around the idler pulley and pulled the other end to the pulley on the stepper motor. I could then tie the two ends of the line together to make a loop. I then wrapped this loop multiple times around the stepper motor pulley, until the line was tight.

To attach the curtains, I took some binder clips and clipped them to the curtains, after seeing where those clips met the line, I tied them off to opposite sides of the line, so they go in opposite directions.

UPDATE:
I have added a picture/diagram of how I wrapped the fishing line with the binder clips. In the drawing, with the binder clips in the middle, this is the curtains closed. When you spin the motor one direction, the binder clips will go away from each other, opening the curtains. Reverse the motor and they come towards each other, closing the blinds.

Step 13: Future Steps

I plan to make one of these for each window in my apartment. When that happens I will probably custom name the bluetooth modules so I know which is which. I will also make a custom PCB through OSHPark and use connectors for the components. Other minor improvements will probably also occur along the way. As they do, I will be sure to update this Instructable.

I hope that you have enjoyed this and found it helpful! Please ask any and all questions. I am sure that I missed something or didn't explain something fully.

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

19 Comments

Nicely executed, I've been wanting to do something like this myself but I keep postponing it.

Do you know how much torque is needed approximately? And can you also post a picture of how the binder clips are attached to the line?

Would be cool to add a light sensor to this as well to close them automatically when it gets dark.

For the torque, I don't even have a ballpark guess. I'm not so mechanically inclined. I guess looking back I'm lucky that the motor could pull it! For the binder clips, they are just tied with a regular knot. It took me a few tries to get the alighnment of the two clips correct. If you can't get a good tight knot, you could always support it with a drop of super glue.

Going by the model of the stepper motor in the link you've provided,

Holding torque: 0.48N, m

I'm actually doing a similar project for my curtains. However, the torque needed also depends on the weight of your curtains.

Hi there. This looks so amazing! I was saying a while back that I need something like this, and surely it's possible to build one? My apartment windows only face east, so I'd really like to be able to program the curtains to switch positions in the middle of the day - either keep out morning light then let in less-hot afternoon light in summer, or let in warm morning sun then insulate to hold in the warmth on winter afternoons. Today I found a crowd-backing page for something like this called Slide, but at $85 apiece I would love to take on the challenge of learning to do electronics and a bit of coding if I can find a local friend to work with me on it that actually has a bit of experience in those areas (all I can do is basic HTML and super-basic home repairs!) Thank you for providing the directions, pictures, links to parts, etc. Do you think it would be easy to add onto or modify this in such a way that it can connect to wifi and IFTTT? Is the clock part you've added supposed to let you set it to open and close at certain times of day while you're not around to Bluetooth-control it?

Hey! I want to do this project. Wanted to let you know that the clock link is broken. Is it just an led display or an extra part? What if I used a rasberry pi or a different type arduino that had a built in clock function?

Sorry for super late reply! It was a real time clock module that could be read by the Arduino. If you had built in clock function you could do your own clock checking function.

Hi, I was wondering if you can include a picture of your wiring from the power supply to the nano board and step controller.

Are the nano board and step controller both running off direct 12v or is it stepped down before trying into them?

Thanks

Tony,

In step five I layout my wiring scheme. I am running both off of the 12VDC from the power supply. I am putting 12VDC into the Vin of the Nano and to the VMOT pin of the step controller. Hope this helps!

Power Supply V+ -> Arduino Vin -> stepper driver VMOT pin

Power Supply V- -> Arduino GND -> stepper driver GND pins -> bluetooth GND

Mechanically, this is easy for me. Electronically, I'm a noob. I never used an arduino or did any programming. If I didn't want bluetooth and I wanted a physical switch, like a light switch (or maybe keep bluetooth and have the light switch), how would one program this differently? Also does your motor have an auto-stop feature? or does it keep going until you tell it to stop?

Thanks!~ Great instructable!

Since the motor that I am using is a stepper motor, I can tell it exactly how many steps to take. And since I knew how many steps were in one revolution I could easily find out how many turns I needed to get the right distance.

I have been planning on adding a physical switch as well for people without the app or visitors. You would just hook up your switch to the MCU and add an 'or' to the 'i'f statement or something where you are looking for the bluetooth signal. So if you see the bluetooth signal OR you hit the button.