Download version 1.5.4 or 1.5.6 of the RTCLib library on github (link can be found as a comment in the Arduino file of this project) since there is a bug in 1.5.5 for the time being.
It all started with the simple conclusion that I was really annoyed by my cat Mia walking on my face at 6am every day to get her morning food allowance. My girlfriend and I rescued her from a shelter and the poor thing can't self-manage the amount of food she eats, leading to a slight overweight that we are controlling with a strict diet. Since the total amount of food per day is quite low (45 to 50 grams), the vet suggested we feed her multiple times a day. We settled on 3 times a day which meant we needed to bring out the scales and dose the dry food way too often for my taste. This also meant kitty was hungry very early in the mornings and didn't hesitate to let us know in her own way.
There comes my addiction for Arduino-based devices and 3D printing (y'all know how it goes). The list of parts you will need is as follows:
One important thing to note is that the servo will draw quite a lot of current and the regulated 5V outputs from the Arduino won't be able to make it turn, it will reset the board. You should really wire the servo Vin input to Vbat or Vraw output on the Arduino (unregulated), and make sure you power your Arduino using 5V (with USB for example).
You then need to glue the "Coupler" printed part with the little adapter that comes with the servo (to put on the servo gear). I used the circular one and glued them with CA glue as seen in the pictures. I originally intended to use the coupler directly on the servo but I didn't quite work, it's much better to use the provided adapter which has teeth to match the servo's gear teeth.
I taped the LED and LDR to the lid with duct tape and did the wiring by soldering the various wires and resistors together like in the schematics, without using a breadboard obviously. Heat shrink or electrical tape around every solder point made sure that no short circuit could happen.
Note that all the parts as available here have been optimized for 0.48mm extrusion width and 0.3mm layer height. Should you wish to print with different settings, I encourage you to create a free account on OnShape and edit the variables at the top of the public document for this project.
To refill the device, no need to unplug anything. Simply lift the lid and put it on the side, taking care not to pull on the wires too much. Take the main body with the "blades" part out of the support, turn the blades so that the slot in the middle is vertical (north-south if you prefer). This should align one of the compartments with the opening on the right (or left depending on how you see it). You then proceed to fill the compartments with the right amount of food (I usually put the device on scales to weigh the precise amount). One compartment on the right stays empty. Then, remove the adapter from the servo, turn it with the orientation matching the slot in the rotating "blades" part (so north-south again) and insert it back. Finally, put the body back on the support, and the lid back on the body.
The device has now been working flawlessly for over a month, although it could probably be improved upon. One thing to note is that my cat is pretty chill with machines, she never tried attacking the thing (yet) but some cats are friggin crazy and this design won't stand a lot of abuse.
EDIT 2017-08-25: updated the microcontroller software with the following changes
EDIT 2018-08-03: tuned the servo and LED parameters again, those are very robust for me, not a single failed rotation in 2 months!
You can print all the parts in the same orientation as they are in the STL files. Everything should print without supports but you might want to use a skirt to prevent lifting of the "Blades" and "Support" parts since the area of contact with the bed is small. I designed 2 slots at the base of the "Support" part to allow space for the rubber mat we use. They should print as bridges quite easily.
TIP: print two of the "Coupler" part, and use one to block the hole while refilling the machine, so that no food gets into the center hole.
I would advise you to use black filament for the rotating part since it should block all light coming from the LED during rotation.
Note that all the parts as available here have been optimized for 0.48mm extrusion width and 0.3mm layer height. Should you wish to print with different settings, I encourage you to create a free account on OnShape and edit the variables at the top of the public document for this project.
I already had a bunch of microcontrollers laying around a few other parts like LEDs, light-dependent resistors, a real-time clock module and some breadboard wires. After a few unsuccessful tries for designs based on Auger screws and a not-so-powerful stepper motor (https://www.thingiverse.com/thing:27854 was the main inspiration), I came to the conclusion that Auger screws are not well suited to this application because dry food often gets stuck and controlling the amount precisely (which was a requirement) is tricky.
I then came across this design by SuperBearFur that struck me with its beautiful simplicity: https://www.thingiverse.com/thing:497637
So I designed a first version similar to that one, scaled up and tuned for the exact amount of food needed in this case, and three days' worth of food (10 compartments with one being empty, which amounts to 9 doses at 3 doses a day). I needed it to be higher than the ground in order for the food to fall into the bowl, so I made a stand for it, which also doubled as a container for the electronics, and a spout to clip onto the bowl. I ordered a continuous rotation servo for this since it makes the wiring and Arduino code simpler. Since continuous rotation modified servos have no way of encoding the angle of rotation (only the speed), and the friction of the system was such that rotation speed could not easily be controlled, I had to come up with a solution to precisely encode rotation angle.
Here comes the makeshift encoder part of the project. I figured I could design a bunch of holes the in the rotating part that would act as a shutter for a very simple light detector system. On one side of the shutter, a simple LED, on the other side an LDR which, as the name indicates, changes resistance depending on the amount of light. This way, I can turn on the LED right after the rotation started (allowing for the shutter to first block the light path), and the LDR would then read the light amount continuously until the LED's light is visible, indicating that rotation should stop because alignment is perfect.
The author marked this model as their own original creation. Imported from Thingiverse.