Note: No dog or any other animals were harmed during the development and testing of this project.
1. If the dog is in the crate, there is someone in front of the crate, and the latch is locked the LED lights up to notify that the latch has been locked.
2. If the dog is in the crate, there is NO ONE in front of the crate, and the latch is NOT LOCKED, the IoT publishes an event which sends a notification to the smartphone.
How the crate looks before the hack.
Components Used
1 - Hall Effect Sensor
1 - IR Range Finder
1 - Red LED
1 - Force Sensitive Resistor
1 - AA Battery Pack
1 - Particle Photon Microcontroller
2 - 10K Resistor
1 - 1K Resistor
2 - Alligator Clips - The leads on FSR was too short and could not be secured into the jumper cable.
Jumper Cables
Wiring Diagram
Original plan was to use the following sensors and components but was replaced for accuracy.
- PIR was planned to be used to sense the presence in front of the crate. However, testing showed that PIR was only reactive to motion, which does not always equal to presence. Hence it was replaced with IR rangefinder.
- Push button was to be used to sense the crate in use (i.e. dog is in the crate). The crate has a floor tray which is separate from the metal crate itself. Every time the dog is in the crate, the tray would be pushed down, thus pushing the button. But the weight of the tray itself would constantly be pushing the button, which led to the change to FSR to detect the actual difference in weight.
Complete Final Set Up
Hall Effect Sensor, IR Range Finder, and LED Set Up
IR Range finder was tied to face the front of the crate. A neodymium magnet was attached to the latch male end while the hall effect sensor was attached to the female end. Red LED was placed facing front as lock status checker.