Introduction: Keurig Auto-brew

About: Maker, tinkerer, engineer


There are several posts online about automating your Keurig coffee maker, but few had all the features and details that I wanted. Therefore, I had borrowed some ideas from other Instructables and/or YouTube videos to come up with my own solution.


The Keurig 30 will be equipped to turn on at a certain time to begin heating the water. It will reset the locking mechanism to accept the already-placed pod from the night before. Then, it will begin brewing an 8oz cup. Finally, it will turn off the machine.


Even the highest-priced Keurig models do not offer an auto-brew feature. While it makes sense, from an architecture standpoint, not to do this due to the need to change the pods every time you want to have a cup of coffee or tea - I still wanted to be able to wake up to my Keurig machine brewing.


I decided to use Arduino-based architecture to tackle this project.

  • 1 - Arduino Uno (for prototyping the circuit board layout - not required)
  • 1 - Adafruit Feather Board (
    • Any microcontroller board should be fine, as long as it complies with the I2C protocol, and has 3 digital output pins
  • 3 - Adafruit non-latching relay (
    • Any similar relay is fine
  • 1 - Adafruit Real Time Clock module (
  • 1 or 2 - blank breadboards
  • 1 - computer running Arduino IDE
  • 1 – soldering iron, and solder wire
  • Misc – Safety glasses, well-ventilated work area, Dremmel, voltmeter, wires, electrical tape, hot glue gun, etc

Step 1: Getting to the Control Board

Getting to the control board

Wow. There are lots of videos on YouTube on how this can be accomplished, and none claim this to be an easy task. I decided to forego these approaches, and instead resorted to using a Dremmel to cut the top lid off, thus revealing the control board. Don’t forget to unplug the Keurig from power before doing anything!

As you can see depicted in the photos, the lid atop of the control pod is only being held in place by 3 posts. By cutting around these posts, you will be able to remove that portion of the lid. Then, a little glue and some electrical tape will allow you to cover up this mess once you are done. I was not aware of the exact locations of these posts, so your results will hopefully be much prettier than my experimental ones seen here.

Alright, we have the control board in sight. It is held in place by a couple of screws. It is also connected to the control wires on the front, and the water pressure sensor tube on the bottom. I was able to gently pull the wires to allow for more slack, and was able to unplug the connector without the whole thing retracting. Slowly lifting the board will give you some space to gently disconnect the clear plastic tube of the pressure sensor (don’t worry, it will not retract into the depths of the machine either).

Step 2: ​Extending the Control Board

There we are - the control board! Simple enough. We only need access to the buttons for power and 8oz brew. The board is very well-labeled, so you should locate the two buttons and their corresponding +/- spots to extend with a few wires of your own.

Once the wires are soldered on, you can hook everything back up and place the controller board back into its pod. You can test that everything is working properly by plugging the Keurig back in, and simply shorting the pair of wires associated with a function (i.e. Power). If everything is wired up properly, your Keurig should turn on without you having to push any buttons!

Disclaimer – the last photo is not from my project, since I had closed it up before taking a picture, but this should give you an idea of where to connect your wires. Original source –

Step 3: Extending the Lock Mechanism

This part seems to be missing from most tutorials that I have seen. The premise here is that the Keurig will not allow you to place a pod into the machine then turn it off. After a short period of time, the Keurig will expect you to physically open the pod placement arm as if to reset itself and think that a new pod had been placed. We are going to override this via the Arduino.

First, we need to remove the upper lid that sits on top of the brewing receptacle. There lies a mechanical button that gets pressed whenever the lid is closed. We are going to cut the two wires attached to the button, and remove the button altogether. Then we simply attach extension wires to the two liberated wires, and that is all for this step. The magic will happen in the code.

Step 4: Setting Up Our Breadboard

Hopefully, the pictures are self-explanatory. Basically, we wire up the RTC via 3v/GRD and SCL/SDA wires. We power up the relays via 3v/GRD. Then we connect each relay to the control board via any digital output pins. Each relay is, furthermore, connected to the wires extending the lock mechanism, the power button, and the 8oz button, respectively. The order doesn't matter as long as the code reflects which output pins you choose to use.

Step 5: A Little Code – RTC Setup

<p>// Date and time functions using a DS3231 RTC connected via I2C and Wire lib<br>#include <Wire.h>
#include "RTClib.h"</p><p>RTC_DS3231 rtc;</p><p>char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};</p><p>void setup () {</p><p>#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif</p><p>  Serial.begin(9600);</p><p>  delay(3000); // wait for console opening</p><p>  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }</p><p>  if (rtc.lostPower()) {
    Serial.println("RTC lost power, lets set the time!");
     rtc.adjust(DateTime(2017, 6, 11, 16, 38, 0)); // SET DATE/TIME HERE
}</p><p>void loop () {
    DateTime now =;
    Serial.print(now.year(), DEC);
    Serial.print(now.month(), DEC);
    Serial.print(, DEC);
    Serial.print(" (");
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(now.minute(), DEC);
    Serial.print(now.second(), DEC);
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);

Step 6: A Little (more) Code

#include <Wire.h>

#include "RTClib.h"

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

bool power = false; int power_pin = 11; bool eight = false; int eight_pin = 9; bool lid = false; int lid_pin = 5;

int alarm_h = 7; // Alarm hour int alarm_m = 00; // Alarm minute

void setup () {

Serial.begin(9600); pinMode(2, INPUT); pinMode(power_pin, OUTPUT); // ON/OFF pinMode(eight_pin, OUTPUT); // 8OZ CUP pinMode(lid_pin, OUTPUT); // LID delay(3000); // wait for console opening

if (! rtc.begin()) { Serial.println("Couldn't find RTC"); while (1); } }

void loop () { DateTime now =; Serial.print(now.hour(), DEC); Serial.print(':'); Serial.print(now.minute(), DEC); Serial.print(':'); Serial.print(now.second(), DEC); Serial.println(); // TURN KEURIG ON if (now.hour() == alarm_h && now.minute() == alarm_m){ if (!power){ Serial.print("HEATING..."); power = true; digitalWrite(power_pin, HIGH); delay(500); digitalWrite(power_pin, LOW); } }

// RESET LID if (now.hour() == alarm_h && now.minute() == alarm_m + 3){ if (!lid){ Serial.print("RESETTING LID..."); lid = true; digitalWrite(lid_pin, HIGH); delay(1000); digitalWrite(lid_pin, LOW); digitalWrite(lid_pin, HIGH); delay(1000);

// HIT 8OZ KEY if (!eight){ Serial.print("BREWING..."); eight = true; digitalWrite(eight_pin, HIGH); delay(500); digitalWrite(eight_pin, LOW); } } }

//TURN KEURIG OFF if (now.hour() == alarm_h && now.minute() == alarm_m + 10){ if (power){ Serial.print("Done..."); digitalWrite(lid_pin, LOW); power = false; eight = false; lid = false; digitalWrite(power_pin, HIGH); delay(500); digitalWrite(power_pin, LOW); } } Serial.println(); delay(1000); }

Step 7: Plug Everything Together

That's about it! Make sure to change the code to run at a convenient time for testing. Then simply put in a coffee pod and enjoy your brew!