Coffee Machine Water Auto-Refill Upgrade

Everybody hates it when they want the drink a cup of coffee and the water tank is empty. Here is the solution!

  • 1,209 views
  • 0 comments
  • 2 respects

Components and supplies

About this project

Everbody knows this kind of problem: you want to drink a cup of coffee and the water tank is empty!

Here is the soultion: we took some Arduino Nano boards to read in the values from the sensors and switching our relay. For more details, please refer to the code and the schematic.

I set the level to advanced because of two reasons:

1.) I opened the coffe machine to get acess to the sensor, which reads out if the tank is empty.

2.) We had to do a lot of mechanical stuff and to work with water isn't easy since you don't want any of it to leak out.

Here you can find some pictures an da video of how it looks like and how it works:

the end result!

Code

the codeC/C++
int count = 0;     
int zeit = 350;// 600 = 1min //60= 6sek/ 10 = 1sek

   
bool pumpen = 0;




void setup() {


  pinMode(10 , OUTPUT); // Relais fr Pumpe
  digitalWrite(10,0);
 // pinMode(11,OUTPUT); // Nur zum Test als VCC fr einen Schalter
  attachInterrupt(digitalPinToInterrupt(2),TankEndlage,RISING);//Schalter fr Tank entnommen?
  attachInterrupt(digitalPinToInterrupt(3),Sensor,RISING); // Sensor von der Kaffeemaschine
}


void wait()
{
  delay(100);
  count++;
}

void loop() {


  if(digitalRead(3)==1 && digitalRead(2)==0)
  {
    delay(1000);
    if(digitalRead(3)==1)
    {
       pumpen=HIGH;
    }
   
  }

  while(count<zeit && pumpen==HIGH && digitalRead(2)==LOW)
  {
    digitalWrite(10,1);
    wait();
  }
 
  //Rcksetzen wenn while nicht mehr erfllt ist
  count = 0;
  pumpen= LOW;
  digitalWrite(10,0);
 

  
  
}

//Interruptroutinen der Sensoren/Schalter
void Sensor()
{
  delay(1000);
  if (digitalRead(3)==1)
  {
      pumpen= HIGH;
  }

}

 void TankEndlage ()
{
  pumpen=LOW;
 // digitalWrite(10,0);

} 

Schematics

The schematic
I needed this much volts , because the valve for the water needed more than the +12V which where printed onto the spec.
The sensor is like mentioned before the same as the coffee machine uses.
Img e0017 g0ilxnds74

Comments

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 456,723 views
  • 44 comments
  • 244 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,608 views
  • 95 comments
  • 672 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 230,286 views
  • 38 comments
  • 239 respects

OpenCat

Project in progress by Team Petoi

  • 197,145 views
  • 154 comments
  • 1,371 respects
Add projectSign up / Login