Best sensor for a gate latch?

Normally I would google then trial and error these things myself but in the interest of time I’m gonna just ask here and hope you will help me figure it out. I need to put sensors on our backyard gates that will tell me when they aren’t latched.

A little background, our pool tech (very fired now) left our gate open when he left and this tragically led to the loss of our dog. I simply can’t allow this happen again. I’ve added auto-closing mechanisms but I’m paranoid now and believe in defense in depth strategies. I have two gates, one on each side of the house. I am thinking of using two mesh devices and a Xeon in the house itself. The Xeon will have a simple RGB light that gives a red/green status and will be by the back door. No green, no letting the dog out. A simple magnetic reed switch would tell me the gate is closed but not if it is latched. The current latch is like this:

What suggestions do you have in general for a sensor that would work and the “design” in general? We simply can’t lose another beloved pet so I want to make sure the gates are secured anytime we let a dog out to do their business. I’ll also have it send an alert for any gate open condition and a gate closed confirmation but being able to get a visual confirmation of the current state would make us all feel much better. Thanks in advance!

Do you think a GPS dog collar would be better at keeping track of the dog if it ever did get out?

sorry about your dog! If I think of a sensor will let you know.

What is the difference between it being closed and it being latched? As in, what’s there to measure?
Limit switches could work?

On these types of locks, sometimes you can close the gate to the point where it looks closed but it had not tripped the locking part yet to actually lock it.

Just install a electric dog fence.

Sorry about your dog.

I use a reflective IR sensor to detect whether a door lock bolt is thrown or not. You could position the sensor to reflect off the end of the latch only when the latch is in place. Try Vishay TCRT5000. You need a couple of resistors - not sure if it works from 3v3. Another type of sensor you could try is a Hall effect which could tell whether something metal - like the end of the latch was in front of it.

Not sure of the climate - assume it must be good and mostly dry - that might mean a rather expensive sensor might not be required or you could IP65 it yourself.

Our last dog was out for 20 seconds max. So tracking is something we are considering but full containment is better.

Thanks. It’s been a tough few weeks. I’ll update the thread if I come up with something as well.

I would still go with a reed switch. They are magnetic switches but you don’t have to use the magnets that comes with them, they tend to be larger than the area you have to work with. I would attach a small neodymium magnet to the gate bolt, using high strength marine epoxy, then attach the switch just below or beside where the head of the bolt sits when fully closed. You can get these made for doors with a 1/4"-1/2" operating gap which should be perfect for this.

1 Like

That’s very sad.
As a pragmatic engineer, I’d say if you’ve already sorted out the self-closing part of the gate management, it does’t really matter if the latch has fallen. All you need to confirm is that the gate hasn’t been propped or otherwise stopped from closing, unless your pet is one of those that has worked out how to pull a gate open (no, I’m not being facetious). So an IP67 rated reed switch and magnet is going to be about the most reliable and lowest complexity solution, in my view.

Thinking further on this, if you didn’t want to use a reed switch, we use an infrared photo eye in the gate industry. Our use is for a safety device, but they have a standard relay output so you could set up the reflector on your gate, set a post and mount the photo eye so that it sends you a signal when it doesn’t get a signal back from the reflector.

Something like this would work.
Seco-Larm E-931-S35RRQ Enforcer Indoor/Outdoor Wall Mounted Photoelectric Beam Sensor with 35 Foot Range

Your problem is twofold. You want to know that the latch is in the closed position AND that the gate is closed (the latch will be in the closed position when the gate is open).
A reed switch, as stated bu others, is the best and simplest solution to know if the gate is closed.

For the latch, I would probably go with another reed switch. glue a magnet to the latch just below where you would grab it with your fingers to open it. Glue the reed switch to the side of the bracket so that the magnet triggers is when it closes (closed, latched, locked all mean the same thing in reference to the latch).
You will probably want to play around with where the best placement would be. I would consider mounting both on the latch mechanism to keep wiring simpler.

So then only if both reed switches are closed then the gate is secure.

Most reed switches are IP67 and can also be covered in glue/plastic/ceramic if more weather protection is needed. As long as the magnetic field from the corresponding magnet is strong enough (ie close enough) all will work fine.

The Xenon’s sound like a fine Idea. I would probably go with an Argon in the house connected to your Wifi. That way you could get notified remotely if the pool is unsecured.

A further step would be to add some literal ‘Bells and Whistles’ to yell at the person to ‘SHUT THE BLOODY GATE’. I think my Australian accent just came through.

Keep us posted with how you go.

1 Like

Optical looking at the top of the latch. Light seen open or not latched. lower light level. latched.

I think I’d look for different latches.
In Australia fences and gates are mandatory around pool to save children from getting in there and potentially drowning, so the latch (search for ‘Magnalatch’ or ‘magnetic gate latch’) has a much more positive action. As long as they are installed/adjusted properly you KNOW if the gate is closed it is latched.