Smart Dog Door Flap - what sensor(s)? passive trigger, etc - Page 1
Forum section: electronics / beginners

author: tgryffyn
author_rank: Newbie
timestamp: April 27, 2016, 07:33:12 pm
content: Just installed a dog door and I'd love to know when the dog comes and goes. I have a SmartThings system but their "presence" sensors basically tell if the fob is within range of the mesh network so it wouldn't trigger unless he got out of the yard.As you can tell by where I'm posting this, I'm still very new at electronics and with so many ways to skin cats, narrowing things down to a handful of sensible ones would be nice.I don't think I want to use a PIR type sensor or a motion sensor in general on the inside and outside, would trigger when we were near the door as well as the dog just lounging, not necessarily going in/out. Also, I'd love to do a single sensor inside and not double the sensors (one in, one out) or have to worry about weather.I've looked at some flex sensors. I think two of those would be able to tell me when the dog door flap flexed out or in, but then some questions come up:1. Flex sensors increase resistance when flexed. Would this be suitable for a SUPER low power zigbee or zwave sensor setup or would they require constant current to detect the change. I'd like it to trigger like a door open/close sensor does... as the event is happening... not a periodic "heartbeat" type sensor read.2. Could I repurpose an open/close sensor but still be able to read two states (open-out, open-in) when they typically only trigger on open or close. I'm guessing not... so I might end up doing my own Xbee Pro type thing and create a custom device type in SmartThings that can handle three states (open-out, open-in, closed)I've also thought about capacitive touch sensors (I assume require constant current though).Ideally, the sensor would require zero power when not in use and only send a signal when it was touched/flexed/etc. I guess there'd need to be a way to trigger "closed" and zero power again though.I'd love to hear different ways this could be accomplished (not just the possibly objective "best way") as I'm learning and would be curious of the ins and outs of different mechanisms.Thanks in advance! Hopefully this isn't below even the "Beginner" category.-Trevor

author: SeanB
author_rank: Super Contributor
timestamp: April 27, 2016, 07:37:40 pm
content: Use a cheap RFID tag on the collar, with the sensor coil wound around the pet door. That way you could both log entry and exit ( add a second one at the end of the corridor or outside where the dog will pass) and also have the door be a locking type so that you do not get all the other stray dogs, cats, racoons, squirrels and other wildlife entering through the door to eat the food or take up residence.

author: stmdude
author_rank: Frequent Contributor
timestamp: April 27, 2016, 07:58:50 pm
content: How about a solution that doesn't involve electronics?Two mechanical switches (micro-switches for example), one that is activated when the flap is pushed out, and one when it's pushed in..They'll use zero power themselves, and interfaces with just about everything.

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 27, 2016, 08:03:07 pm
content: Yes, an RFID tag on the animal's collar with the sensor loop around the door is probably the most popular solution. You could use it simply for "unlocking" the door to only YOUR animal(s) and not other pets or wildlife. And you could use it for monitoring when the animal(s) goes in or out (and even which direction) so you will know when they are inside or outside.

author: Wilksey
author_rank: Super Contributor
timestamp: April 27, 2016, 08:03:48 pm
content: Does it need to "know" the direction or just trigger? You could use an IR sensor, rather than PIR, I think Sharp do a sender and receiver on one small-ish package.I don't know how much metal is on the pooches collar, but you could use a magnetometer possibly.Or a mechanical switch on the door.

author: tgryffyn
author_rank: Newbie
timestamp: April 27, 2016, 08:13:25 pm
content: Knowing the direction seems to be a good way to tell if he's going in or out. So like the two flex sensors put at 180 degrees to each other (or if I found a single one that measured both directions) seemed to be a nice compact way to go. I don't want a bunch of wires all of over the place, but a couple of flex sensor strips wouldn't be too bad.IR, like PIR, would tell me if someone or the dog was there, but not if they went through the door. Sometimes he lays by the back door, sometimes we're doing laundry, etc. Ideally I'd like to know when the flap was used and double ideally, what directly it was used in.RFID is ok, but that would mean having multiple RFID readers (or like in the case of PAW, a BTLE deal with receivers all over the office:https://paw.isl.co/) would tell me when the dog was near a receiver but to tell if he went out or in, I'd need to process the data for "dog is in the laundry room, dog is now outside... therefore dog went out... dog is outside, dog is now in the laundry room... therefore dog came in". Having a minimum of two Arduino or Raspberry Pi type setups with power sources, outdoor enclosures, etc... seems overkill and inelegant.Mechanical switches are a possibility. I might look at that if I don't find another solution, but I actually might be able to do it with a standard multi-sensor on the door flap. I forget that the ones I got with SmartThings not only show open/close and temperature, but also show rotational position. That could actually tell me if he went in or out depending on if it was tipped one direction or the other.

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 27, 2016, 08:17:44 pm
content: Quote from: tgryffyn on April 27, 2016, 08:13:25 pmYou may have missed the part about having the RFID sense coil directly/physically AROUND the doggie-door. That limits its range/comprehension to ONLY when the dog goes in or out of the door.

author: tgryffyn
author_rank: Newbie
timestamp: April 27, 2016, 08:22:18 pm
content: I saw that part, Richard. But I might be able to get it so that it senses him only as he goes through the door (not laying right against the door)... but not if he went in or out.. just through. He does, sometimes, stand by the back door especially shortly before laying down.. so that could potentially be within range of an NFC set up for "through" detection as well. So it's no guarantee that he actually went through the door... just that he was close to the sensor. It also assumes that the NFC chip stays on the top of his collar... which it might. Could sew it in. But he goes swimming and stuff as well, and we wash his collar in the washer periodically, so the NFC on his collar would need to be able to handle all that and not be too bulky.

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 27, 2016, 09:45:15 pm
content: It would also be conceivable that one could create an RFID reader that would sense the INTERNAL chip (as people put into their animals, and sometimes even into themselves). Those things are so small (and the antenna loop is to tiny) that it takes a sensing coil that is quite close (and powerful). A proximity or similar sensor could be used to turn it on only when it expects to read something.Combined with a door switch (I would just use a magnet in the weight at the bottom of the flap, and a reed switch buried in the threshold), it seems like it would be a pretty foolproof way of detecting passage. Unless the animal has the habit of lounging about with their head through the door.

author: rrinker
author_rank: Super Contributor
timestamp: April 27, 2016, 09:51:54 pm
content: Check out an add-on app like Stringify that will work with the SmartThings and leverage maybe two sensors, one inside near the door and one in the door. The order triggered will tell you if the dog came in or went out. You can build logical if-then flows that cause whatever sort of action you'd like - operate another device, send an email or text, etc. Much more powerful than what comes with SmartThings - and it works with more than just SmartThings.Once a few other things are off my plate I have great plans to deploy more SmartThings compatible devices and do some neat stuff. Right now it's all just piled on my desk and I have but one alert set up, for high temperature, which in the middle of summer, if the AC stops working, it can get too hot for my dogs in the house, so it sends me an alert. I mostly need to automate all my room lights because some members of this household leave lights on all the time, plus it would be nice if your hands are full to have the light come on without trying to flip a switch.Disclaimer: I was a beta tester for Stringify and a friend of mine is the director of engineering at the company.

author: Wilksey
author_rank: Super Contributor
timestamp: April 27, 2016, 09:52:33 pm
content: Depending on position of the ultimate choice of sensor, you might need to use two to determine direction, i.e. detect which one was set off first (inside or outside) will determine the direction of the "object" going through the flap, could you put the IR INSIDE the flap? Usually you have a decent depth to go through the door.The other thing you could look at is free movement position sensors, one connected to the flap door, depending on the direction the flap is being pushed will determine the direction of the pooch. I've seen larger "feedback pots" for motors but not looked for any "small" ones.

