Reed BuskeBrennan AustinJoseph Strickland
Published

Drink Weight and Temperature Monitor

This project will allow ones drink to be measured in weight and temperature to ensure the drink is at their desired temperature and amount.

IntermediateShowcase (no instructions)16 hours175
Drink Weight and Temperature Monitor

Things used in this project

Hardware components

Temperature Sensor
Temperature Sensor
×1
Adafruit Waterproof DS18B20 Digital temperature sensor
Adafruit Waterproof DS18B20 Digital temperature sensor
×1
Ceramic Suppression Capacitor, 1000 pF
Ceramic Suppression Capacitor, 1000 pF
×1
Jumper wires (generic)
Jumper wires (generic)
×19
Resistor 4.75k ohm
Resistor 4.75k ohm
×1
Argon
Particle Argon
×3
SparkFun Load Cell Amplifier - HX711
SparkFun Load Cell Amplifier - HX711
×1
Breadboard (generic)
Breadboard (generic)
×3

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
ThingSpeak API
ThingSpeak API

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Internal Drink Temperature Sensor

External Temperature Sensor

Load Cell Sensor

3-D Printed scale

This is the structure used to measure the weight of the drink.

Load Cell Weight Change with Coffee Mug

Temperature Over Time

Using data collected from the temperature sensors, we were able to develop a graph to see the change of temperature of a mug of hot water over time

Schematics

DS18B20 Waterproof Temp Schematic

This is the schematic of the internal temperature subsystem

Flowchart of connections

Load Cell Schematic

This is the wiring schematic for the load cell portion

TMP36 Temperature Sensor Circuit

This is the wiring schematic of our Room Temperature Sensor.

Code

Load Cell Code

C/C++
This sensor was used to measure the weight of the drink.
// This #include statement was automatically added by the Particle IDE.
#include <HX711ADC.h>

// This #include statement was automatically added by the Particle IDE.
#include <ThingSpeak.h>

// This #include statement was automatically added by the Particle IDE.
#include <HX711ADC.h>


int LOADCELL_SCK_PIN = A3;
int LOADCELL_DOUT_PIN = A2;

HX711ADC scale;
 float calibration_factor = 535; // this calibration factor is adjusted according to my load cell
float units;
float units1;

void setup() {
     Serial.begin(115200);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); // ini scale
scale.tare();  //Reset the scale to zero  
}


void loop() {
    units = scale.get_units(), 5;
 units1 = (-(units/400));
 
      long current_value = scale.get_value(10);
  Particle.publish("HX711ADC: ", String(units1));
  delay (1000);
    unsigned long myChannelNumber =1363781;
        const char * myWriteAPIKey = "55CAYU6AMKD2YT2K";
      
}

DS18B20 Waterproof Temp Sensor

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <JsonParserGeneratorRK.h>

// This #include statement was automatically added by the Particle Build IDE.
#include "OneWire.h"

// This #include statement was automatically added by the Particle Build IDE.
#include "spark-dallas-temperature.h"

// -----------------
// Read temperature
// -----------------
int led = D7;
int dataval;// The on-board LED
// Data wire is plugged into port 0 on the Arduino
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire( D2 );

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature dallas(&oneWire);

// Create a variable that will store the temperature value
double temperature = 0.0;
double temperatureF = 0.0;

void setup()
{
  // Register a Particle variable here
  Particle.variable("temperature", &temperature, DOUBLE);
  Particle.variable("temperatureF", &temperatureF, DOUBLE);

  // setup the library
  dallas.begin();
  pinMode(led, OUTPUT);
}

void loop()
{
  // Request temperature conversion

  dallas.requestTemperatures();

  // get the temperature in Celcius
  float tempC = dallas.getTempCByIndex(0);
  // convert to double
  temperature = (double)tempC;

  // convert to Fahrenheit
  float tempF = DallasTemperature::toFahrenheit( tempC );
  // convert to double
  temperatureF = (double)tempF;

  delay(5000);
digitalWrite(led, HIGH);   // Turn ON the LED

  String temperatureF = String(temperatureF);
  Particle.publish("temperatureF", temperatureF, PRIVATE);
  delay(1000);               // Wait for 30 seconds

  digitalWrite(led, LOW);    // Turn OFF the LED
  delay(1000);          
}

Room Temperature Code

C/C++
//---------------------
// Room Air Temperature
//---------------------
int roomtempPin = A5;
int led = D7;

// Define Variables
double roomtemperature = 0.0;
double roomtemperatureF = 0.0;

void setup() {
  // Register Particle variables
   pinMode(led, OUTPUT);
  Particle.variable("roomtemperature", &roomtemperature, DOUBLE);
  Particle.variable("roomtemperatureF", &roomtemperatureF, DOUBLE);

  // Connect the temperature sensor to Pin A5 as an input
 
  pinMode(roomtempPin, INPUT);
}

// Define the sensor loop
void loop() {
 
  int reading = analogRead(roomtempPin);

  // The returned value from the device is going to be in the range from 0 to 4095
  // Calculate the voltage from the sensor reading
  double voltage = (reading * 3.3) / 4095.0;

  // Calculate the temperature in Celcius
  roomtemperature = (voltage - 0.5) * 100;

  // Conversion to Farenheight
 
  roomtemperatureF = ((roomtemperature * 9.0) / 5.0) + 32.0;
 digitalWrite(led, HIGH);   // Turn ON the LED

  String roomtemperatureF = String(roomtemperatureF);
  Particle.publish("roomtemperatureF", roomtemperatureF, PRIVATE);
  delay(1000);               // Wait for 30 seconds

  digitalWrite(led, LOW);    // Turn OFF the LED
  delay(1000);  
}

Credits

Reed Buske

Reed Buske

1 project • 3 followers
Brennan Austin

Brennan Austin

1 project • 3 followers
Joseph Strickland

Joseph Strickland

1 project • 3 followers

Comments

Add projectSign up / Login