The Bluetooth Coffee Pot

Today, a coffee pot; tomorrow, the world!

Devon Tivona
Physical Computing

--

Katie and I have always been fascinated with home automation and the “internet of things.” After learning a little about the Arduino platform from Jiffer Harriman, we embarked on our own digital automation project.

A video demonstration of the coffee pot at work!

We have a grand vision of connecting an entire house full of different appliances, controllable via the web or mobile. To start, however, we decided to begin with the most important appliance in the house: the coffee pot.

Our original conception of the coffee pot was to use an Arduino Yún, because this Arduino can connect to a local network via 802.11 wireless or ethernet. Unfortunately, the Yún required quite a bit of setup whenever they were moved to a new network, making this an infeasible approach to a project that we wanted to demo several different places. As such, we decided to make the coffee pot communicate with the outside world via Bluetooth.

This was an exciting chance to play around with Bluetooth LE (4.0) technology, because this is the only type of Bluetooth connection supported by Apple’s APIs, and we wanted to make an iPhone application which controlled the appliance. (Side note: Apple only supports BLE because of the low amounts of battery power this connection uses. If Apple opened an API to other types of Bluetooth, it would give the perception that iPhone batteries died quickly.)

The schematic for the Bluetooth Coffee Pot. (Please excuse minor errors, we are computer science and psychology students, not electrical engineers!)

Hardware Instructions

  1. To build our Bluetooth Coffee Pot, we used the Arduino platform. We hooked the coffee pot up to an Arduino Uno, which we then connected to a RedBearLab BLE Mini so that the coffee pot and the iPhone could communicate via Bluetooth.
  2. To power the Arduino, we wired up the original power switch on the coffee pot to send power through a 9V AC adapter, which we wired into GND and VIN on the Uno. When the power switch is on, the Arduino is powered, but the heating element in the coffee pot itself is not.
  3. To activate the heating element, we used Sparkfun’s Beefcake Relay Control Kit, which allowed us to control a high voltage device with the Arduino. The relay was connected to one of the digital pins on the Arduino, so that we could control when the heating element was on/off via the program we loaded onto the board. The other side of the relay was connected to the original on/off switch on the coffee pot and to the coffee pot’s heating element. With this configuration, we could now use a digital pin on the Arduino to control the high voltage heating element.
  4. We tucked all of this hardware into the bottom side of the coffee pot (we decided to use a Bella One Scoop One Cup Coffee Maker due to its simplicity). The original coffee pot has an on/off switch that begins the heating process for the water, so it was fairly straightforward to get in there and hack it. We did run out of space in the base of the original coffee pot, so we 3D printed an extension to the enclosure, which gave us about an inch more depth to work with.
  5. On the top side of the coffee pot, we also included a Sparkfun Metal Pushbutton — we used this button to “arm” the coffee pot (we imagine that the user would put water and grounds into the pot before going to sleep, “arm” the coffee pot so that it knows it is ready to brew, and then begin the brewing process via a native iOS app from bed the following morning). We also wired the button up to a digital pin on the Arduino to control what each press of the button should do (press once to arm; once armed, pressing again would begin the brewing process). The button included an LED as well, which we used to indicate various states of the coffee brewing process via different light patterns (off, error — a fast and short flashing pattern, armed — a solid light, and brewing — a slow flashing pattern). We wired the button LED up to a digital pin on the Arduino (we had some wiring running up the back of the coffee pot to do this), so that we could control the various states via the program on the Arduino.
  6. We also wanted to make sure that the user could not “arm” the coffee pot when there was no water in the reservoir, so we created a high resistance circuit with two nodes glued near the bottom of the reservoir. These two nodes essentially acted as a potentiometer, so when there was no water in the coffee pot, the value was at or around 0, and when there was water, the value was at 500+, and this communicated to the Arduino that there was water in the basin and that the coffee pot could now be armed. If the user tried to arm the coffee pot while there was no water in the reservoir, the LED on the pushbutton would flash the error pattern.
A view of the wiring in the base of the coffee pot. Note, the Xbee in the top right is not used in the current circuit, but could be used in the future for other types of wireless communication.

Software Communication

The Bluetooth connection between the iPhone and the Arduino was relatively straightforward. Apple exposes an API called CoreBluetooh to interact with BLE devices from your iOS app, and RedBearLabs has published a thin SDK wrapper around this API to make it a little easier to work with.

Messages are sent between the Coffee Pot and the iPhone in three byte sets. As such, we never need to have starting and terminating values, because we know that the values will always come in sets of three. The first values specifies a “key” for the message, and the second two bytes specifies a “value” for the message. For example, the key for the water state of the coffee pot was 0x0A, and the value was a number between 0 and 1023.

Resources

The code for the iPhone application and the Arduino sketch are both available on Github. The 3D model for the base extension is also available for download as a Sketchup file.

Thanks for your time! Now, go forth and brew!

--

--