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.
solder and a soldering gun
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
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.