author: ez24
author_rank: Super Contributor
timestamp: April 27, 2016, 10:02:23 pm
content: I would like to see solution that do not need a collar. My dogs do not wear them. (too old to run away)

author: danadak
author_rank: Super Contributor
timestamp: April 27, 2016, 10:15:42 pm
content: Incorporate a load cell to tell if its a dog or a bear. Even color sensor todiscriminate animal type. Possibly a guillotine to deliver the unwelcomemessage for less desirable critters.Regards, Dana.

author: tgryffyn
author_rank: Newbie
timestamp: April 27, 2016, 10:22:18 pm
content: @Richard - Sensing the dog's implanted RFID chip is interesting, but still a single point RFID solution with some technical problems (range, sensitivity, getting the correct frequency for the chip he uses, etc). I'm going to say that RFID and BTLE aren't what I'm looking for here. I could easily just use a single door open/close sensor to determine if the flap was used, in general. But I wouldn't learn much by doing that, eh?The challenge I'm trying to solve is determining if he went in or out with as simple of a mechanism as possible. A single sensor that sent one of three possible data points (open out, open in and closed) would be ideal.@rrinker - Sounds interesting. Ideally, I'd like to not use more apps/services than I have to. Already too many points of failure in some of these systems. Like if I can find a native solution versus using IFTTT, I will.. just to keep the system simple. Looks like Stringify is iOS-only anyway, yes? Am I looking at the correct Stringify?I do program for a living and I'm not afraid to get into the SmartThings IDE and do custom device types and such. I'm just fairly ignorant on hardware right now.@wilksey - And yes, two sensors may be necessary. Like the things you run over on the highway. But I think there's something simple that would work with just the one sensor. Still, something to consider. Hell, even a simple motion sensor pointing down on the inside and outside would get triggered when the dog passed under the first one then the second. But I feel like there's probably a mechanical sensor of some kind that wouldn't need (much) power. When my open/close sensors last two years on 2x AAAA (yes, quadruple A) batteries, having something that lasts at least a year would be cool.@ez24 - I'll try to post the solution I eventually go with. Something not collar based would be preferable to me as well just because I don't think it's necessary.@danadak - HAHA... will do...

author: tgryffyn
author_rank: Newbie
timestamp: April 12, 2017, 11:08:15 am
content: Only a year late... I did actually work on a SmartThings app to handle this using a standard multisensor. I was hoping to get more work done on it before posting it anywhere, but I got talked into it elsewhere so figured I'd come back here and post a link to the code.I wrote up a readme and posted the code and some notes here. I'm fairly busy, but if I can help or answer any questions that aren't answered in the code or readme, let me know. Cheers!https://github.com/tgryffyn/smartthings-dogdoorsentry-standaloneapp

author: stevelup
author_rank: Regular Contributor
timestamp: April 13, 2017, 01:26:01 pm
content: Do you 'microchip' your pets in the USA?Here pretty much all small animals have an RFID device embedded under the skin in their neck. You can read this to check if it's your animal.

author: tgryffyn
author_rank: Newbie
timestamp: April 13, 2017, 05:47:13 pm
content: We do.. but if I recall, there are multiple "standards" for those chips that may be on different frequencies. Watching for an RFID chip to pass by requires an actively powered scanner that has gotta be more power consumption than the "two AAAA batteries = 2 years" power consumption of the SmartThings Multisensor as well as needing some kind of network connection where the multisensor connects via zigbee to the automation network.But on top of all that, that will tell you if the chip came near the sensor (which could just be the dog sleeping near the back door) but best case scenario, limiting the range so it only picks up the chip as the dog goes through the dog door, you still only get "went through the door"... not which direction, which was the main goal of this for me.I wanted to do it using a flex sensor so I could learn more about working with sensors, but didn't really get good beginner information on that so fell back on software development with sensors I knew how to interact with using the SmartThings system.