[RELEASE] ESP8266 / Arduino servo controlled smart blinds

Did this post happen somewhere else? got a link?

Of course as soon as I opened my big mouth I started having issues with
charging and power consumption. I’m debugging now

@jetpuff great work with the 3d printed gearbox.

I’m trying to upgrade my Heath Robinson style blind servo mount with your gearbox, but my blinds have 37.5mm internal width - so it doesn’t fit.

See photo.

I’ve got a bunch of these blinds at home, and in the UK it’s a popular size. Would be great to have a printable gearbox to fit.

I have tried editing the STL in tinkercad but have got nowhere.

Any suggestions? Can you help please, or are you able to offer the source 3D design file?
Thanks

2 Likes

@jetpuf

Thanks for all your time and effort on this project!

I just finish installing the sketch and device handler. I started testing and I notice that SmartThings Tile doesn’t update when I send a command using the webpage (the servo does moves to the correct position). Also, ST doesn’t update if I use the “manual” switch attached to GPIO12 to move the position. Lastly, if the ST switch is “Closed” and I change the percentage using the slider, the ST switch doesn’t turn to “Open” but the Servo moves to the correct percentage.

Is that the correct behavior? Any way we can always keep ST updated with the actual position of the blinds?

Thanks in advance.

Thank you for all the hard work.
i have got the chip up and running and copy and pasted the groovy code into a device handler. but after that i cant seem to get to the next step if any one could help that would be awesome thanks

I finally made a post about my solution, check it out:

3 Likes

Ok finally got it working and made a qiuck write up to hopfully save peoples time here goes nothing

1)Log In to Smartthings => My Device Handler
Click on to the Create New Device Handler top right of the page
2)GO to


Open the file esp8266-adjustable-blinds-beta.groovy
click raw copy all then paste it in to the smartthings Device Hander uder the tabe From Code
Click the Create button then Click Save, Then Publish for me
3)Go to My Devices => New Device
Details
Name - What ever u want for a name
Lable -
zigbee -
Device Network id - unique Id that none of the other devices have it will change once created
Type - Scrole down to ESP8266 - Adjustable Blinds Beta
Publish - Publish
Locations - yours
Hub - yours
Click Create
4)Now on to the setup Of the ESP8266 This site helps out

Also download the Arduino IDE from
https://www.arduino.cc/en/Main/Software
I did run in to a few problems at first
-Getting a good USB cord
-I also had a hard time with the Bit Rate I started high then worked down until i could see letters on the serial monitor using the AT command
then went past then back up to 115200 then it worked
-Then Closed the Serial Monitor then i could flash the chip after the first go it worked every time after not sure why
5) the code i used was the SmartBlinds.ino Same as the Smarthings copy and paste

Then edit your ssid and wifi password => compile it then flash it if there is no errors
6)Go to the smartthings phone App
Click on the name you gave to your device that you just added
Click on the Gear and Input the ip of your ESP8266 and Port (eg.80)
Click done
7)NOw test if and see if it works if so crack a cold one. IF… your like me and you can access it only by webpage typing in the ip of the ESP8266
but not form Smartthings then you have to turn your wifi from WEP2 to WEP. then retest. i had this problem took 3 days to find out why it didnt work.
If its still not working make sure your ip is correct and make sure its a static IP so when the chip restarts it gets the same ip.

Thanks to Jepuf For the hard work
If i am missing Anything please feel free to add to it.

2 Likes

Thanks for this. Now I know what to do with this servo that my friend gave me. I guess it does meet the minimum requirements for such mechanism. :slight_smile:

1 Like

I’m using @blebson version of the gear box because I want to include the paddle switch for manual control (for wife approval). However, I’m using the esp8266 with your code because I’m new to this world and it seems a little over my head to get that hub setup. My question is, I noticed that your code includes a reference to a manual control through GPIO12 or D6 pin. I’m afraid I’ll short my board out if I try my solution and I’m wrong but do I connect one side of an (ON)-OFF-(ON) momentary paddle switch to ground and the other side to voltage (off the board somehow?) and then run the middle wire to the D6 pin so that it opens or closes depending on whether D6 sees voltage or ground? By the way, I’ve got your setup working already through the D3 pin already and it’s great! Thank you so much for putting this together. It’s a dream project for me to learn all this. I even bought a 3D printer this week. Thanks again for any help!

