My cat LOVES running around the house, but he never wants to play with normal cat toys. Over time, he put on weight and started to develop asthma. Besides the normal treatments like a special diet and a maintenance inhaler, I decided to try and help his health problems through engineering.
The idea is to train my cat to run on a cat wheel by automatically giving him treats. Over time, i can increase the distance he needs to run so that he ends up burning more calories than the treats give him!
This has been a long process, but the prusa design challenge pushed me to finishing up the design and polishing it up enough that I felt that i could release it.
Video:
Features:
_____________________
Build instructions:
Check out the included instruction images. They walk you through step-by-step! The few in the model page are to show examples - to see the full guide, make sure to download the zip file containing all the images!
Parts needed (contains affiliate links):
CAD and stuff:
I designed the full build in fusion360. Fitting the mount to the cat wheel was accomplished by taking a graphite rubbing of the wheel base, then scanning that in and using known features to scale the images appropriately.
The treat dispenser uses a double chamber design. The upper chamber has a hopper to hold a large amount of treats. An auger moves the treats to the back of the device, where they drop into a bottom chamber. This bottom chamber feeds the treats forward, and out of the dispenser.
This double decker design solves two problems that i discovered in prototyping:
Electronics:
I attempted to do a circuit diagram by hand, but it was probably only legible by me. Thankfully, the electronics on this project are about as easy as it can get. The project uses a series of magnets attached to the cat wheel. A hall effect sensor on the base reads the magnets to detect the distance ran (basically making a massive magnetic encoder!).
If you like this project, and want to help out, i would LOVE to have some help designing a basic PCB that handles the power and signaling, since right now you need to connect n sensors to less power / gnd pins than most microcontrollers have. I don't have the time to dive into the world of PCB design, but would totally sit in a discord call and learn!
Code:
This project was build in platformIO, which is a plugin for vscode that has some nice features like dependency management, so you don't have to worry about installing libraries. Simply install platformIO, open the project, and it will download and configure everything automatically.
The code can be found at the following github link: https://github.com/MethodicalMaker/Cat_Wheel_Treat_dispenser/tree/main
The code is “a few energy drinks, a box of pizza, and a few late nights” kind of quality, but its functional and well documented. Over the following weeks, ill clean up the code base and get things broken out better into their own files :)
Usage:
Power up the board after flashing and join the “CAT_WHEEL_SETUP” wifi network. Enter your wifi info and hit save. The dispenser will join your network and self-host a webpage that you can browse to.
To find the ip address once its on your network, check your router, or reboot the board while you are connected to the serial console.
_____________________
Design info:
The original design was based around an Arduino UNO R4 wifi, however by the time it was delivered and the mechanical design was finalized, I ran into a few bugs. One was that the IDE was reporting that my code fit into ram, but when running, it exhausted the small stack space and was overwriting heap memory. While trying to minimize memory usage, I also discovered that web pages were fast to load on the initial call, but would take 30+ seconds to load (and sometimes time out) on subsequent requests. I initially thought this was memory related, but it appears it might also be a bug in the esp32 used on the R4 for wifi (https://forum.arduino.cc/t/the-simple-web-server-example-for-uno-r4-wifi-needs-to-be-fixed/1210353/2)
Because of the bugs, and running into a time deadline, i moved over to developing on a spare esp32-wroom I had sitting around. All of the mechanical parts are designed around the Arduino form factor, and if this project gains interest, ill continue working on getting the networking code working on the Arduino UNO. For the sake of the design competition, the logic that runs the treat vending works fine on the arduino, and the R4 wifi does also have an esp32 on board… If i was a better embedded engineer, there is a way to flash directly to that esp32 and bypass the cortex-m4.
Furthermore, in case anyone wants to tinker with the code before I get to it, I avoided any esp32 only libraries like tzapu/wifimanager, and instead opted to implement the logic myself in a way that works cross-platform
_____________________
Troubleshooting:
The author marked this model as their own original creation.