LowPowerLab Forum

Hardware support => Projects => Topic started by: kolumkilli on November 08, 2013, 06:59:25 AM

Title: Moteino Coffee Maker
Post by: kolumkilli on November 08, 2013, 06:59:25 AM
The Keurig B60 is a very complex machine under that smooth black plastic skin.
It is extremely well designed and executed, with mechanical, hydraulic, electrical, and electronic systems all working in harmony, according to its design.  But sometimes, you want some things of a slightly augmented design.

It is somewhat difficult to take apart, but it can be done without a hacksaw or sledge hammer, and can be re-assembled unblemished.

Mine has two brains: one the original, and the other, the Moteino I added a while ago (Moteino R2 with RFM12B).  Why two brains?  It needed to be smarter, and be able to interface with me in different ways.  I don't have the time, attention, or eyesight to stand there looking at its little LCD screen - all I want is a cup of coffee from it, and right away.

It almost does that.  But, it takes a bit of time.  Just enough time that I don't like to stand there and wait for it to heat or to brew.  Yes, two things to wait for!  From a cold start, the machine takes just over one minute to get to brewing temperature.  Longer if the room temperature is lower than average.  The actual brewing takes a bit of time as well, the better part of a minute.  (I always choose the largest size, which takes the longest.)

So I had thought, wouldn't it be great to add a Moteino, and just turn it on and at least get it heated up, right from my desk?  (Another solution would be to move the machine to my desk, but there are actually several good reasons against this.)

Of course it would be better with Moteino!  So with RF commands, I gave this machine another interface that will do button presses, and obtain the status of the lights on the control panel.  The only things I cannot do remotely are:

1) Physically load the coffee charge cartridge into the machine
2) Place my empty cup in the target area
3) Remove the spent charge
4) Retrieve my freshly brewed cup of coffee.
5) Set the time, schedule, or any of the "advanced" functions.

I suppose there is no worthwhile remote solutions for these, although maybe there is a robotic solution possible for items 1 and 3.  But we are pushing silly there.  Item 5 was overkill, I would need to interface to the LCD and learn all the button press sequences and code them.  Possible, but I would need an additional Moteino because I would be out of pins with just one.  Just not worth it.  Fortunately, the coffee maker is not set to display the time, so it is not annoying.  In fact, I only found the time and advanced schedule stuff after I started investigating the control panel to interface to it.  Much easier to move all that to outside systems now, with the single Moteino relaying status and commands.  Items 2 and 4 involve me physically anyway, since I am the user of the coffee cup ... if only there was a way to transmit cup and coffee by RF...

So, from a browser, hitting a PC with a web server, connected to a gateway Moteino, I can manually turn on and off the machine without walking over to it.  If I remembered to load the coffee charge in, and I know there is a cup there, I could hit the brew button from my desk as well... but this never happens.  I think I will try to adjust my habits, and buy a second coffee cup, so that when I retrieve a cup of coffee, I reload with a new charge and place the second cup there, so it is all ready.  That would work until I forget the cup one time - so I am thinking I will eventually (or, soon) add Felix's EE-SY310 photo reflective sensor breakout to detect the cup.

This would actually save me about 10 minutes per day, believe it or not.   Maybe even more.  That adds up!  I could use that time coding for Moteino...

Peering into the future, I can see me successfully adjusting my habits, and hitting that brew button, but then eventually getting that cup of coffee, long after it has gotten cold.  That would be acceptable.  I prefer fast coffee to hot coffee.  But, I could also add a reminder system once I hit brew - one that would be canceled at the machine, by the removal of the cup, or something like that.  Because I prefer hot fast coffee to cold fast coffee.  We shall see.

Much more important was the morning fuzzy-thinking-before-coffee situation.  (A thing of the past.)  That solution involved other nodes, so I will describe that whole thing in another post.  Main point is, since my coffee maker responds to RF commands, they can come from me thru the gateway, or they can be sent by other nodes directly, if they were designed to interact with the coffee maker.  And what fun would it be if they weren't...?  More to come.


Here are some pictures.
First is the inside of the Keurig B60. 

