Insert a sensor directly into the lock

Insert a sensor directly into the lock to determine if the pedestrian gate is open or closed

I wanted to provide a pedestrial gate with a reed switch for Arduino to understand if the gate was open or closed. Not that that a hash is very important for alarmist, but useful for lighting at night the lights automatically when it is opened.
Provide a gate with a reed switch is possible, but I could not find a location aesthetically appropriate for the magnet. Therefore, not being able to place outside, I looked at the inside of the lock to determine if I could use its moving parts. At the end I was able to
insert a small toggle switches as shown in the photo.


Modifica alla serratura del cancelletto

This switch is fixed with a piece of plastic to the spring latch and its lever is attached by an iron wire to the pivot ejector.

In previous photo you can see the gate open (contacts of the switch: open). In the following photos, instead, two different angles with the gate closed (contacts of the switch: close).

Modifica alla serratura del cancelletto

Modifica alla serratura del cancelletto

Note that switch and the plastic support of the switch are attached to the latch bolt using cable ties. The holes for fixing were already present.
Plastic is the material support of the switch because it offers good elastic characteristics. Plastic and switch are fixed slowly in order to provide a high yoke during the opening of the gate.
The path of the harmonic steel wire is bent to V in the middle.  In this manner the resulting spring is capable to absorbing the forces transferred from the pivot to the switch.

The operation is shown in the following video: