Hand Grinder Automation
A hand coffee grinder turned into a motorized appliance, with a Raspberry Pi, a stepper-driven burr, an auger doser and a touchscreen.
What it is
The grinder is a hand grinder turned into a motorized appliance, run by a Raspberry Pi with a round touchscreen. The hard part is that one Pi has to step a motor at a steady rate, pulse a servo and run a touch UI at once, with the display and the motor driver sharing one SPI bus.
I make espresso every day and got tired of grinding by hand. A stepper replaces the crank, and an auger doser feeds the burr from a printed hopper.
Grinding and dosing
Two swipeable screens set the burr speed (30 to 150 RPM) and the feed rate. The doser starts 3 seconds after the burr, so beans only land on a burr that’s already spinning. Its continuous-rotation servo stalls at low speed, so it runs in short full-torque bursts spaced to set the feed rate.
Why three processes instead of threads?
The UI, motor and servo run as separate processes:
- Timing. The motor process times its step pulses with busy-waits, clear of Python’s global interpreter lock.
- The shared bus. Only one process can hold SPI, so the UI releases it before a grind, and the motor process holds it only to write the DRV8711’s registers, then steps over plain GPIO.
- Crashes. If a child process dies, the UI shuts both down and resets the screen.
Hardware
A NEMA 23 stepper turns the burr through a 2:1 gearbox, driven by a DRV8711 on a driver board I designed. The touch controller goes silent while a finger rests, so a state machine infers release by timeout.
Getting the drive quiet took a sweep of about 90 combinations of current, decay mode, blanking and microstepping, each rated for noise.













