Swing gate with a guillotine for secure lock

If you like it, share it

By:           emcu-homeautomation.org
Date:     August 2016
Name:   Sliding gate with guillotine
Note:     This SW was tested on NUCLEO-F401RE and compiled using the KEIL v.5.20
              Program Size: Code=9226 RO-data=454 RW-data=164 ZI-data=1780

The idea for this project came from the need to put safely my electric gate when it’s close.
My gate is a swing gate that change the inclination from winter to summer.
See picture below, red and green lines indicate the inclination of the gate between the summer and winter.
The angle between summer and winter exceeds 2 cm. For this reason is not possible use a electric lock to secure the gate.

My idea was to implement a system which locks the gate when it is closed.
For to do that I used the window motor mechanical of the Audi.
Thank Politecnica 80 I received a complete system that I modified as shown below.

3 and 5 are the limit switches
4 and 6 are the mechanical limit switches

See my mechanical movement (video).
Video n.1
Video n.2

Alternatively you could also use a DC Linear Actuator.

I have another problem, I have two electric gates, one is sliding gate and the other is swing gate.
I decided to change the swing gate and make it similar to a sliding gate adding the two electric limit switch (see below).

In this way I developed a unique HW/SW for both gates.

FCA is the open limit switch, normally closed (NC)
FCC is the close limit switch, normally closed (NC)

At conclusion:
After several excavations (for install the two limit switch, FCA and FCC), mechanical and electronics works, now I have a swing gate that use two limit switch to stop the open and close movement and a guillotine (car window motor) to put safely my electric gate when it’s closed.


 I used a mechanical piston for electric gate because it guarantees a strong closing of the gate.

The oil-hydraulic pistons for electric gate normally tend to lose pressure when are in stop mode for a long time, this do not guarantee a robust closure.

Electronics used for this project
X-NUCLEO-PLC01A1 (PLC1 InPut/OutPut)
The decision to use the X-NUCLEO-PLC01A1 was dictated by the fact that the I/O are electrically isolated from the MCU board and working at 24Vdc.
In addition, the I/O are protected from: electric discharge, short circuit, etc.

The schematic is shown below, to enlarge it click here.


  • For use this electronic without the guillotine connect to +24Vcc the: FCC_GHI and FCA_GHI.
    With the above connections, can use this electronic for a normal sliding gate.
  • Flashing Lamp very slow (about 1 sec) indicates that the gate is locked because the guillotine has exceeded 30 seconds of work.
    To unlock the gate, turn OFF and turn ON the electronics of the gate.
  • All the limit switch are NC.
  • The part of schematics in the red box is not implemented in this SW release.

Some info about the SW that I developed

My sw is free and is here, the Ref.Cod. is: CancScor-F401RE-PLC01A1
Please ask me the password for open the: CancScor-F401RE-PLC01A1
and specify also your: Name, City and Country.

I started my project using the example released for the X-NUCLEO-PLC01A1, the original SW is named: X-CUBE-PLC1
As mentioned above, I used the KEIL compiler (the free version is for up to 32K of exe) and for start the project you must go in this directory:
and double click on the file:

In my package there is the directory named: Documentation
In this directory you find all the docs concerning the evaboard, the schematics for EAGLE and the Flow Chart.