For the first design I used a 360 servo motor I had lying around, it

turns out it didn’t have enough force and jams from time to time. I ended up using one of the famously cheap yellow dc motors used in several robot kits. These motors take from 3V to 6V, and have enough force for our purpose.

There’s a small bump on one side of the motor enclosure, that side is the good one. The other is attached via a smooth rod and can get loose after a while.

At code level, to avoid jams we move forward the motor a few miliseconds and then a little bit backwards, we repeat this a few times each time we need to dispense some food. In the case a jam happens (very rare, but it does) and avoid overheating of the motor, we limit the number of times we try to move the motor. If it failed to dispense the desired amount of food, we emit an alert and try to dispense next time we wake up (we don’t change the alarm). If we succeed with our task, we set a new alarm for the next day.

To control the motor we use a H-bridge with the L293B, you could use a L293D or any other similar component.