Blog Home

AI-powered pet flap tracks where your furry friend is

Arduino TeamApril 20th, 2024

For those who own a pet with the freedom to move between the house and the yard, keeping tabs on where they are can be a challenge, especially if there’s a pet flap involved. Instructables member “madmcu” wanted to know where their cat was whilst away from the house on vacation, so they came up with an AI-driven solution that could log entrances and exits automatically.

Because a closing flap will induce vibrations, madmcu started the project by adding a three-axis accelerometer just above the pet door’s hinge. The IMU was then connected to an Arduino UNO R4 WiFi in order to collect many data samples of a pet going through the flap. Every loop of the data collection program caused the three axes to be printed out over USB serial and sent to STMicroelectronics’s NanoEdge AI Studio application. It was in this app that madmcu set up and trained a classification model on the dataset using the two labels of either “inside” or “outside.”

Once exported, the model was deployed back onto the UNO R4 WiFi along with an updated sketch that continuously classifies new accelerometer readings and prints the result if there is any. At the end of their project write-up, madmcu provides a couple ideas for adding alerts and even a dashboard thanks to the UNO R4’s built-in Wi-Fi capabilities.

Boards:Uno R4