Coffee Grinder With Arduino

Updated 04 November 2016

Using a few bits and pieces, this ordinary coffee grinder now has two presets to run the motor for a programmable length of time. The idea being that the grinder running for a set amount of time will deliver a certain amount of coffee each button press meaning the beans can be stored unground, keeping them fresher for longer.

I completed this project for a friend, Ian, who lives for coffee. Ian wanted the same functionality in his old coffee grinder that his newer coffee grinder has (decaf and regular coffee grinders respectively).

See the finished project in action below!

The presets are adjustable from 0.1 to 24.4 seconds, in 0.1 sec increments.

The factory on switch powers the 9v ACDC power supply, powering all the low voltage items and the factory start primes the countdown.

A "purge" button runs the grinder without the countdown so the user can dispense any old coffee or put through any cleaning product.

Items used in the build:

  • Arduino Pro Mini
  • 2x16 LCD
  • Two solid state relays
  • LED momentary push buttons
  • Typical consumables: heatshrink, wiring, solder, resistors etc.

The concept is fairly straightforward but it wasn't without it's hiccups. There is a factory coil operated relay in the grinder that I tried to keep in place. In hindsight this was a bit daft (a relay controlling a relay) but I wasn't 100% sure of it's function and wanted to keep modifications to a minimum, reducing the work required to bring the grinder back to stock if needed.

With the original relay in place, the LCD would display garbled characters and the preset functions would run of their own accord. After a bit of research I figured it was electromagnetic interference (EMI). I tried all sorts of things over a very long time to try sort this out. Aluminium tape, ferrite beads and voodoo just to name a few. When I finally tried bypassing and removing the original relay, the project operated flawlessly. Being a coil relay with such a large current / voltage, it seems obvious now that it was the source of the EMI.

I strongly recommend the Core Electronics illuminated pushbuttons. They look great, have an excellent feel and tactile response. Blue, White.

Link to the wiring schematic:

Link to code on github:

Feel free to email me if you have any questions: [email protected]

Thanks for reading!

Note - Do not play with 240VAC devices unless you are qualified to do so! Mistakes could be lethal.

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.



Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.