Project tutorial
Automatic Coffee Machine

Automatic Coffee Machine © GPL3+

Most of us know what it is to be in a rush in the morning and not have time to wait for the machine to get hot. How to solve it?

  • 20,327 views
  • 7 comments
  • 19 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

About this project

Introduction

Most of us know what it is to be in a rush in the morning and don't have time to wait for the machine to get hot. In this tutorial I will show you how to make automatic coffee with Android and Arduino.

At the end of the tutorial you will have an Android app working in Bluetooth to make a small or large coffee and you can even send commands by voice recognition!

Opening the Coffee Machine

Here we have the most complicated part. I will advise you to check the documentation of your machine. For the one I use, you just need to detach the bottom with something tiny like a screwdriver.

Soldering

Now that the machine is open we are going to solder 2 cables under each button and connect it to the relay. If you use an old coffee maker with one button it's the same process just use one channel relay.

Arduino Side

The connections between the relay and Arduino are:

  • IN1: None
  • IN2: PIN 11 small coffee
  • IN3: PIN 10 turn on machine
  • IN4: PIN 9 Big coffee

The Bluetooth module and Arduino:

  • VCC= 5v
  • GND=GND
  • TXD=RX
  • RXD=TX

The code

The code is simple. It initiates a Bluetooth connection and then if you send value 1 you make small coffee, value 2 is a big coffee.

When you upload the code disconnect the Bluetooth (remove the 5V wire), otherwise you will get an error. For some reason when I put HIGH, it turns off the relay, so if you have problems just try to inverse HIGH and LOW.

Then a button is pressed to make the coffee and the machine turns off. Check the code comment:

char junk;
String inputString="";
void setup()                    // run once, when the sketch starts
{
    Serial.begin(9600); // set the baud rate to 9600, same should be of your Serial Monitor
    pinMode(10, OUTPUT);
    digitalWrite(10,HIGH);
    pinMode(9, OUTPUT);
    digitalWrite(9,HIGH);
    pinMode(11, OUTPUT);
    digitalWrite(11,HIGH);
}
 
void loop()
{
  if(Serial.available()){
  while(Serial.available())
    {
      char inChar = (char)Serial.read(); //read the input
      inputString += inChar;        //make a string of the characters coming on serial
    }
    Serial.println(inputString);
    while (Serial.available() > 0)  
    { junk = Serial.read() ; }      // clear the serial buffer
    if(inputString == "1"){         //in case of '1'
            digitalWrite(10, LOW);    //turn on machine
      delay(500);
      digitalWrite(10, HIGH);
      delay(120000);                   //time to heat up 2mn (milli)
      digitalWrite(9, LOW);
      delay(500);
      digitalWrite(9, HIGH);           //big coffee
      delay(30000);                      //coffee comes out
      digitalWrite(10, LOW);        //turn off machine
      delay(500);
      digitalWrite(10, HIGH);  
    }else if(inputString == "2"){   //incase of '2'
      digitalWrite(10, LOW);          //turn on machine
      delay(500);
      digitalWrite(10, HIGH);
      delay(120000);                        //time to heat up 2mn (milli)
      digitalWrite(11, LOW);
      delay(500);
      digitalWrite(11, HIGH);          //small coffee
      delay(30000);                         //coffee comes out
      digitalWrite(10, LOW);           //turn off machine
      delay(500);
      digitalWrite(10, HIGH);
    }
    inputString = "";
  }
}

APP Inventor Android

In order to control our coffee machine with our phone, we will create an app with MIT app inventor. The only requirement is a Gmail account. You can upload my app and modify it in the app inventor. It is very easy to use but I will advise you to check some tutorials before.

I added voice recognition so if you say "coffee" it will give you a big coffee. To be able to install the app, you have to go to your phone setting (in security) and allow unknown sources.

Important: To send value from the Bluetooth I used the object "send text " so it will send the number 1 or 2.

You can also use the "send byte number " but it uses ASCII so in order to send 1 to the Arduino you need to send the value 49. Pay attention to the difference.

Conclusion

We are done!

We can now control our coffee machine with Bluetooth. I am not very good in design so forgive me my coffee machine looks bad but you can easily make a small box for the Arduino and the relay to fit properly.

In the future I will update the tutorial with a conveyor belt. It could be nice to be sure the cup is not missing!

Let me know if you have any idea on improvements.

Custom parts and enclosures

AIA File
Same file as the apk
easycoffee_PMPn5pALOv.aia

Comments

Similar projects you might like

Connected coffee machine

Project in progress by Bert

  • 3,359 views
  • 0 comments
  • 4 respects

Coffee Machine Water Auto-Refill Upgrade

by FelixAdiy

  • 2,009 views
  • 0 comments
  • 2 respects

Arduino and AC Devices - Automatic Lights

Project tutorial by Ahmed Hamdy

  • 21,947 views
  • 7 comments
  • 51 respects

How to make Arduino based Automatic Door Opening

Project tutorial by vijendra kumar

  • 19,831 views
  • 6 comments
  • 15 respects

The Drawing Machine

Project showcase by Kramick Saha

  • 9,279 views
  • 6 comments
  • 20 respects

OpenDarts - Homemade Dartboard Machine

Project tutorial by Ricardo Alves

  • 3,974 views
  • 16 comments
  • 6 respects
Add projectSign up / Login