As the name implies, this is a gate status monitor which uses interrupts. The moteino will send an update the moment the gate is opened or closed. In addition, gate status is sent on regular intervals, just to confirm the device is still alive. I also added a bme280 for no good reason whatsoever. The bemo280 extends below the moteino inside the fence post, which has been vented using a couple of small, round soffit vents.
SMS alerts are configured to send a text if the gate opens.
In order to use less power, an SPDT magnetic contact was used as discussed here by joelucid:
https://lowpowerlab.com/forum/low-power-techniques/interrupt-driven-reed-switch-circuit/msg14241/#msg14241Check out the photos below. I discovered one can embed a Moteino completely inside a vinyl fence fairly easily. The only thing exposed is the
Sentrol 2507A status contact. So now I hate vinyl fences a little bit less!
Sketch is here:
https://github.com/knnniggett/moteino/blob/master/gatemote/gatemote.inoThis project proved its usefulness just days after completion. I got a text message telling me the gate mysteriously opened early one morning. I noted the time, then checked my surveillance camera and sure enough, the guilty party was caught on camera:
I am very glad I discovered this before I let the dogs out into the yard!
Unknowns:While the moteino is protected from the rain, wind, and snow inside the post, it is not airtight at all. It will be interesting to see if any problems develop over time.
Future Improvements:Due to my success duplicating
Felix's supercpacitor project, I have a couple, narrow solar panels on order which are no wider than the top of the fence rail. Once these arrive, I will convert from lipo to super capacitor. Since the speed at which parts arrive from China seems to be inversely proportional to how quickly I want them to arrive, this might not happen until next year.
Configure the Moteino Raspberry Pi gateway to forward selected alerts to a ZoneMinder surveillance system. This, in turn, would trigger the appropriate surveillance camera to record and send an email with an attached video clip of the event.
Project Photos