Details

The goal of this project is to create a lower cost alternative to motorized curtain rods, as well as making curtains WiFi controllable.

The current set up uses a NodeMCU and LLC as a pseudo WiFi shield. Because of this, there are two Arduino sketches. The sketch for the "shield" hosts a REST server, with an endpoint at "/curtains" that accepts the parameter "command." The sketch for the base Arduino Uno receives serial commands from the shield, and runs the motor accordingly.

Additionally, I would like to add hall effect sensors at the center and one end of the curtain rod to detect when to stop running the motor, rather than relying upon a finite passage of time.

A future version might remove the Arduino Uno and motor shield in favor of using only the NodeMCU and a motor driver.

Project Logs

I went to Menards over the weekend, and picked up some polyester rope, which has almost no stretching issues. I was previously using 550 paracord, as it was all I had on hand. Additionally, I now have 3 turns of rope on each pulley, so there is plenty of friction to move the curtains.

Another upgrade was the replacement of the 9V power supply with a 12V supply. The motor I use is 12V, so it was initially underpowered. Now, it is working better than ever.

I still need to implement the hall effect sensors to eliminate the timed opening and closing.

Discussions

Become a member

Hey Kyle, really cool project! Was looking for a similar way to automate the curtains in my living room. Not sure if this project is still updated, but was wondering if you had any suggestions on way to improve your setup that have not been disclaimed here. Thank you for your help!

I didn't at the outset, as I was going for simplicity and was working with what I knew. Now that I have more time, I think it would be easy to modify my "shield" code to work with MQTT, and hubs/software that host MQTT servers.

It might also help me regain some of the speed I lost when reworking the REST server on the Node.

As far as the HTTP "server" on the NodeMCU, you can take a look at the code linked on the page. It basically reads the packet from the WiFi client, determines the HTTP verb, and handles the request based on that. It slightly slower than I would have liked, but it now works as a RESTful switch with GET requests returning the state and POST requests for state updates. My initial build used my modified version of the aREST library, but only handled GET requests with different query parameters.

As far as the "hub" is concerned, I have a Raspberry Pi set up as a wireless access point, and all of the DIY WiFi sensors I build connect to it instead of our main router. The Pi/Hub is what sends the HTTP requests to each node, and I use python and the requests library to do that.

Perhaps a little long winded for a comment, but I hope it answers your question!

Strangely I was looking at my bedroom curtains this morning, vaguely wondering if I should automate them (my bedroom is cramped making getting to them difficult), and Voila! I see your project featured on Twitter this evening. I wish you every success and will be following closely.

Thank you! I'm working on getting all the code and CAD posted to the project so it can be replicated. I tried to use the least expensive components as possible (including some that were already on hand), but there are many different ways to go about it to simplify the set up.