I recently retired and I'll admit I'm quite a noob at electronics. It's something that's always interested me but never had the time to experiment. Here's my first Instructable. If I made a mistake with the electronics, please be kind, but correct me.

Now that I'm retired I find that I get out of bed at different times. On some mornings I need for my Keurig coffee maker to come on before 6 a.m. and other mornings later. I wanted my Keurig to turn on automatically when I'm ready to get out of bed and I wanted it to run just long enough to make 2 cups. I know I could set it to come on at 5:30 a.m. and go off at 9 a.m. or so, but I don't want it to heat/re-heat water when I'm not using it, plus I needed a project to keep me busy.

I had done one other experiment with the Arduino Yun so I was not hesitant. I chose the Yun because it works over WiFi; I did not want to run Cat 5 cable from my router to my coffee maker. I wrote a short web page which I can run on my smart phone, which charges beside my bed. I 'borrowed' a sketch used to allow a web page to control the pins on the Yun and I shortened it for my one-command sketch.

So this is how it works... I go to this web page on my smart phone, click a graphic of my coffee maker, which is actually an HTML link to a page on the Yun which activates Pin 13, which closes the coil circuit on a reed relay for 4 tenths of a second, which activates the switch on my Keurig. The switch on my Keurig is a momentary switch that, when pushed, turns the coffee maker on when it is off or off when it is on. I still have to load a K cup and press the brew button, but having the maker heat the water while I get out of bed and get dressed puts coffee in my mouth faster.


Phillips screwdriver

solder and a soldering gun

wire stripper

wire cutter


1 Keurig brewer with a momentary (on or off) switch

1 Arduino Yun

1 AC adapter to 5VDC micro USB (Just Wireless AC Charger for Samsung cell phones)

4 standoffs (1 pk at Radio Shack)

1 piece of panel board, 3" x 3" or similar

3" of Velcro

1 5VDC / 120V 0.5A reed relay

1 black, 1 red 10" hookup wires

2 heat shrinks or electrical tape


Step 1: Set up the Arduino Yun and load the sketch

Step 2: Set up port forwarding on the router (optional, for Internet access)

Step 3: Make the hardware connections

Step 4: Write the web page and upload it to a server (optional, but aesthetically pleasing)

Step 5: Make a cup of coffee and turn off the brewer

Step 1: Set Up the Arduino Yun and Load the Sketch

The Arduino Yun has a micro USB connector and runs on 5V DC. I chose the Just Wireless AC Charger for Samsung cell phones. I did not use a voltage regulator; you experts may advise otherwise. Connect the AC charger to the Yun and plug it in to any wall outlet.

The Yun, when it powers up, runs its own WiFi network. Use your WiFi laptop/smart phone/tablet to change your WiFi network to "Arduino-XXXXX" where X is replaced by a series of digits. Then, using your browser, go to arduino.local and the config page should come up. Click Configure and change the wireless network to your home WiFi network and set a password. Change the hostname if you like; I changed mine to 'yun2' as I already use 'yun1' to control a living room light. Note the Yun's MAC address; if there is a problem later you can identify it from your router. Restart, and remember to change the WiFi network on the device you are using to program the Yun. When the Yun restarts, you should still be able to connect to it at arduino.local. Though it is not a necessity, I advise changing the dynamic ip address to a static one. My router hands out 254 addresses in the 192.168.0.xxx range, so I made the static ip address. I doubt I will ever have 200 devices for which my router hands out dynamic addresses. Restart after making these changes and verify that you can reach the config page of the Yun at its new ip address.

If you have not already done so, download the Arduino IDE for your particular computer from arduino.cc. Start the software, and from the Tools menu, choose Board -> Yun, then from the Ports menu, choose the connection named for the ip address of the Yun. **If you don't see it (not an uncommon problem) you can do a web search for this problem and get several easy fixes. I simply shut down the software and restart it and wait a minute and often the ip address appears in the Tools --> Ports menu.** Copy the sketch in this step and verify and upload it to the Yun.

You may verify that the sketch works by going to http://yun_ip_address/arduino/digital/13/1 After entering 'root' as the username and the password you set earlier, click OK and watch the red LED on the Yun, verifying that it lights up for about a half second. If so, you are ready for Step 2.

