Automatic Liquid Dispenser

Contactless, automatic liquid dispenser system that promotes hygiene and convenience across home, medical, and public settings.

Housing: 15.24 x 18.54 x 33.02 cm ABS/Acrylic

Voltage: 12 V

Power: 0.7925 W (Idle), 4.39 W (Pump On)

Liquid Capacity: 1.25 L

Dispense Volume: 25 mL


Components:

IR Distance Sensor | Arduino | Uxcell Micro Pump | LCD 16x2 | 0.96in OLED | MOSFET | Buck Converter


Electronics/Software:

The infrared sensor reads a value and converts it into a voltage amount. If the voltage exceeds the set threshold, the Arduino activates the pump system. While the pump takes 12 V, the rest of the components use 5 V, using the buck converter for their power input.

void loop() {
  float sensorValue = analogRead(IRpin);
  float IRvoltage = (sensorValue * 5.0) / adcMAX;

  if (cd <= 0) {
    if (IRvoltage > MinVoltage) {
      newState = "DISPENSING";
      digitalWrite(PumpPin, HIGH);
      delay(dispenseTime);
      digitalWrite(PumpPin, LOW);
      cd = cooldown * 1000 / cycleTime;
      dispenseCount++;
    } else {
      newState = "READY";
      digitalWrite(PumpPin, LOW);
    }
  } else {
    newState = "COOLDOWN";
    cd--;
  }

  if (newState != lastState) {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(newState);
    lastState = newState;
    delay(500);
  }
  if (newState == "COOLDOWN") {
      lcd.setCursor(0, 1);
      int displayCD = cd * cycleTime / 1000.0;
      lcd.print(displayCD);
      lcd.print(" s");
  }
  delay(cycleTime);
}

Basic Logic

Circuit Diagram


Housing:

Iteration 1: Prototype housing fabricated using laser-cut acrylic

Prototype Housing Drawing

Prototype Housing Physical Assembly

Iteration 2: first SOLIDWORKS assembly

Drawbacks: wastes material, overcomplicated hinge top, screw holes too precise, fillets difficult for a 3D print, IR sensor on bottom limits sensor area, housing is too large to print as one piece

Iteration 3: final SOLIDWORKS assembly

Improvements: hole in corner to facilitate power cord, switch opening on side, two-part body, water basin with lid on top, oled opening on top, simplified and lighter overall housing

Note: includes pocket below basin to store sensor, pump, and wiring

Note: not 3D printed, but laser cut on acrylic material


Final Product: Reliably dispenses 25 mL of liquid upon activation with no leakage from the basin section to the components. LCD reads active state (i.e., dispensing, cooldown), and OLED displays liquid left with a visual. For drippage after dispensing, there is an optional velcro-attached basin.

Front View

Top View

OLED

Wiring