Using Initial State to Build a Quantified Coffee Machine

We like to feature unique and interesting applications of single-board computer (SBC) projects from the maker community, and how that data is streamed and visualized within Initial State. If you’d like to share your Raspberry Pi, BeagleBone Black, or other SBC project with thousands of other makers, complete our short form and we’ll get in touch!

Meet James, from Indianapolis, Indiana.

James, what have you built here?

I wanted to measure the amount of coffee consumed in our office, so I built a “Quantified Coffee” machine.

What hardware/software are you using?

  • DYMO M10 Digital Postal Scale – to capture weight measurement data from our office coffee pot.
  • Raspberry Pi – a single-board computer used to process and to store that data.
  • Initial State – to stream the weight measurement data into an easy-to-read, tiled dashboard.

Below is a short video that showcases the finished product, and here is a link to a blog post that shares some more details and code.

How are you using Initial State to stream data?

def logToInitialState():
    utcnow = datetime.utcnow()
    bucketKey = "{0} - coffee_scale_data".format(_environment)
 
    streamer = Streamer(bucket_name="{0} - Coffee Scale Data".format(_environment), 
            bucket_key=bucketKey, access_key=_initialStateKey)
 
    if potIsLifted():
        streamer.log("Coffee Pot Lifted", True)
    streamer.log("Coffee Weight", _currentWeight)
    streamer.close()

The above code, combined with a morning’s worth of people lifting the coffee pot to pour their mug and refill the pot, give me two tiles that look like this:

Initial State Tiles

All of the Python code that I wrote is available on github.

TODOS:

  • I’d like for the “Lifted” tile to appear as just a number, rather than “true X 11”
  • It’d be great if there was a way to provide a public dashboard view of this visualization
  • Additional metrics for: # of Full Pots, # of mugs poured, etc.

Leave a reply:

Your email address will not be published.

Site Footer