The purpose of this project is to set up a monitor that tracks when your pets enters or exits the house, and keeping track of whether they’re still outside or not. This goal was accomplished through the use of two separate circuits each driven by a Particle Argon. One sitting outside to monitor the outside system, and one sitting inside to monitor the inside system.Inside Circuit:
The inside circuit implements an HC-SR04 ultrasonic sensor that sent out ultrasonic waves and times the delay before receiving a response. The Argon receives the time response then converts the time into a distance in centimeters an object is away from the sensor.
The inside Argon also has a red and green LED system that keeps track of whether the pet is inside or outside according to the bi-communication system. If the pet is read to be going outside, the LED switches from the green light to the red light, and when read to be going inside, the red LED switches to the green LED.
The outside circuit implements an HC-SR04 ultrasonic sensor identically to the inside circuit to measure distance away from the sensor in centimeters. The difference between the inside and outside sensor, is that rather than a red and green LED, the outside sensor is connected to a photodiode with a white LED. When active, if the photodiode detects that it is dark outside, the Argon lights up the white LED to provide a small light to indicate the circuit even in the dark. The photodiode is active only when the bi-communication system reads that the pet is outside, to conserve unnecessary power.
As the pet approaches one of the sensors, the corresponding Argon will measure the distance away from the sensor decreasing, and will thusly send a signal to the other Argon. The second Argon will then check to see if shortly after the first Argon read a decreasing value of distance, the measured distance of the second Argon increases. This basic system is used to determine the direction of flow of the pet, be it entering or exiting the house.
As an example, if the inside Argon detects a decrease in distance value, and shortly after the outside Argon detects an increase of distance value, the bi-communication system determines that the pet must be exiting the house, switching the system state to the pet being outside.
Below is a block diagram of how the system operates depending on the two states of the system, as well as a video of the system in operation.
When a system state changes, the corresponding published event is inputted into ThingSpeak to create a live graphing of the state of the system over time. The state “1” represents the system set to “outside” while the sate “0” represents the system set to “inside.”