One thing that I really hate doing is cleaning my cats' litterbox. What I hate more than having to clean it is going to clean it only to discover that it is virtually empty- that I had been sifting through the litterbox for nothing. I decided to make a device that would notify me via notification on my phone and a display next to the litterbox whenever the litterbox needed to be cleaned.
PhysicalComponents
The electronics of the problem consist of a Particle Photon 2, a PIR motion sensor, an OLED i2c display and a button.
I pulled data from the motion sensor so that a "cur" variable would increment every time a cat jumped in or out of the litterbox (with a delay to avoid registering the same event twice), until a certain threshold was reached. When this threshold was reached, and the litterbox was ready to be cleaned, I would get a notification on my phone. For each event that the motion sensor detected after the initial notification, Pushover would send a reminder notification. I used the "Adafruit_GFX.h" and "Adafruit_SSD1306.h" libraries to push data to the screen. The screen would default to display "Litterbox is clean, " and switch to say "Litterbox is dirty" when the cur variable reached the threshold value. Once I cleaned the litterbox, I would hit the button on the breadboard, which would return the cur value back to 0 and the screen to say that the litterbox was clean.
PhysicalSetup
Considering the setup of my litterbox, positioning the device was pretty easy. The litterbox sits inside of a cabinet, and there is only one way for the cats to get in and out. Because of this, I had to make the threshold variable double the amount of litterbox uses to account for both entering and exiting.
For each of the notification types I wanted (Initial & Reminder) I needed to create an Application Token in Pushover and then create a webhook that I could publish within my code.
The display that I used was super finnicky. It required you to code things in a very specific way in very specific places, and when I finally got it to work, it would just shut off half the time. Additionally, when I was setting up the device, I had difficulties angling the motion sensor and playing with the sensitivity to ensure that the sensor only caught the movement of the cats, and no other things like shadows. I also tried to put casing over the breadboard on the side of the litterbox because I thought that the cats would try and play with it, but it kept falling off. Plus, the cats were far more interested in the cardboard and didn't touch the photon much at all.
Link to video: https://drive.google.com/file/d/1JA4QbYRGVX74WXwyHdm8ZEJyH06feX4q/view?usp=sharing
Comments