(http://farm4.staticflickr.com/3683/10735910966_2836a872ef.jpg) (http://www.flickr.com/photos/15304611@N03/10735910966/)

It is really pretty amazing.  It does a lot and it's actually inexpensive if you take into account all the components and assembly and so forth.  As with any complex machine like this, you have to treat it nicely, keep it maintained, and it will repay you will long service.  I use only filtered water, have never needed to de-scale it, and it has served me with exactly zero failures for more than two years.  I just needed to make it a little bit more excellent - by adding Moteino.

Once you get the control board, you can see there is an LCD, but as I am not using any of the information on it, I didn't need to interface to that.  There is a momentary push button at the top, and four below the LCD.  The top one is power, the ones below from left to right are: brew 6 oz cup, menu, brew 8 oz cup, brew 10 oz cup.  I think that other than testing the connections in this interface, I have only ever used the power and brew 10 buttons.  I can't speak for other users of the machine, but I am pretty certain no one has ever touched "menu" except perhaps accidentally.

(http://farm8.staticflickr.com/7399/10735915674_cefbedcf6c_z.jpg) (http://www.flickr.com/photos/15304611@N03/10735915674/)

One interesting thing is that all of the buttons are on the same control line to the controller.  There is a network of various different resistors creating a system of voltage dividers, and the controller apparently detects specific changes in voltage to determine which button was pressed.  I didn't want to mess with that, so I elected to simply put a relay in parallel with the switches I wanted to control.  The back view of the board shows some connections, I don't know why, but I didn't snap a photo when I had all the connections done.  Here I just have power and the power switch hooked up.  The control board runs on 5 volts, so I just took power from here to power the Moteino.

(http://farm4.staticflickr.com/3672/10735910636_5a93a737e8_z.jpg) (http://www.flickr.com/photos/15304611@N03/10735910636/)

There is nothing on the LCD that isn't reflected in the states of the various LEDs on the device.  If they are lit, not lit, flashing, I can tell what the deal is.  So no need to decompile the LCD design (it is a custom one).  Instead, just monitor the LEDs: one for each brew button, and one for the "add water" light.  Really I just needed a single brew button and the add water light.

When the machine is off, the add water light (and all lights) are off.  When it is on, the add water light is either on continuously if there is sufficient water in the reservoir, or flashing if there is not enough.  If there is enough, then the machine will heat the water.  If the water is hot, the brew buttons light up continuously.  When you cycle a switch in the mechanical assembly that houses the coffee charge, it assumes you have put one in, and you are ready to brew - the brew buttons flash.

The LEDs are all active low, and feed right into the digital inputs of the Moteino.   Couldn't have been easier.  (Much easier than getting the external case off.)

I made a little wiring harness to come down from the control board, down the side of the machine.  The heat shrunk cubes are my two relays (one for power, one for brew 10). 

(http://farm6.staticflickr.com/5504/10735910346_8680664264.jpg) (http://www.flickr.com/photos/15304611@N03/10735910346/)

The Moteino is easily removed from the connector, in case I need to replace it. And locating it at the bottom of the machine means I do not have to disassemble the entire thing to get to it, like I had to do to get to the control board.  There are some extra wires that dead end in a heat shrink tube ending.  Those lead back to buttons and LEDs (menu and brew 6 and 8 ) that I don't use now but might want to use in the future.  Yes, I ran these wires, because getting that case apart is that difficult.

With everything in place, the Moteino is easily accessible by simply removing the bottom plate.  I added a serial connection that comes out where the power cord exits the case, so that I can plug in and monitor it directly if I like to check stuff out, or to do a non-wireless flash of the MCU.

(http://farm3.staticflickr.com/2856/10735915144_509a3bffc8_z.jpg) (http://www.flickr.com/photos/15304611@N03/10735915144/)

You can't really see the Moteino so well in the case like this, here is a close-up.

(http://farm3.staticflickr.com/2853/10735814815_9d844a4e76_z.jpg) (http://www.flickr.com/photos/15304611@N03/10735814815/)

The antenna is a half-wave monopole in a coil, it goes right up the side of the machine, where there is an air space.  As the Moteino is easy to remove, here is a picture of it next to where it actually lives, just outside of the machine.

(http://farm4.staticflickr.com/3789/10736128783_62fbd9919f_z.jpg) (http://www.flickr.com/photos/15304611@N03/10736128783/)

Here is a screen shot of some direct serial output. 

(http://farm6.staticflickr.com/5538/10736128593_362b317c38.jpg) (http://www.flickr.com/photos/15304611@N03/10736128593/)

The status of the machine in monitored continuously, and can serve this information out to any RF nodes on the network (including gateway nodes connected to web server).  In this shot, the machine is turned on, it heats up (CW means it is Cold, and there is Water - HW means that the water is now Hot).  The reporting interval is 5 seconds, so you can see that it takes a bit more than a minute.  After 5 minutes, it sees that no status has changed.  No one has brewed anything, we are just sitting there wasting energy, keeping that water hot, losing the heat to the surrounding air.  I tend to believe we are also eating into the lifetime of the heating element and the water pressure sensors, and other related components.  So I have the Moteino set to shut it off after five minutes.

At some later time, node #87 on my RF network sends it a command to turn on.  Since it was not fully cold, the water only takes about 40 seconds to get to brew temperature.  Sadly, it will simply just turn off in five minutes, because no one is physically there to load a coffee cartridge.

Maybe this isn't that exciting, but it could be the caffeine talking...
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on November 12, 2013, 10:46:10 PM
The genesis of this project actually comes from the development of an entirely different, but related system.
The reasoning behind it can be found in this post: http://lowpowerlab.com/forum/index.php/topic,200.0.html (http://lowpowerlab.com/forum/index.php/topic,200.0.html)
Title: Re: Moteino Coffee Maker
Post by: Cabe on November 13, 2013, 04:37:14 AM
If you didnt already know, you made Hack-A-Day! http://hackaday.com/2013/11/12/wireless-keurig-hack/

I was thinking "I'm sure I read this article already" :)
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on November 13, 2013, 10:47:18 AM
That's great!
I see there is a robot to pick and place the coffee cartridges.   Now you got me thinking....
Title: Re: Moteino Coffee Maker
Post by: Cabe on November 13, 2013, 11:18:12 AM
If it doesn't get made with LEGO, you've done it wrong :)
Title: Re: Moteino Coffee Maker
Post by: Cabe on November 14, 2013, 11:43:19 AM
And now also on Sparkfun!

The Common Methods of Hardware Hacking.


Someone should warn Felix....
Title: Re: Moteino Coffee Maker
Post by: Felix on November 14, 2013, 12:19:26 PM
What! Hmmm.....  I guess that can't be a bad thing right? ;)
At this moment it's also on sparkfun front page: https://www.sparkfun.com/
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on November 14, 2013, 01:45:05 PM
Wow, that is great!
The other hack, the Kitchen scale, actually uses Sparkfun components in conjunction with Moteino....

Title: Re: Moteino Coffee Maker
Post by: LazyGlen on January 04, 2014, 03:04:02 PM

Clearly, you are a professional grade hacker.

Have you looked at the temperature sensor on the Keurig? Any idea if it's digital, a simple thermistor or the new to me resistance temperature detectors (RTD)?

I have the remains of a Keurig (model unknown, though looking at your pictures, it may be the same one) that my parents left with me to recycle. Never one to dispose of something without the chance to learn how it works, I took it apart, breaking the housing in the process. Had I checked the web ahead of time, I might have been able to fix it, but I broke the housing trying to get it open. Subsequent web searches make me feel a little better about my inability to get the stoopit thing open without breaking it - they sure don't want us in there. The fault was the apparently fairly standard solenoid valve, but by the time I got there, it was past reasonable reassembly.

However, the marvelous little heating vessel and some of the associated tubing look like they could be used for something. A quick web search of the part number indicates the element itself has a 350 degree F (!) snap disc shutoff series-ed in. On the other side is an obvious temperature sensor going back to the control board. I have not had a chance to do much experimentation with it, but a ("Keurig hack") web search pointed me here, and since I already belong to this forum... I re-read your post, but I don't see that you have hacked into this portion of the system.

Anyway, I thought I would ask.
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on January 07, 2014, 09:17:48 PM
LG, I took a good look at the "boiler", but not good enough to tell you what kind of temperature sensor is in there, if there even is one.  With the amazing economy of engineering in this unit, I would not be surprised if they relied entirely on the ideal gas law and the single pressure sensor I saw.  That is mounted on the control board, it's the one marked FPN-07PG.  Since the solenoids control the total volume, and there are water level sensors to give you the partial volume of water, the air pressure ought to give you the temperature, or at least, close enough for coffee.

Now I don't know that this is the case, it just wouldn't surprise me.  They've really done a wonderful job minimizing component count, or at least making the most use of inexpensive components.  I mentioned the resistor network that allowed them to use a single control channel to interrogate the state of all the switches at once... It is amazing that they can manage to produce such a complex machine for the price.

Don't feel bad about cracking the case - you can't make omelets without breaking some eggs, right?  This is a particularly hard case to get into.  Once in you can file the appropriate surfaces to make it easier the next time.  But I guess you are past that now.

You said there was an obvious temperature sensor.  I didn't see that, and by that, all I mean is that it was not obvious to me.  Attached is a (sorry, blurry) picture of the top of the boiler unit.  There are three wires at the top, red, white, and black.  They seem to be the water level sensors for the 6, 8 , and 10 ounce cups of coffee.  I could be wrong about their function though.  I didn't remove the boiler unit from the housing, and there may well be another set of wires leading into the chamber from the side, but I did not see them.  I did see the water inlet and the heating element contacts coming in from the bottom of the chamber.

I did take a fairly good look at the various circuit boards, but I was really just hunting for i/o, so didn't pay too much attention to the rest - it works great, so didn't want to mess with what was working.... 

For what it is worth, you can get replacement solenoids fairly cheap, if you were interested in doing that.  Even the case can be replaced if damaged beyond repair.  But if not, yeah build something else!  It really is a great little heating chamber.

Title: Re: Moteino Coffee Maker
Post by: LazyGlen on January 08, 2014, 12:02:15 AM
I don't feel too bad about breaking it up, more of a pride thing. I went into it with an attitude more towards seeing some neat parts and learning something rather than expecting to fix it. If Dad says it's broke, it is usually really broke.  :) Besides, my wife would kill me if I put another appliance that she cares not one bit about on the counter! And once the first part broke, I started in with the diagonal cutters to get all the plastic out of the way to see what was there.

I'm wrong on a regular basis, but I don't think this is one of those times. I removed the boiler entirely and have thrown away most of the housing and the parts that don't interest me. I did still have part of the innards that mount the boiler in the trash can, and when I realized I might be able to use the boiler, I remounted it. I filled it up with water and reconnected the power cord just to verify that part was still working.

I just took a pic: https://dl.dropboxusercontent.com/u/11255798/Keurig.jpg (https://dl.dropboxusercontent.com/u/11255798/Keurig.jpg) In it, you can see the black power cord come in and wire nut to the white heating element wires. 1 wire goes around the back of the unit and connects to 1 side of a snap disc over-temp thermometer. I have been able to read the part number on this (L105-20C) which searching tonight reveals as opening at 105oC, I'm not sure how I got the 350 the other night,. Though I do remember thinking it had to be wrong.

From the other side of the snap disc, the wire goes to one prong of the heating element entering the bottom. In an unfortunate parallax coincidence, the second prong and wire do not appear in this photo, being hidden by the first.

Also in this photo you can see a much smaller gauge pair of wires emerging from the band around the boiler. This is holding what I believe to be a sensor which tells the control board the temperature of the water. I have cut off the connector, but I am confident that on my unit, it is the white / white wire pair with a white connector.  I am not confident as to which of the plugs it connects to on the power board, but I THINK the attached picture of it shows where it goes:
https://dl.dropboxusercontent.com/u/11255798/Keurig%20power%20board.jpg (https://dl.dropboxusercontent.com/u/11255798/Keurig%20power%20board.jpg) for a couple reasons.

I post this information in case anyone who really wants to have closer control over the temperature of the water emerging from a Keurig could benefit from it. Having this signal into your Moteino might allow you to customize brew temps for different people. I will note though, that in looking for information on the part, I have read of others having a difficult time getting very close to boiling temps. Since there aren't really any currents in the water, what water is in contact with the element boils and cavitates and makes a mess. I'm not a coffee connoisseur, so I know nothing about the ideal temp.
Good luck to anyone who may use this info, and be careful.

Title: Re: Moteino Coffee Maker
Post by: Cabe on January 08, 2014, 05:16:28 AM
Most people (myself included) use "just off the boil" of around 95degC

Conveniently this is usually the temp of water from my electric kettle, if I wait for it to click off and then start making my coffee :)
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on January 08, 2014, 10:14:26 AM

I looked through my various pictures to see if I had captured any of this, and indeed I had - enough to tell me that I have the same model and revision power board, and the heating chamber does look identical.  So if it was not the very same model, it was pretty close.

So, I cracked mine open again today just to see what each connector goes to.  Your guess was correct, the NTC connector goes to the sensor mounted in the band, and I think you are right on that it is a thermistor.

The others are:

"Door" - leads to the switch in the K-cup receptacle/handle assembly, to tell if it is shut.
"AP" - leads to an air pump.  This is what forces the hot water out of the chamber and ultimately into your cup.
"CWP" - cold water pump. This is the pump that draws the water in from the tank.
"CWT" - going to guess that the T means "tank", this leads to the magnetic cold water level sensor, to indicate that there is enough water to do the job.
"VV" - both of these lead to the two solenoid valves. J7 leads to the one on the side, near the air pump, J4 leads to the one at the rear of the machine, under the overflow spout.  You can see these in one of my original pictures.

Hope this helps.

Let me know if you want me to check anything else, while I have it apart... I'm going to need a cup of coffee soon....!
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on January 08, 2014, 12:39:28 PM
Interestingly, the user manual (http://www.keurig.com/customer-service/brewer-registration-and-support/~/media/files/keurig%20brewer%20manuals/b60_usecareguider4_09.ashx) shows that you have the ability to program the brew temperature from 187 to 192 degrees F (86.1 C to almost 88.9 C).  That's quite far off from 95 C (203 F) that Cabe mentioned.  My coffee does not seem cold, however.

There are no trim pots or the like on this board, so it looks like it is calibrated digitally.  There is a 44-pin TQFP microcontroller on the reverse side of the board.  Actually it is this chip (http://ww1.microchip.com/downloads/en/DeviceDoc/41250E.pdf).

They may calibrate with commands coming in on J13, which is the connection up to the control panel.  They may use a special programming control panel in assembly and maybe their control program can receive special commands on the i/o that cause the unit to create calibration points.  Or maybe there is a secret button sequence on the actual panel to give you calibration access. They may store these offsets in the microcontroller's EEPROM.  Total speculation here.

Or maybe the sensor is of sufficient quality and repeatability that no calibration is necessary - not sure, but I tend to think this is not the case.

Seems like the chip could be dumped and analyzed, but I am not up to it today, though, as the one cup of coffee I had before taking the machine apart is rapidly wearing off...

LG, I think your best bet is to just take some reference resistance readings on that sensor, which is likely to just be an analog sensor, at known temperature points, and come up with a calibration curve.  Just a regular old multimeter will tell you what it's doing, and you could then power it from a Moteino digital pin or just VCC, and make it one resistor in a voltage divider that you feed into one of the Moteino ADCs, and apply your constants from your calibration curve in your code, or better yet, make a new curve with the ADC values at the reference temperatures.  But measuring it manually first will give you some sense of the range and linearity you can expect, in order to design your circuit.
Title: Re: Moteino Coffee Maker
Post by: kolumkilli on January 08, 2014, 01:36:56 PM
OK, I need that cup of coffee, so I'm going to re-assemble now.
Since I had it apart, I thought I would just unplug the sensor and measure it quickly.
Got about 40K Ohms at room temperature (cool here), and the resistance varies with temperature, cooler giving a higher resistance.
So this indeed jives with the label "NTC", for Negative Temperature Coefficient (not Thermocouple), so I think it is safe to say we have a regular thermistor here.
In the relatively narrow range I tested, it seems to correspond well to model 44008 (http://www.omega.com/temperature/Z/pdf/z256-257.pdf) or equivalent.

Title: Re: Moteino Coffee Maker
Post by: LazyGlen on January 08, 2014, 02:50:05 PM
Thanks for checking, I'm glad you could corroborate what I saw.

As far as brew temps go, after the stoopidity with McDonalds coffee years ago, I'm guessing that they went for (good_enough && No_Burns) over (ideal_brewing_temp). I will rig up a safer than 'lean it in the kitchen sink, plug it in and don't touch' test location when I get to messing with it again.

I hope I didn't interfere with your caffeine intake too much!

Title: Moteino Coffee Maker
Post by: dr_barger on December 08, 2019, 02:08:25 PM
I know this is an old post, but I've searched for the Keurig's low water temperature issue and haven't found anyone that's posted a solution.

The first cup in the morning may only be 155 degrees in the cup due to heat loss from the myriad of hoses, fittings, and nozzles inside the maker. I added a resistor in-line with the temperature sensor on the water heater boiler tank. This causes the temperature controller to interpret the signal as a lower temperature.

As you mentioned above, the temperature sensor is a thermistor that is attached to the side of the water tank by a stainless steel band. I cut one of the leads to the thermistor and soldered wires to extend it to the base of the coffee maker. This allows you to attach different value resistors to the wires and test without having to disassemble the maker each time. I also added a toggle switch to bypass the resistor which returns the water temperature regulation to its standard setting.

I settled on a resistor value of 680 ohms which increased the Keurig's water temperature by almost 20 degrees F. The larger the resistor's value, the higher the water temperature. If you put in too large of a resistor, the effective setpoint may be greater than the water's boiling point and the heater will run continuously.