<p>Would there be a way to hack the Amazon Echo to do a similar thing?</p>
<p>Could you have also have just wired the brew button in the same way as the power button? So power on. Wait some time to heat up then activate the brew button.</p>
The easiest way to do it is probably using an NPN Transistor. Since the brew button is just a momentary contact switch that just works as a feedback circuit to the Keurig control board you can solder the transitor to the two leads on the button. when the middle pin of the transistor is set to high, using and arduino digital out pib, it acts like a button press, allowing voltage to flow through and work just like you pushed it. I can give you more info if you like but there are plenty of transitor tutorials onlibe.
<p>Yes, it would work, but the wiring to the on/off button is just under the base...5 screws and a little soldering. The wiring to the brew button is deep within the innards of the coffee maker; lots of disassembling to get to it, meaning lots of possibilities that something will break or leak. I wish you luck but I would not tackle that project. Your idea is a good one though, I think it would work if someone were patient and adept enough.</p>
<p>I am definitely a beginner at this, so this might be a dumb question. How do I tell if my Keurig has a momentary switch? The model I have has three buttons on the top with pictures of different sized cups on them. To make a cup, all I have to do is push one of the buttons and it heats the water and then pours. There is also a power button on the Keurig above a small display. Is there a way to tell what kind of switch I have? Thanks for your help, and cool instructable!</p>
<p>Not a dumb question! The power button is the one I wired to start remotely. </p><p>A momentary switch is spring-loaded. The movement of the switch turns the coffee maker on if it is off and it springs back to its usual position, and the same movement turns the coffee maker off if it is on. By contrast, a wall switch is not momentary; a different movement of the switch turns it on (up) or off (down) and it stays where you move it. I've owned two Keurig models and they both had momentary power switches, but I can't say for sure about yours. On mine, when the power switch is turned on, this starts the water heating. The other buttons make the pump move the hot water through the k-cup. My project only got the water hot, but that saved me about 3-4 minutes. I still had to hit another button to make the cup.</p><p>Also, my power switch is located just on the bottom edge of the coffee maker, easy to get to by taking off the bottom plate. If your power switch wiring is difficult to get to, this instructable might not help you.</p>
<p>thank you</p>
Any chance you could do an instructable on your filling system. Have the same model and on busy day have to fill the tank 2 to 3 times.
Sure. I just published it, so check back if it's not up yet. Search Keurig or water supply or my handle, davids1961
Great work, but why on a Keurig? such a waste and you can't get decent beans in the cups
so i can use this thing to turn on any electronic device ... my dream .. u r too good man
<p>The Arduino sketch in this Instructable is for a 'momentary' switch, one that is activated for a short period (0.4 sec) then off. This action turns the device both on and off. That's how the switch on my Keurig coffee maker works. </p><p> If the device you are considering working with is more like a lamp (on for a while, off for a while), the sketch is a bit different and there's a different Internet address for &quot;on&quot; than for &quot;off&quot;. If that's the case just reply here and I'll upload it here or create another Instructable. And thanks for the compliment.</p>
I wish you included more photos and breaked down the text. Very cool project, you seem to be very knowledgeable for being newb in electronics
Sorry about the photos. The ones I took are after-the-fact. I didn't think to take any during the project. Can you pinpoint an area where more text is needed? Or do all the steps need more? Being my first post, I wasn't sure how much detail to go into.
<p>Concerning the top photo: the white thing in the tank is a float valve I installed last year. Convenient not to have to fill tank by hand every other day, but I still have to dump and clean it every so often. Life has obstacles.</p>
Congratulations on your retirement and keeping your mind and hands working. <br><br>Hmmmm. Version 2 -- add plumbing to get it straight to the bedside. Now there's a project :)
And then someone figures out the website and starts your coffee maker at 2 am
Well, yes, if they can figure out the password I set on it.
<p>Great project! I love stuff like this. </p><p>Very well done on the documentation too. For a first instructable, this is really good!</p>

About This Instructable




Bio: I'm a retired high school teacher enjoying not having to get up at 6 every morning and grade papers every night. Now I have ... More »
More by davids1961:Continuous Water Supply to Keurig Tank Power Keurig From Bed Over WiFi 
Add instructable to: