[RELEASE] ESP8266 / Arduino servo controlled smart blinds

Still testing a few options out, you won’t be able to use the ESP8266 as your controller. It is too power hungry to use batteries and solar charging. My actual blinds are using an RF receiver that communicates with an ESP8266 base station which is plugged into the wall.

I was going to go wired powered starting off just to get something working then after you get all ur issues figured out copy you. They only thing I do not like about the way you are setting it is up is needing gateway defive(another hub). More room for failure. I’ve been stocking you on https://lowpowerlab.com

Yeah, I originally was trying to set this up as a single stand-alone device but there is nothing that ties directly into ST that is low enough power to run on batteries. The gateway is a tiny device that can easily be hidden and has great range. The reaction time is also very quick. Using this gateway allows me to theoretically get ~2.5 years of battery life per blind (without using the actuation or solar charging), where the same battery was getting about 6 days of battery life on my other solutions.

Now that you put it that way this sounds very tempting. Just ordered a Motenion and and a wireless transceiver.

Yeah, that’s the true benefit. All of my prior attempts would use about 15-20mA while sleeping. This Moteino setup uses about 15-20uA while sleeping. Thats 0.015 - 0.020mA, a huge reduction in power consumption.

Good news and bad news; I got the boost up to the point where I can fully open/close the blinds on battery, no problem. But the ‘Enable’ functionality isn’t working so instead of using ~15-20uA while sleeping I’m burning 200-250uA. Still gives me about 6 months of battery life but not where I want it to be. Also, my battery monitor isn’t working so I have to troubleshoot that too.

What guide did you use to setup your gateway and Moteino? Are you using Arduino IDE?

I used the low power listening fork of the LowPowerLabs RFM69 arduino library. I based my code on their example node and gateway code.

Hi all, this is my first foray with ESP8266,
I’ve flashed to a NodeMCU and a Wemos Mini D1 and I can’t get either of them connected to WIFI.

In serial monitor I see the following repeated over and over…

Connecting to VM771352-2G
.Restarting WifÖÃøÑˇ.qôˇÙê.Blind Startup Sequence

Connecting to VM771352-2G
.Restarting WifÖÊ)≤.߲å0KBlind Startup Sequence

I’ve tried with arduino serial monitor closed and with CoolTerm instead, but still getting the same. Can anyone help please?

Hi, did you get yours connected in the end? I am having trouble, wondered if you solved it.

I got it working…

I followed these instructions, to a ‘T’:

And flashed with Arduino running under Windows Parallels on my mac, rather than Mac Arduino.
Weird!

This looks promising.

https://github.com/boaschti/MQTT_WLan_RFM69_Gateway/blob/fd3d32fe22805ee8de82a7bd11686db2484dca5f/rfm69gw/rfm69gw.ino

Can you show or describe how you connect the manual switch?

What booster did you get?

I’m using the MT3608. It’s a pretty popular chip for the cheap adjustable boosters you can get from amazon or ebay. I have a breakout board coming so I can fine-tune the circuit and reduce my power consumption. The circuit as it is now works well and is charging fine but I’m worried about the ~6-8 months of clouds we get here in Seattle, and I want to reduce the size of the solar panels as much as I can. I’m hoping to be able to finalize my circuit design in about 2 weeks.

Hi, I got this working as a test on one of my blinds last night. Thanks for the code and inspiration!

I’m using a nodeMCU and Futaba 3003 with a 5mm to 8mm flexible shaft coupler.

1 Like

So nobody is using an extra manual switch with this?
I just wanted to see how you guys wire it.

I am but I’m using a different platform altogether. I’ll make a separate post one my setup is fully up and running.

1 Like

Im trying to edit the code and change the static ssid and password so that it can use the

wifimanager code

but when I change the code lines I get errors and it starts to want to remove the server code. Any suggestions? Here is what I got thats not working

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <DNSServer.h>            //Local DNS Server used for redirecting all requests to the configuration portal
#include <WiFiManager.h>          //https://github.com/tzapu/WiFiManager WiFi Configuration Magic
#include <Servo.h>


MDNSResponder mdns;
ESP8266WebServer server(80);

Servo myservo;
int pos = 0;
int state = 0;
int prevstate = 0;
int dirc = 0;
int servoPin = D3; //CHANGE TO WHATEVER PIN YOUR USING

String webPage = "";

void setup(void) {
  webPage += "<h1>ESP8266 Web Server</h1><p>Blinds <a href=\"open\"><button>OPEN</button></a>&nbsp;<a href=\"close\"><button>CLOSE</button></a></p>";

  delay(1000);
  Serial.begin(9600);
  delay(500);
  Serial.println("Blind Startup Sequence");
  delay(500);
  Serial.println();
  Serial.print("Connecting to ");
 WiFiManager wifiManager;
 wifiManager.autoConnect("blackjack");

  Serial.println();
  Serial.println("WiFi connected");
  Serial.println("IP address: "); Serial.println(WiFi.localIP());

  if (mdns.begin("esp8266", WiFi.localIP())) {
    Serial.println("MDNS responder started");
  }

  server.on("/", []() {
    server.send(200, "text/html", webPage);
  });
  server.on("/open", []() {
    server.send(200, "text/html", webPage);
    Serial.println("HTTP OPEN COMMAND RECEIVED");
    dirc = 0;  // direction for servo to run
    state = 2; // sets current state
  });
  server.on("/close", []() {
    server.send(200, "text/html", webPage);
    Serial.println("HTTP CLOSE COMMAND RECEIVED");
    dirc = 180; // direction for servo to run
    state = 1;  // sets current state
  });
  server.begin();
  Serial.println("HTTP server started");
}

void servo_move() {
  Serial.println("State Change. Rotating Servo");
  if ( dirc == 180) {
    myservo.attach(servoPin);              // energize servo
    delay(50);
    for (pos = 0; pos <= 90; pos += 1) {   // goes from 0 degrees to 90 degrees in steps of 1 degree CHANGE 90 TO MATCH ANGLE OF TILT DESIRED
      myservo.write(pos);                  // tell servo to go to position in variable 'pos'
      delay(30);                           // waits 30ms between each degree to slow rotation speed
    }
    delay(50);
    myservo.detach();                      // movement finished so detach servo to conserve power
  }
  else if (dirc == 0) {
    myservo.attach(servoPin);              // energize servo
    delay(50);
    for (pos = 90; pos >= 0; pos -= 1) {   // goes from 90 degrees to 0 degrees in steps of 1 degree CHANGE 90 TO MIRROR ANGLE OF TILT DESIRED ABOVE
      myservo.write(pos);                  // tell servo to go to position in variable 'pos'
      delay(30);                           // waits 30ms between each degree to slow rotation speed
    }
    delay(50);
    myservo.detach();                      // movement finished so detach servo to conserve power
  }

  Serial.println("Returning to main loop");
  return;
}

void loop(void) {
  if (state != prevstate) {
    Serial.println("State change!");
    servo_move();
  }
  prevstate = state;
  server.handleClient();
}

My first “production” board is currently installed and undergoing testing. Once it passes I’ll create a few more boards and deploy them in a couple more blinds.

A quick list of features:

  • Fully battery operated with 6 months to 1 year of battery life
  • Recharges with a small solar panel (5v 200mA panel)
  • Able to support multiple gear boxes for larger blinds
  • Reports battery voltage and percentage to SmartThings
  • Reports charging status to SmartThings (Not Charging, Charging, Fully Charged)
  • Allows groups of blinds

If this current board works out then I’ll put together a post with details.

6 Likes