Auto Coffee Machine Bluetooth Arduino + Android App
by Thomas sxt in Circuits > Arduino
11959 Views, 49 Favorites, 0 Comments
Auto Coffee Machine Bluetooth Arduino + Android App
Must of us know what is to be in a rush in the morning and don't have time to wait for the machine to get hot .
In this insctruables i will show 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 small/large coffee
and you can even send command by voice recognition !
What We Need:
This tutorial does not required much the main will be the coffee mahine !
-Arduino uno
- Coffee machine i used this one, bough from second hand .
-Wire
-Bluetooth module hc06 (HC05 should also work)
-Relay 4 channel as i have 3 button for the machine
That's it if you already have the coffee machine it will be very cheap
Opening the Coffee Machine
Here we have the most complicated part i will advice you to check the doc 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 gonna solder 2 cable under each button and connect it to the relay.
If you use an old coffee with one button it's the same process just use one channel relay.
Arduino Side
In this part we see of to connect the bluetooth module with arduino and the relay
The connection between the relay and arduino are:
IN1: None
IN2: PIN 11 small coffee
IN3: PIN 10 turn on machine
IN4: PIN 9 Big coffee
Bluetooth:
VCC= 5v
GND=GND
TXD=RX
RXD=TX
The Code:
The code is simple it initiate a bluetooth connection then
If you send value 1 you make small coffee, value 2 big cofee
When you upload the code disconnect the bluetooth (remove the 5v wire) otherwise you will get error
For some reason when I put HIGH it turn 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 turn off
check the code comment
<p>char junk;<br>String inputString="";</p><p>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); }</p><p>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 = ""; } }</p>
APP Inventor Android
In order to control our coffee machine with our phone, we will create an app with MIT app inventor .
Only requirement a gmail acoount.
You can upload my app and modify it in the app inventor it is very easy to use but i will advice to check some tutorial before.
I add 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) 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 use ASCII so in order to send 1 to the arduino you need to send the value 49
Pay attention to the difference .
Downloads
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 look 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 could be nice to be sure the cup is not missing !
Let me know if you have any idea of improvement .
If you liked this instrucable please vote !