Back to blog
Aug 18, 2025
6 min read

Home Automation

Figuring out how to automate my house - multipart series

Automating my swing gate

I have an old swing gate thats a pain to open/close especially during the monsoon swing gate

During the monsoon, the ground below it turns to mush and its especially difficult and annoying to open the gate while balanding the keys and an umbrella. So I’m going to automate it

I have no idea what im doing but hopefully it’ll all work out

Approach 1: convert It To A Sliding Gate?

There are plenty of automation kits for a sliding gate but that would involve creating a rail thingy on which the wheels of the gate would rest. Something like this sliding gate plan

We would also have to diplace it a bit to sit on the rails as opposed to the hinges so it could slide away. However, the ground probably wouldnt be able to handle the weight of the gate + cars driving over the rails and would sink…which would be bad

Approach 2: Keep It A Swing Gate

No real surprise as this is the only feasible option. The catch, however, is finding a kit that fits my gate as the mounting mechanism for most kits expect to be mounted right next to the gate with some offset. The topens blog has some amazing resources to figure out the best mounting position. In a perfect world, I would order a kit from them. However, I live in India and those kits are pretty pricey when combined with shipping + import duties

The Goal

I want to automate my swing gate while keeping the budget under USD 250

Caveats

My mother does not want me to destroy her beautiful gate with my mechanical monstrosities. Instead, she wants me to mount it to the metal pipe near the gate proposed mouting

This makes things complicated but nothing a bored engineer can’t handle

The Parts Required

  1. A good linear actuator
  2. An arduino and a bunch of relays (minimum 4)
  3. An AC to 12V DC power supply thingy (check the minimum power draw of the actuator). I got this one from amazon.in https://www.amazon.in/dp/B0CTK84J74?ref=ppx_yo2ov_dt_b_fed_asin_title

dc power supply

The Theory Involved

A linear actuator looks like this inside linear actuator interior A motor turns some gears which turns a work gear which ultimately pushes a rod in and out of the housing. Every linear actuator will have a load rating which is the maximum force it can apply. You have to make sure your linear actuator has enough pulling/pushing force to account for friction, wind, weight of the gate and most importantly the actual force exerted based on your mounting

From the topens blog, topens mounting guide

Using this diagram, lets science the crap out of this problem statement

force diagram

  • OO is the gate hinge
  • AA is the linear actuator hinge on which it can rotate
  • DD is the point on the gate where the mounting brancket is
  • DD is the point on the linear actuator arm where the mounting bracket is - generally the end of the arm (more on this later)
  • BB is the point where line AB meets OD
  • OO` is the point where a line perpendicular to AB is drawn that cuts AE
  • CC is the point where lines BD and AE meet once extended
  • WW is the weight of the gate (one half of the swing gate where g = 9.81 m/s^2)
  • dd is the distance from the hinge of the gate to the center of gravity of the gate half (usually located in the center)
  • μ\mu is the friction coefficient - usually 0.40.4 for iron on iron
  • rr is the radius of the hinge (usually in cm)

Note: My math is kinda rusty and its been a while since i did anything like this

Now using ϕ=BAE=OOE\phi = \angle{BAE} = \angle{OO'E}, we can do this

diagram with values

Torque needed to turn the gate = τg=Wd\tau_g = W * d
Torque needed to overcome friction = τf=μNr=0.4Nr\tau_f = \mu * N * r = 0.4Nr

So the minimum torque you need is: τg+τf=0.4Nr+Wd\tau_g + \tau_f = 0.4Nr + Wd

But we want only one component of the force - the blue arrow

So we can do = Factuatorcosθ0.4Nr+WdF_{actuator}*cos{\theta} \ge 0.4Nr + Wd
=FactuatorABAC0.4Nr+Wd= F_{actuator} * \frac{AB}{AC} \ge 0.4Nr + Wd
=Factuator0.4Nr+WdABAC= F_{actuator} \ge \frac{0.4Nr + Wd}{AB} * AC

So your actuator needs to have a minimum pulling force of 0.4Nr+WdABAC\frac{0.4Nr + Wd}{AB} * AC

This is what my linear actuator says on the label linear actuator specs

voltage = 12V DC (normal)
max extension length = 600mm600mm
speed = 5mm/s5mm/s

and finally, the duty cycle = 2min2min ON and 18min18min OFF. This is the real killer. A more powerful linear actuator will need a longer time OFFOFF. While there probably are linear actuators that are powerful with a shorter OFF duty cycle, they are pretty expensive. I got this one for Rs. 4.7k including shipping and GST (around USD 54)

If you look at the diagram above, you will see that the gate is closed when the linear actuator is fully extended - which means that, with some quick math of 600mm/5mm/s=120s=2mins600mm / 5mm/s = 120s = 2mins , opening the gate OROR closing the gate will need to be followed by 1818 mins of rest, which is not what we want. Imagine opening a gate to drive your car in and then waiting 18 more minutes to then close the gate

One workaround is to mount the stuff in such a way that the linear actuaor is extended halfway (or even less) whhen the gate is closed. That will allow us to open and close the gate within one active duty cycle

WIP - this blog will be updated as progress is made