How did we hack coffeemaker and had fun with it?

By Jarek Pełczyński, 25 Aug 2016

Introduction

On the Internet you can read a lot about interesting Internet of Things (IoT) projects, based on Arduino and Raspberry Pi. Also in our heads there were many ideas for electronic projects, which could make our lives easier, be useful and interesting.class_selector

In the end, together with Radek, we decided, that we will complete "a certain" project. In the beginning we faced a question what to start with. It seemed that Arduino is the solution for everything. A multitude of modules, shields and extensions gave a (false?) impression that nothing stood in the way of becoming the next Elon Musk and sending rockets into space.

We decided to start from the beginning, that is from basic electronic work done after hours. In my case, it meant revising and adding a bit to the knowledge gained in my school years. And so we went through courses in electronics, read books and watched videos on the YouTube channels dealing with this subject. We immediately begun to translate theory into practice by completing small projects. Later came the time for Arduino and playing with modules. When getting to know the Atmega microprocessor, we came upon a popular, though very enigmatically described, WI-FI module ESP8266.

Having already basic knowledge of and skills in Arduino, modules and ESP8266, we decided to do something bigger. After brainstorming, the most acclaimed project was the one counting amount of coffees made by a coffeemaker and placing that number (daily) on our new website.

Research

We started with searching for similar projects. It quickly became clear that we cannot count on having the job done for us. Although we found several references to projects involving modifying coffeemakers in some way, most often there was given no specific information as to how it was done. Therefore, we were left to act on our own.

The next step was to find the best way to collect data on number of coffees made. When pursuing interest in IoT (Internet of Things) projects we came upon Thingspeak service that offers an easy way of collecting data and presenting it on charts. In addition, it enables exporting data to popular formats i.e. JSON, XML. Sounds great!

We also started to play with ESP8266 which at times turned into a nightmare and frustration: unclear information about connections, problems with power supply reliability, and with connecting to WI-FI network. After about a week, numerous (more or less successful) attempts to create "something" on the ESP we began to meddle with coffee maker. At first, not knowing where to start, we tried to understand how a coffee maker works and how does a signal from a button make it begin to make coffee. After a few hours spent "in the coffee maker" we created first wiring diagram. It turned out that the front panel with buttons sends information in the form of different voltages to ADC of microprocessor, and that we can "intercept" these signals.

Prototype

We built a prototype on a breadboard, on which we had ESP-12 (ESP version with ADC, that is with a converter or analog-to-digital), voltage regulator (lowering the voltage to required 3.3V), a few resistors and capacitors for, among other, ensuring ESP operations are stable and correct, and buzzer as debugger. We wrote the first software in LUA (for NodeMCU) and plugged it to a coffee maker, and our prototype works! After pressing the "make coffee" or "make double coffee" you can hear a short beep followed by a long beep saying that the information about made coffee was sent to ThingSpeak.

We still had to add some "processing" of a signal. Using voltage divider on resistors to distinguish two additional buttons (ECO button and a button activating pressure pump for frothing milk), which send signals on the same path as coffee size choice is sent. And then something went wrong. When measuring current, and then voltage, Radek didn't switch plugs and a knob on the meter, which resulted in the coffee maker stopping to work. That was a short-circuit. Fortunately for us, it turned out that it was only a fuse soldered on the board of the controller of the machine. Phew.

The production project

The time has come to move items from the breadboard to universal port, add port for communication with the UART (for uploading software), signaling status on the LED (connecting to WI-FI and confirming sending data to ThingSpeak). And, of course, to improve software in LUA. In addition, using the React shares in ThingSpeak and IFTTT, we set notifications on Hipchat, sent by our bot Elmo and telling whether the device works. At the end, using data export in ThingSpeak, we managed data in JSON to display an information about amount of made coffees and amount of drunk caffeine on our website.

Conclusions

We are very pleased with the effects of the counter operations and with the manner of its implementation. It was our first project of this type, where we did not take a ready project from the Internet but made it step by step. In this case, we had to hack coffee maker on our own and take proper actions. Not to mention how much we have learned.

We are already new projects budding in our heads, and in the near future we will surely share their implementation. After the "success" of our counter, more people from the company expressed their willingness to participate in future projects – which makes us very happy and motivates us to deepen our knowledge of electronics.

Watch a movie!

Gallery

Prototyping and measurement.

Uploading new soft and testing

Soldering.

Pre-production testing.

Final and ready to deploy!

Counter on home page. See how many coffee we drink today!

Coffee counter stats at ThingSpeak.

About the author

Jarek Pełczyński — Front-End Maestro

We are proud to introduce our leading multidisciplinary specialist in: front-end development, UX design, detecting the tastiest foods in the neighbourhood and joking. He loves running up the hills and biking. Or both at the same time. Great in all of these things!

comments powered by Disqus