Introduction: Power Keurig From Bed Over WiFi

Picture of Power Keurig From Bed Over WiFi

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.

TOOLS

Phillips screwdriver

solder and a soldering gun

wire stripper

wire cutter

MATERIALS

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

PROCEDURES

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 192.168.0.202 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.

Step 2: Set Up Port Forwarding on the Router

Picture of Set Up Port Forwarding on the Router

This step is optional. If you do not wish to be able to turn your Keurig off or on from outside your WiFi network, you will not need to set up port forwarding. However, if you want the ability to switch your Keurig over the Internet, you need a public ip address. You can use a service like Yaler for this, but you'll have to pay them a yearly fee. My Time Warner Cable modem/router, as most newer routers, can do port forwarding. If you have a cable modem that is separate from your router, use the public ip address of the cable modem as the WAN address when setting up port forwarding, otherwise, use the public ip address of the router.

In a browser, enter the ip address of your router, such as 192.168.0.1. Log in to the router. You may have to look through the menus to find port forwarding, but it is often in the 'Advanced' area. The local address will be the ip address of the Yun, the beginning and ending ports will both be 80, the external ip address can be left as 0.0.0.0 (unless your router is separate from your cable modem, in which case use the ip address of the cable modem), and the external port can be any number not already used. I avoid 80, 443, 21, 23, and 25. For this project I will use 81. Enter 81 for both the beginning and ending ports, and select both TCP and UDP. Enable the forward (aka 'save' it), and before you exit your router's configuration program, find and write down its public IP address or write down the ip address of the cable modem. In your browser, enter this ip address followed by a colon, then the port you selected as the WAN port when you configured port forwarding. For example, http://xxx.xxx.xxx.xxx:81/arduino/digital/13/1 , where the x's represent the public ip address of the cable modem or router, should make the LED light up for about a half-second.

Step 3: Make the Hardware Connections

Picture of Make the Hardware Connections

Now that you can blink an LED by entering a web address, all you need to do is connect the Keurig coffee maker to the Arduino Yun. There is more than one way to accomplish this, but I suggest you use a reed relay and solder your connections.

Unplug your Arduino and Keurig from the wall.

Use jumper wires to connect the Arduino (specifically Pin 13 and GND) to the two coil contacts on a 5VDC / 120 VAC 1amp reed relay. Solder the connections at the reed relay. Next, you will connect a red and a black wire to the inside of the Keurig coffee maker. Make sure you unplug your coffee maker from the wall and remove the water tank. Place the coffee maker on its back. Some water may leak out; dry it up immediately.

You will have to remove about five screws from the bottom plate of the coffee maker, then carefully swing the bottom plate aside. There is no need to cut the green ground wires. With the coffee maker on its back, locate and pull out the red and black wires on each side of the power switch. Cut them so that both ends are long enough to strip about ½ inch. Cut a 10 inch section of red hookup wire and another black wire the same length. Strip ½ inch from one end and about ¼ from the other. Take the red wire and twist and solder the ½ inch end to the two red wires inside the coffee maker; do the same for the black wires. Insulate the two soldered trios separately with a heat shrink or electrical tape. Feed the two 10 inch wires out the opening for the power cable and replace the bottom plate. (See photo.) Sit the Keurig upright and replace the water tank.

Attach the ¼ inch stripped ends to the COM and N.O. (doesn't matter which) contacts of the reed relay and solder them. This is optional, but I attached the Yun to a 3x3 inch panel board using standoffs, then attached velcro to the back of the panel board and the back of the Keurig. Plug in the Yun and the Keurig and watch that the green and white LEDs light up on the Yun. It may take a couple of minutes for the white LED (WiFi) to light up.

If your Keurig turns on when you plug it and the Yun in, you should be able to turn it off by going to http://your_arduino_ip:81/arduino/digital/13/1 where the 81 is the port you chose when configuring the forwarding. If you did not choose port forwarding, omit the ":81" portion. By the way, this same address turns the Keurig on.

Step 4: Write the Web Page and Upload It to a Server

This step is also optional, but if you have a place to store a web page, you can make an attractive page to control this and any other future Arduino Yun connections.

If you choose to omit this step, you simply have to save the http://your_arduino_ip:81/arduino/digital/13/1 page to your smart phone/tablet and refresh it when you want to power up or down your Keurig. Omit the :81 if you did not do port forwarding. But if you have a site to store public web pages, the html code above will allow you to create a page which shows a graphic you can click to power the Keurig up and down, and you could add other graphics to control other Yuns in the future. If you choose to make the page, don't forget to upload a graphic called keurig.jpg saved in the same folder as the web page. You can also change the web page title accordingly; mine was first created to control my living room lights. After you click the graphic, you get the message that the coffee maker was powered on or off. I immediately use the back button so the page is ready for the next power up or down.

Avoid powering the coffee maker up and down in succession; this could damage the unit.

Step 5: Make a Cup of Coffee and Turn Off the Brewer

Go to another room (or outside your home if you configured a public Internet address with port forwarding) and power on your Keurig coffee maker using your mobile device. After allowing enough time to power up and heat the water, go to the coffee maker, put in a K cup of your favorite brew and make yourself a cup. Power down with the mobile device and enjoy the coffee.

Your comments are welcome but remember this is my first Instructable and I've only been working with electronics and Arduinos for about a month. If you have any questions I will attempt to answer them or politely ask an expert to answer.

Comments

TysonS4 (author)2015-11-11

Would there be a way to hack the Amazon Echo to do a similar thing?

ctweber01 (author)2015-01-31

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.

braytonlarson (author)ctweber012015-05-12

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.

davids1961 (author)ctweber012015-02-01

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.

DIYismorefun (author)2015-03-29

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!

davids1961 (author)DIYismorefun2015-03-29

Not a dumb question! The power button is the one I wired to start remotely.

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.

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.

asdadeel (author)2015-03-12

thank you

13bigred13 (author)2015-01-29

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.

davids1961 (author)13bigred132015-01-30

Sure. I just published it, so check back if it's not up yet. Search Keurig or water supply or my handle, davids1961

mperrault1 (author)2015-01-29

Great work, but why on a Keurig? such a waste and you can't get decent beans in the cups

aahmed60 (author)2015-01-28

so i can use this thing to turn on any electronic device ... my dream .. u r too good man

davids1961 (author)aahmed602015-01-28

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.

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 "on" than for "off". If that's the case just reply here and I'll upload it here or create another Instructable. And thanks for the compliment.

Nate_o_bae (author)2015-01-27

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

davids1961 (author)Nate_o_bae2015-01-27

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.

davids1961 (author)2015-01-27

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.

Make_This (author)2015-01-27

Congratulations on your retirement and keeping your mind and hands working.

Hmmmm. Version 2 -- add plumbing to get it straight to the bedside. Now there's a project :)

coolblaze19 (author)2015-01-27

And then someone figures out the website and starts your coffee maker at 2 am

davids1961 (author)coolblaze192015-01-27

Well, yes, if they can figure out the password I set on it.

seamster (author)2015-01-27

Great project! I love stuff like this.

Very well done on the documentation too. For a first instructable, this is really good!

About This Instructable

35,200views

182favorites

License:

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 »
Add instructable to: