Software apps and online services
Hand tools and fabrication machines
My dog recently started barking excessively at something in the backyard and it turned out to be rats scurrying across the brick wall. Wanting a humane solution, I found a live animal trap on Amazon that would do the trick. The problem with the solution being humane is that the animal needs to be released soon after being caught. The question is, how can I be notified when the trap has been tripped? The solution? Particle's Internet connected Spark Core, IFTTT, and Pushbullet.
Note: this project requires that you have accounts for Particle, IFTTT, and Pushbullet.
How It Works
The Spark Core is connected wirelessly to the home network and monitors a dry contact that is closed when the trap door is open. When the trap door closes, the Spark Core publishes and event, IFTTT sees the event and sends a note to Pushbullet.
First, build the circuit for the Spark Core using a breadboard using the schematic below. The dry contact from the trap connects to breadboard
positions 24 & 26 (where the push button is in the below image) and power from the batteries is connected to breadboard
positions 10 & 11.
Ensure that the Spark Core can connect to your WiFi network. Troubleshooting the Spark Core is easier before the breadboard is mounted inside of the project box.
Note: The schematic shown from 123D Circuits is an approximate circuit diagram for this project. An Arduino mini was used instead of a Spark Core. The pin locations are not correct but the pin numbers are. The electrical dry contact between the trap door and the spring is represented by the push button.
I used a cardboard box that I an order from SparkFun order came in. The nice thing about the box is that the lid can close and lock by tucking in the lid tabs. Any project box will due.
Place the box to the side of the trap and use an awl/small screwdriver to poke holes into the bottom of the box so that the zip ties can pass through. Make sure the holes are placed in between the horizontal metal mesh in the trap. My holes are approximately 1" apart.
Install the double-sided sticky tape to the bottom side of the battery holder and breadboard if needed. I used standard scissors to cut the tape to size.
Mount the breadboard and battery holder to the inside of the box using the double-sided sticky tape. I chose to mount the breadboard on the lid of the box and have the box open downward to give more access to the breadboard when the box was open. Also, be sure to mount the breadboard and batter holder close enough so that the battery holder wires can reach the breadboard.
Cut 2 pieces of wire approximately 18" in length.
Strip approximately 1/2" of the wire insulation form one of the wires.
Loop the wire around the match/kabob stick once so that the stripped end is dangling off of the stick. Tape the wire to the stick using electrical tape so that it doesn't move around. the wire should be approximately 2" from the end of the stick.
Either a long match stick or a kabob stick will be sufficient, as long as it's longer than the trap width.
Note: The image below shows the wire in the middle of the stick but I ended up moving the wire after fitting it stick to the trap.
Zip tie the match/kabob stick so that the red closed contact wire is sitting just inside of the trap wall. Be sure that the trap door lock mechanism does not interfere with the wire when the door is in the up position.
Cut the match/kabob stick flush with the trap sides. Trim the zip ties as well.
Open the trap door and make sure that the closed contact wire is able to make contact with it. Trim the wire insulation, lengthen the dangling wire end, or bend the wire downward until the wire remains in contact with the open door.
In order to complete the dry contact on the door, the second wire is installed on the torsion spring by making a loop in the wire and "crimping" it to the static leg of the spring. Because the door is moving, it is best to install the wire on the a stationary part of the door to prevent the wire from accidentally coming off. The best place to do this is on the static leg of the door torsion spring.
Optional: use a multimeter to check that the contact is closed when the door is open.
Zip tie the box to the side of the trap and trim the zip tie extra.
Spark Core Setup
To install the code (publish.ino) linked below, follow these instructions from Particle.io.
Rat Trap Tripped Recipe
This recipe if for receiving a notification when the rat trap has been tripped. Add an IFTTT recipe from scratch or using the published recipe. This will monitor your Spark Core for a event (contact is open) and send a push message to your phone when the event has occurred. For the
Event Name field, enter
inputStatus and for the
is field, enter
low. Also, choose your
Device Name or ID.
Low Battery/Disconnected Recipe
This recipe if for receiving a notification when the Spark Core has become disconnected for some reason. This can be due to a low battery or a WiFi disconnection.
Add an IFTTT recipe from scratch or using the published recipe. Just enter the
Device Name or ID.
Bait and set the trap.
Ensure the dry contact wire is touching the trap door.
Connect the batteries to Spark Core.
Ensure that the Spark Core is breathing cyan and connected to WiFi.
Close the box lid and wait!
Test the Spark Core by adding a push button to the dry contact. This will ensure that the Spark Core is connected and IFTTT & Pushbullet are working okay.
Perhaps the trap is placed too far from the wireless access point.
See this troubleshooting guide for help with the Spark Core.
The Particle community is also a good place to start.
Next is to test that the dry contact is making a closed connection when the trap door is open. Try testing the contact with a multimeter.
10/14/2015 - Initial release.