1 Like

Don’t quote me but I did a test on a node and I went to ground I do believe and it just goes in one direction then hits the end and goes back the other way. I have a question for you Jacob, how did it go setting it up on a 8266? I want to buy one because there cheap and small.

Connecting digital pins to ground wont cause a problem as they already have internal pullup resistors that will just allow a small bit of current through and not damage the pin.

I had a bit of trouble getting the driver installed on Mac OS X High Sierra because it wasn’t digitally signed but I finally found one that was so from there it was smooth sailing with @jetpuf imgur walkthrough tutorial that he linked on this page. By the way, I was able to figure out the manual switch and hook it up to a toggle successfully. You’re right that it just goes in one direction until it hits 0° or 180° and then the same switch will reverse the direction. I actually modified the code a little to use a toggle switch so I could go either direction without having to hit the stop point. If anyone wants it, just ask. But to answer my question in case anyone is wondering the same thing, you can take any ground pin on the board and send it to the D6 pin and it will operate the blinds as you described.

Hey Jacob, good to hear you got it working.
I would be interested in that. Also what Esp8266 did you use was it a Esp8266 01 if so how many pins can you use on it. I just ordered ESP01 and a programme for it should be coming in 3weeks.

Makerfocus 2pcs ESP8266 Serial Wireless Module CH340 NodeMcu V3 Lua WIFI Internet of Things New Version Development Board EK1677 Arduino Compatible https://www.amazon.com/dp/B01N8UUE3L/ref=cm_sw_r_cp_api_4Mp8zbQ7PQ014

I’m really new to all this but that’s the chip I used. I’ve ordered the Wemos D1 Mini for the rest of my blinds because I’ve read they fit better and use the same chip.

Ok so your running the same as me then I want to use a ESP01 think it only has two usable io on it but there only 3.50us

I can tell you from experience that the ESP-01 is a lot harder to use in a design when compared to a NodeMCU or D1 Mini with the ESP-12. You’ll need to develop your own circuit board to power the ESP with 3.3V and then somehow get 5V to power the servo.

i will take your word for it ben after seeing the great work you did.
i was thinking of using an AMS1117


sort of like this or when i do the wiring run it all back to an old computer power supply with both 5 and 3.3

AMS1117 works great as long as you’re not on a battery, it’s not super efficient.

I’m running into power issues with a 2.1 amp USB wall block powering three blinds. I’ve soldered Y’s into a micro USB cable and split it off three ways and the total cable length approaches 15 feet. Each of the three Y ends are terminated in a male micro USB which is plugged into each Wemos board. They are working like this but they go through a series of reboots every time I power them up which can be avoided by giving each of them a single power wire so I’m pretty sure it’s a power issue. I’d like to avoid running three power wires to one set of windows if I can. I’m wondering if anyone has come up with a power solution for this. I was thinking about just getting some 18 gauge speaker wire and soldering it to a male USB terminal on one end for the 2.1A wall block and then splitting it out to the VIN power pin on each of the three Wemos. Is there a more elegant solution? How many amps might be required to power three windows? Can the Wemos VIN handle 5V input or just 3.3V? I have fried about four boards already. They work for a couple days and then go out and have a slight burn smell to them. Thanks for any help you guys might provide.

@jacobwtyler, when I first posted about running 3 blinds I was powering each blind with a 2.1amp USB adapter. Since then I have re-wired the three onto the same “main” connector. Powering that is from a USB/120v outlet. It has a capacity of closer to 5 amps.

I have noticed from time to time if there is too much current draw the ESP8266 will reset. To rectify that I installed a 470uf 16v capacitor between the power leads on the servo… A similar trick is used in the RC world with servo’s that draw lots of power. I have also noticed that my power setup is VERY sensitive to any voltage fluctuation on the mains as sometimes throughout the day the blinds will reset.

Finally the Wemos D1 and NodeMCU have a weak diode in the design if you are powering them through the USB port. You can remove the diode and short it out with some solder or power the device using the Vin and Gnd pins. I have changed my setup to provide power to the devices using those pins. Picture from Reddit of the diode that lets out magic smoke

To all, it’s great to see that @blebson is spring-boarding this into another more integrated idea! Sorry I have not been more active on here. Life is busy.

2 Likes