Inspiration

Graduate Students in Computer Science are very busy and are constantly on the lookout for means of increased efficiency in their daily lives. This project aims to increase efficiency by saving the up to 3 minutes of effort required to walk down the hallway to the break room to see if there's coffee available. Our project pays homage to the University of Cambridge's Trojan Room coffee pot (https://en.wikipedia.org/wiki/Trojan_Room_coffee_pot), but is implemented to view a much cooler Computer Science department's coffee dispensing apparatus.

What it does

Instead of exerting the effort of walking all the way down the hall, we may simply check a website with a livestream of the coffee pot along with some built-in image processing to let us know that yes, The Coffee Pot Is Full. The webserver also uses image processing to estimate the amount of coffee left and plots a time history of the most recent coffee pot levels. Furthermore, we have text notifications enabled to alert users when certain conditions are met.

How we built it

Our domain name of ksucscoffeepot.tech was registered using Domain.com and we have a webserver running on a Linode instance. Our Raspberry Pi is using the PiCamera library to continually capture images via its serial camera. Our Raspberry Pi is connecting to our webserver using a Python socket and streaming the camera feed to our webserver. The webserver is running code which crops the image to focus on the coffee pot, turns the image to grayscale, and then computes a threshold filter on the image effectively counting the number of dark pixels over light pixels. The more dark pixels in the processed image, the more full the coffee pot is. Our webserver is populating a MySQL database with time stamped data to allow a "coffee quantity over time" graph to be generated in real time and displayed on our website. Our website automatically refreshes every 5 seconds so you can always get an accurate, up-to-date status of the Computer Science department's coffeepot without having to leave the comfort of your own desk! Most importantly, due to integration with Twilio, the webserver will text the nearest PhD student to the CS coffeepot (Scott) when it needs some attention (aka refilling).

Challenges we ran into

Networking: It was tough to get all the parts talking, especially at the start to get the image off the Pi and onto the webserver (though none of us have strong web dev skills).

Image Processing: The method relies on a calibration routine which must be redone if the camera view or ambient lighting changes.

Database: Getting the MySQL database running and populated wasn't too bad, but it was done with no prior knowledge of such a task.

Accomplishments that we're proud of

It works! Do a lot of work now to save a tiny amount of work later!

What we learned

General topics we gained experience with: Twilio, Networking, Webservers, Databases

What's next for Is The Coffee Pot Full?

There probably isn't much more work we will do, but here is our current wishlist of unimplemented features:

  1. Improve image processing calibration to account for irregular carafe profile, glares, and lighting levels
  2. Make the webpage look nice
  3. Continue to tweak the plot for readability
Share this project:

Updates