JavaWatch automated coffee replenishment system

With the JavaWatch system from Terren Peterson, there’s (Raspberry Pi) ZERO reason for you ever to run out of coffee beans again!

By utilising many of the Amazon Web Services (AWS) available to budding developers, Terren was able to create a Pi Zero-powered image detection unit. Using the Raspberry Pi Camera Module to keep tabs on your coffee bean storage, it automatically orders a fresh batch of java when supplies are running low.

Coffee: quite possibly powering Pi Towers’ success

Here at Pi Towers, it’s safe to say that the vast majority of staff members run on high levels of caffeine. In fact, despite hitting ten million Pi boards sold last October, sending two Astro Pi units to space, documenting over 5,000 Code Clubs in the UK, and multiple other impressive achievements, the greatest accomplishment of the Pi Towers team is probably the acquisition of a new all-singing, all-dancing coffee machine for the kitchen. For, if nothing else, it has increased the constant flow of caffeine into the engineers…and that’s always a positive thing, right?

Here are some glamour shots of the beautiful beast:

Anyway, back to JavaWatch

Terren uses the same technology that can be found in an Amazon Dash button, replacing the ‘button-press’ stimulus with image recognition to trigger a purchase request.

JavaWatch flow diagram

Going with the JavaWatch flow… 
Image from Terren’s project page.

“The service was straightforward to get working,” Terren explains on his freeCodeCamp blog post. “The Raspberry Pi Camera Module captures and uploads photos at preset intervals to S3, the object-based storage service by AWS.”

The data is used to calculate the amount of coffee beans in stock. For example, the jar in the following image is registered at 73% full:

A jar which is almost full of coffee beans

It could also be 27% empty, depending on your general outlook on life.

A second photo, where the beans take up a mere 15% or so of the jar, registers no beans. As a result, JavaWatch orders more via a small website created specifically for the task, just like pressing a Dash button.

Terren won second place in’s Amazon DRS Developer Challenge for JavaWatch. If you are in need of regular and reliable caffeine infusions, you can find more information on the build, including Terren’s code, on his project page.


Terren Peterson avatar

That is an outstanding looking coffee machine, and the bean dispensers are clear. Looks like a good project is in order to build a JavaWatch!

mahjongg avatar

History repeats itself, or does nobody remember the trojan room coffeepot, the worlds first webcam.
One of the early features of what would become the internet.

Derek Board avatar

I hope somebody changed the filter on your new coffee machine…

SheddyIan avatar

I am troubled by your bias.

It has been shown* that the intake of caffeine by engineers is proportionate to the quantity of bugs in code and hardware. They’re too hyper to realise mistakes.

Drink properly brewed tea for a more relaxed, yet refreshed and energised, team and workplace.

Raspberry Pi can brew tea too

*Correlation only proven in my imagination

Simon Long avatar

Couldn’t agree more. Every now and then, I try a cup of coffee from the shiny machine to see if I can persuade myself to like it, but I invariably give up after two sips and pour the rest down the sink. Filthy stuff…

Alexander Pozharskiy avatar

Maybe I missed something – but why he use image to check count instead of tensometer (or some other way to check container weight?)

karan avatar

…or hack up some electronic weighing scales?

Alex Bate avatar

The idea is that the system is portable and can be used for various household items. Something that a coding novice could put together. I would imagine going by weight means you need to calibrate to the weight of various containers, plus there may be an added expense for the user. The AWS had a preset for recognising beans.

Jim Manley avatar

Any promotion of caffeine abuse (all use is abuse) is grounds (pun fully intended) for an infinite number of lawsuits that will put numerous lawyers in still-ill-fitting, new, fancy suits after they allege and convince juries (warranted or not) of the evils of such liquids (the word “beverage” does not apply to coffee in any form, especially Starblechs), including, but not limited to, every US Federal Drug Administration (FDA) black-box warning ever published (the dire predictions on/in packaging of everything from loss of control of certain kinds of gastrointestinal movements to premature death).

Otherwise, have a nice day! :D

Steffi avatar

The best use of an device! I love the idea!

Wombalele avatar

What in all the names of all good gods. I was working on this very same thing on my very own self as a project to learn python. Coming here to get a fresh install of rasbian and I find this!!? Good heavens boy! Did you buy my webhistory?

Comments are closed