HOT MUG We came up with this idea when we were sitting at CIS 110 Office Hours. After spending over 30 minutes in the queue, our coffees/teas weren’t hot anymore. In order not to forget to drink our hot drinks, we created Hot Mug. Hot Mug is perfectly designed such that people who are constantly on their computers benefit the most. You place the temperature sensor in your drink so it constantly measures the temperature of your drink and gets the temperature values. We placed the temperature sensor on a Breadboard as well as one of the Bluetooths for communication between master and slave computers. The master computer then sends the values to the slave computer, which will be the computer that the user is currently working on. According to the temperature of the drink, the correct messages will be printed on the Serial Monitor. The messages will be printed on the monitor as frequently as you wish. The user can adjust this by just changing the delay, which is in milliseconds. The user can also change the temperatures, after which he/she wants a notification. The current messages are set to 50, 40, 30, 20 and 10 degrees Celsius. The annoying message that it sends now can be seen in the slave computer code below. Our target group is mainly college students, employees, professors and TAs, who are mostly on their computers during the day. We believe that they can benefit a lot from Hot Mug, as it will force them to drink their drinks, while they are still hot. This will prevent our target group from spending their money constantly on cold tea or coffee. The code for the master computer can be seen below:

MASTER(TEMPERATURE_READING):

include

define BT_SERIAL_RX 2

define BT_SERIAL_TX 3

SoftwareSerial BTSerial(BT_SERIAL_RX, BT_SERIAL_TX); // int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to //the resolution is 10 mV / degree centigrade with a //500 mV offset to allow for negative temperatures String send_val = ""; double send_val2 = 0;

void setup() { Serial.begin(9600); //Start the serial connection with the computer BTSerial.begin(9600);
}

void loop()
{ //gets the voltage reading from the temperature sensor int reading = analogRead(A0);

// converts the reading to voltage float voltage = reading * 5.0; voltage /= 1024.0;

//prints the voltage //Serial.print(voltage); Serial.println(" volts");

//prints the temperature in C float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset //to degrees ((voltage - 500mV) times 100)

//Fahrenheit conversion float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0; send_val2 = (double)temperatureC; BTSerial.println(send_val2); Serial.println(send_val2);
delay(15000);

//below methods were used for testing purposes //BluetoothSerial.write("test"); //BluetoothSerial.println("test"); //Serial.println("test"); delay(1500); // prepare next data } SLAVE(RECEIVE_MESSAGE):

include

SoftwareSerial BTSerial(2,3); //RX | TX String temp = ""; String string_to_use = ""; int tempOfDrink = 0;

void setup() { Serial.begin(9600); BTSerial.begin(9600); }

void loop() { //boolean read_data = false; while (BTSerial.available()) { //check if there are any bytes to be read temp = BTSerial.read(); //reads single character at a time //totalString += inChar; //if (inChar == '\n') { break; } tempOfDrink = temp.toInt(); Serial.println(tempOfDrink); delay(1500); if (tempOfDrink > 50) { Serial.println("Your drink is above 50, you can still enjoy it but be careful!"); } else if (tempOfDrink > 40) { Serial.println("Ok, your drink is still hot enough for you to enjoy it."); } else if (tempOfDrink > 30) { Serial.println("You still haven't wasted your money on cold coffee/tea. It's still hot!"); } else if (tempOfDrink > 20) { Serial.println("Ok, now it's basically room temperature."); } else (tempOfDrink > 10) { Serial.println("Heat it up again!!! Or you can basically throw it away now."); } }

Built With

Share this project:

Updates