Back to Parent

Outcome


Note: No dog or any other animals were harmed during the development and testing of this project.

Intention

Every time the house is empty, our dog Sherlock is put in his crate for his safety and our piece of mind. However, there have been occasions where he was put in the crate but the crate was not locked, leading to us coming home to Sherlock exploring the empty house. This multi-sensor IoT will sense that Sherlock is in the crate, that theres no one near the crate, and that the latch lock is not locked, which makes it send out an alert to our phones

Goal

The IoT has to do two things with 3 sensors and 1 LED.

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.

Process


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.


Breadboard and Battery Pack Set Up

Breadboard was placed on the site of the crate with the battery pack connected to it to the power the entire set up. 



FSR Set Up

FSR was placed under one of the feet of the crate, allowing the force to be put on it if the dog is in the crate. 

Code

Three different sensors had to be giving the right reads for certain actions to be taken. To do this, 'if' function was used with boolean qualifiers for each of the sensor variables. When the condition is met, event will be published to IFTTT, which will push it to the smartphone. 

Show Advanced Options
Show Advanced Options

Reflection

Hall effect sensor and IR rangefinder worked flawlessly for this purpose. However, the FSR reading varied widely depending on where on the floor it's placed, and dog's movement/position in relation to the FSR position. Three things could be done to remedy this, one being diagonally placing two FSR and getting an average read between the two as the variable. The other is to use a flex sensor, taking advantage of the plastic tray flexing as the dog sits on it. Finally, a larger FSR could be used and placed on top of the tray (and under the cushion). The last option might be the most accurate, but it runs the risk of dog digging it out and destroying it. 

Drop files here or click to select

You can upload files of up to 20MB using this form.