Mr. Coffee

Smiling Hardware Cronenberg with a Temperature Sensor for a tail.

Meet Mr.Coffee

Mr. Coffee is a fun way to automate my routine to make coffee in the morning! Instead of having to hand pour on top of the pot, Mr. Coffee will pour hot water over ground beans once the water begins to boil, also eliminating the need to wait for that as well. To use Mr. Coffee, just set the amount of coffee you'd like with his right eye, and press his left eye to set the amount. After that you can put your trust in Mr. Coffee and walk away. He'll figure out the rest.

Video #1

Overall Implementation

Video #2

Servo Motor Rotation

Water pump close up, Waterpump Ziptied to arduino

Highlight #1

Close-up of water pump

Temperature sensor and pump tube close up, both tubes ziptied together

Highlight #2

Close-up of temperature sensor and pump tube

Close up at hardware that resembled a smily face.

Highlight #3

Close-up of one dashing smile!

Hand pressing button to activate Coffee Machine

Use #1

Pressing Button

Picture of device pouring coffee

Use #2

Waiting for pour

Finished brewed cup of coffee made by machine.

Use #3

Post-pour

Early process picture, few wires, potentiometer in view

Progress #1, Waterpump

Early on into the process, using the water pump was the earliest and one of the most significant challenges. Using a bridge driver with the growing amount of wires was hard to follow. With the help of Robert Z, this process was streamlined heavily. It was at this time that I experimented using higher voltages for the water pump. It ran ok on 5V, but the more power, the faster I would get my coffee! I experimented with 9V from a power supply. Now it was time to implement the temperature sensor.

Mid Process Picture, battery ziptied to arduino, more wires, tactile push button in view

Progress #2, Battery Powered

With my growing interest in going battery powered, I learned how to power the water pump straight into the battery, separating it from the overall power supplied by the Arduino. It was here that I also implemented the tactile button and waterproof temperature sensor. The temperature sensor grew to be the next challenge, not through hardware, but due to the fact that it required abstracted software to implement. With the help of Sejal, though, this process was streamlined.

Bottom view of device, lots of duct tape on a seemingly working device.

Progress #3, Rotating Tube

After implementing the servo motor, the hardware was finished. The gimmick for the project operated on the servo motor rotating 180 degrees CW and CCW to achieve a full circular pour. The chassis for the hardware was my old barley container that I repurposed. Very lucky for that. The acrylic to hold the pump tubes was laser printed to fit the dimensions of this, with the help of Robert Z.

Finished hardware picture inside chassis. On top of paper towel to undergo testing.

Progress #4, Testing

Testing turned out to be the most time consuming part of all. Every implementation consisted of me waiting for the water to reboil, changing the code, and re-compiling. It was a very messy process. All the while I was debugging my code, I had to make sure not to get anything wet. In hindsight I should've disconnected the water pump.

Discussion

Critique 1: "It’s fun to have those decorations. It is clear and useful, very direct to its proposal. seems dangerously wobbly"

Critique 2: "This project is dope. Its seems super useful and definetly fits the project requirements of it wouldn’t necessary help everyone, as not everyone drinks coffee, but for an avid coffee drinker like yourself it seems incredibly useful."

In response to Critique 1: It was dangerously wobbly! It seems from the final critique, Mr. Coffee is indeed prone to falling over. I attempted to account for this with counterweights, explaining the belt of marbles that he has. This has helped cases but could be a better fix. A better fix would be to have a more extensive base to go over the ceramic ground bean holder; however, that could introduce new problems. A perfect solution would be to have the ground beans and filter in one system with the hardware.

In response to Critique 2: I agree that the functionality is limited to coffee, mainly because it was hard-engineered to that specific drip coffee mug thingy. In theory, though, as a mechanism that pours water after it gets hot enough, you could use this for different uses like tea or instant ramen. While the functionality may be questioned, you could use it for other things, but it is best to use it for what it was intended to do.

