After getting the servo up and running and getting the spool attached, I zip-tied it to my curtain rod and tied the other end of the string to my curtain.
It's hard to tell what's going on in the photo, but the video makes it a bit clearer:
The servo turns, rotating the spool which pulls in the string which is tied to the end of the curtain. After the curtain is drawn in, I then retract the string by rotating the motor in the opposite direction.
However, without any tension on the string it would just bunch up and get all tangled. So I added a bunch of washers along the string to keep tension on the string and allow it to be fully unspooled and ready to be closed in the evening.
So far, the setup is working well! I modified the code to be time-based. I played with the times such that it opens the curtain, and when it retracts the string, the spool is in about the same position as when it started.
You can see the version of the code I used here: https://github.com/jerwil/Automated_Curtains/blob/9ef1e2785eba0738966c18f9046a9eb7b6032e48/Automated_Curtains.ino
If I have time I hope to make this more sophisticated with feedback-based control. For now, I'll be testing out the time-based control to note any drift.
Next step is to be able to set a time so that the curtains automatically open when my alarm goes off!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.