RC Servo Auto-Locker with ESP2866 board

Hi there,

I am not an expert in arduino. In the video below, it is shown a hack with a RPi and a RC Servo.

I would like to develop this hack, but on a WeMos D1 Mini Board or in a Raspberry Pi Zero and command it from OH2.

Do you think it would be possible? I want to be sure before buying everything. :smiley:

I guess that I only need the pulse in ms to send through the signal wire of the Servo.

Thank you!

Servos can be controlled via special ESP8266 firmware, for example ESPEasy. Connection to openHAB via MQTT.

https://www.letscontrolit.com/wiki/index.php?title=ESPEasy
https://www.letscontrolit.com/wiki/index.php?title=Servo
https://www.letscontrolit.com/wiki/index.php?title=Tutorial_OpenHAB_Switch

2 Likes

Great, thank you. I will buy an WeMos D1 and a Servo to start to investigate :wink: I will post as soon as I get progress.

Regards.

1 Like

ok, I am thinking there is another way, using a 5€ Motor 12V - 60rpm and attach the the key.

To close my door I only need 2 rounds, so I should supply 12V during 2 seconds.
To open the door I need 2 rounds and 1/4 round = 2 seconds + 25/30ms.

I do not know how accurate may be the ESP firmware to supply power in ms.

1 Like

The firmware, could be ESPEasy or Tasmota, just drives the servo.
You will need to create a rule with a timer to command the openHAB MQTT item to send whatever you want …
You may use something like createTimer(now.plusMillis(XX)

… and don’t forget to set up MQTT with a secure connection if you are using this for closing/opening a lock :heart_eyes:

1 Like

Driving the servos is the easy part, the trickiest part is knowing when to stop the servos. What you posted will work, like driving it for 2 seconds, etc.

What if you want to know for sure when to stop it? For example, for how long will you drive the servo, if you don’t know the bolt state/position?. What I have done in the past is use an accelerometer to determine the angle of the deadbolt. I used an LIS3DH, same accelerometer used in an August lock. They are tiny though but controllable via i2c.

Using an accelerometer or any angle sensor will also give you locked/unlocked states

2 Likes

Good concept but who wants a power cord strung across their door. I would search for a battery solution before stringing power wires.