As for what I think about the project, I am happy with what I pulled off. I delayed the hardware portion because it seemed daunting at first, but in the end, I enjoyed how digestible everything was when I did it in parts. I am also happy that I could debug the code to have a working product. Honestly, with much more premeditated effort, this project could have had a cleaner implementation, but there is also the argument that his charm comes from the very apparent impulsive and rash decisions. Overall though, I feel like this project fine tuned my physical computing abilities in various areas, such as hardwiring, coding, fabricating, and debugging. 

I wouldn't expect myself to build any further implementations of this project. I am happy with how it works, but as one of the in-class critiquers warned: The maintenance would be deadly.  


Block Diagram and Electrical Schematic

Code


//CITATIONS

//https://www.instructables.com/How-to-use-a-Push-Button-Arduino-Tutorial/

//https://docs.arduino.cc/learn/electronics/servo-motors

//

//SMALL BLURB

//This code is the core of Mr. Coffee! It controls a water pump and a temperature sensor for brewing. The pump circulates water through custom-fit acrylic tubemed 

//in the loop. The temperature sensor ensures water heats to the ideal temperature for brewing. Activation is via a tactile button, and a servo motor manages the pouring, rotating

//180 degrees in both directions for even distribution. The code uses the OneWire and DallasTemperature libraries for sensor readings and the Servo library for motor operations.

//A potentiometer adjusts brewing time.  Enjoy Mr. Coffee!

//

// PIN MAPPING

// ONE_WIRE_BUS: Digital Pin 4 - Dallas Temperature sensor

// signalA: Digital Pin 3 - Water pump control

// signalB: Digital Pin 6 - Water pump control

// buttPin: Digital Pin 2 - Tactile button

// potPin: Analog Pin A0 - Potentiometer

// Servo Control: Digital Pin 9 - Servo motor


#include <OneWire.h>

#include <DallasTemperature.h>

#include <Servo.h>

#define ONE_WIRE_BUS 4

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);


//initialze global variables

Servo myservo;

int pos = 0;

const int signalA = 3;

const int signalB = 6;

const int potPin = A0;

const int buttPin = 2;

int startTime;


void setup(void) {

  Serial.begin(9600);

  sensors.begin();

  myservo.attach(9);

  pinMode(signalA, OUTPUT);

  pinMode(signalB, OUTPUT);

  pinMode(potPin, INPUT);

  pinMode(buttPin, INPUT);

}

void loop(void) {

//get temperatures first

    sensors.requestTemperatures();

    Serial.print("Celsius temperature: ");

    Serial.print(sensors.getTempCByIndex(0));

    Serial.print(" - Fahrenheit temperature: ");

    Serial.println(sensors.getTempFByIndex(0));


    int potVal = analogRead(potPin);

    int buttState = digitalRead(buttPin);

    static int turnOn = 0;


    Serial.println(buttState);

    Serial.println(potVal);


    if (buttState == 1 && turnOn == 0) {

        turnOn = 1;

    }


    if (turnOn == 1) {

        while (sensors.getTempCByIndex(0) < 95 || sensors.getTempFByIndex(0) < 200) {

            sensors.requestTemperatures();

            delay(1000);

            Serial.print("Waiting - Celsius temperature: ");

            Serial.print(sensors.getTempCByIndex(0));

            Serial.print(" - Fahrenheit temperature: ");

            Serial.println(sensors.getTempFByIndex(0));

        }


        int duration = potVal * 60;  // Up to 1 minute

        startTime = millis();


        while ((millis() - startTime) < duration) {

            analogWrite(signalA, 255);

            analogWrite(signalB, 0);  // turn water pump on


            // rotating motions

            for (pos = 0; pos <= 180; pos += 1) {

                myservo.write(pos);

                delay(15);

            }

            for (pos = 180; pos >= 0; pos -= 1) {

                myservo.write(pos);

                delay(15);

            }

        }


        turnOn = 0;  // Reset turnOn for next cycle

    }


    analogWrite(signalA, 0);

    analogWrite(signalB, 0);  // turn pump off

}