Web-Enabled Coffee Maker
04 December 2011 - NOTE: The project is up and running although this write-up is far from complete. Final exams are looming, but I will do my best to get as much documentation up here as I can, as quickly as possible. If you have any questions, please don't hesitate to shoot me an email!
Tis' November, and that means it's semester-end final project season!
This years' project spurred from every engineering student's basic need for caffeine combined with the outrageous price of on-campus coffee, both coupled with the perpetual need for convenience and a high level of geekiness.
The ultimate project goal was to take a ordinary, off-the-shelf automatic drip coffee maker and hook it up to the Internet with a nice little web interface that you could easily get at with a mobile phone or from a PC. The variables to be controlled include:
- Power to the brewer
- Control of a small pump to fill the water reservoir
- Some way of sensing the water level in the tank
Figure 1 - The Complete CoffeeNet System.
The completed and working system is shown above. On the far left is a pitcher of water the pump draws from to fill the reservoir. The coffee maker is in the middle, and on the right-hand side is the good stuff: custom hardware. The Coffee Maker Shield, Ethernet Shield, and Arduino are stacked up and connected to the coffee maker via a handful of a cables on the left. The silver box is an old computer power supply used to run the whole show. The pump sucked a fair bit of juice (>3A) so even a switching wall wart wouldn't cut it. The PC power supply a perfect fit since it also provided a +5V bus off of which the D-Link Wifi Router is run.
All the sensors will be tied back to an Arduino hooked up to the Internet through an Ethernet shield. Stacked on top of the Ethernet shield will be the "Coffee Maker Shield", a home-brew PCB with the connectors and circuitry necessary to get all the sensor data into something the Arduino can understand.
First piece of hardware to be designed was the reservoir water level sensor. The concept is quite simple: A light is shone into the water tank and six CDS photocells on the outside of the tank measure the light level. A PIC16F676 reads these six analog voltage and converts them to a three-bit binary number that correlates to the number of cups of water in the machine. Though this seemed like a very simple and straight-forward approach, the number of issues that stemmed from this method were astounding. The final water level sensor was much more simplistic, but probably still not practical for "production use" since it involves sticking a FR4 copper-clad PCB into the water reservoir.
As usual, the layout was done in Altium and uses almost exclusively surface-mount parts:
The second piece of hardware is the "Coffee Maker Shield". Though the design isn't finished, it will essentially be some connectors, relays, and LEDs on a PCB that stacks on top of the Ethernet shield. The Ethernet shield only uses four lines (TX, RX, CTS, RTS) so there's still plenty of IO left over for the coffee maker, however most of it is digital.
Above is a photo of the complete Coffee Maker Shield, R2.0a. The little piece of Protoboard in the bottom right-hand corner is a mod I will discuss in the firmware section later.
Above is the schematic for the coffee maker shield. Fairly straightforward; two MOSFETs are used to control relays that drive the water pump and control the power switch for the brewer. The two optocouplers in the bottom-center are used to check the status of the "Power" and "Program" LEDs on the coffee maker. The "Program" LED lights up with the machine is set to start from it's built-in timer; so we need to make sure the machine isn't in this state. Subroutines in the PIC firmware make sure that the machine is in a known state by cycling the power switch relay until it confirms that both LEDs are off.
Why photocouplers? I didn't want to spend any time or effort reverse-engineering the coffee makers' control board. By wiring the driving side of an optocoupler in parallel with the internal LED it makes absolutely no difference how the machine controls the LEDs, and there is no danger of blowing anything up because of ground loops. If the "Power" LED on the machine is on, the "Power" optocoupler will be on, and since it is pulled up to VCC, a logic "0" will appear on the PIC's input pin. The zero-ohm jumper resistor on each channel was just to simplify PCB routing (singled-sided board).
The water level sensor is connected to the Coffee Maker Shield via the whacky-tacky 80's rainbow ribbon cable. For condensation reasons, the ribbon cable connects to a little piece of PCB stuck to the back of the coffee maker with wires run inside to the actual level sensing strip. In the photo above you can also see the windshield washer fluid pump ($15.00 Princess Auto Special) screwed to the back of the coffee maker.
Above is a 3D rendering of the Water Level Sensor that actually worked (sort of). The concept is extremely simple: The large pad at the bottom is connected to 5V on the Coffee Maker Shield. Each of the six strips corresponds to a water level in the coffee maker reservoir, and the voltage at this point is read by an ADC on the PIC. As the reservoir fills with water, a connection is made between the large 5V plane at the bottom (and along the outside of the connector for that matter) and each of the cup level sensing strips. Each of the ADC channels is tied to ground with a 10K resistor on the Coffee Maker Shield, so the ADC will read zero when there is no water touching the sensing strip. When the water contacts the strip, that ADC channel is pulled towards VCC (about 2V), so the PIC knows that the water level has reached that level.
On the left-hand side of the board is an SMT footprint for a 2.54mm 5X2 Ribbon Cable Header. While this worked at first, the condensation from the brewer caused the cable to short out inside the connector. The solution? Cut the PCB (with a bandsaw, of course!) right below the connector and solder wires to the traces. The little chunk that was cut off is now stuck to the side of the machine and used as a connection point.
Making Coffee over the LAN. I'm still trying to get it working over DynDNS but my router is giving me issues...
04 December 2011: The project is up and running and I'm just putting the documentation together now - more details as they come in! All hardware designs and firmware will be available for download here once I get them tidied up enough to be legible. If you can't wait send me an email and I can fire over what I've got in it's present state.