I designed, coded, and 3D printed a automated pill dispenser using an Arduino and other Arduino parts.
You deposit the pills in the top into a large trough that goes into a funnel, and from there there is a rotating disk that picks up individual pills and drops them off. There is a rotating agitator (the grey piece), which prevents the pills from getting stuck. To detect whether or not a pill has fallen into the rotating disk, there is a light sensor that checks whether or not the light is blocked.
It used a single step motor to move both the disk for moving pills and the agitator. I used gearing to allow for different speeds as the agitator needed to move much quicker than the rotating disk.
All of the logic was done in C, although the primary challenges in this project were in wiring and the 3D design.