The King of Beer and ...Milk

Made by Qiao

Found in Home Hack

How do you perfectly take good beer or milk from your fridge and make it awesome? Are you ever out shopping and forget if you are of your favorite drink or food? If so, this project is for you. This project creates a real-time monitor that detect if you are low on a specific food or drink. For example, beer, it uses a weight detector to detect if it is a full beer bottle or an empty one. It connects to the Internet and sends a message to inform users that it is time to buy a new beer. The weight detector is a force sensitive material and is put under the beer.

0

Intention

The drinks are always out of stock in the fridge. The purpose of this project is to remind user when the drinks are close to being finished by texting him/her.

0

Context


When I get home, it is always a great time to have a cup of drink until you open the fridge and all the drinks are out of stock. I have run into this situation hundreds of time. Even if I bear in mind that I have to buy drinks, sometimes I still forgot as I didn't get a notification before I got home.

This experience inspired me to start this IoT project.

There are two precedent projects I found that is related. 

1. "Raspberry Pi Beer Fridge of Awesomeness":

http://www.instructables.com/id/Raspberry-Pi-Beer-Fridge-of-Awesomeness/

That detect the stock and the overall condition of the beer.


2."Fridge Food Detector"

http://www.instructables.com/id/Fridge-Food-Detector/

It uses the force detector to monitor the volume of the milk, which is a more direct way to tell the user how much milk is left in the fridge.


0

Process

Outline your approach to the project? What ideas did you generate and how did you refine or reject them? What did you research and explore? what were the design choices? What challenges were encountered and how did you resolve them?

My starting point is to choose what approach to measuring the condition of the drinks. 

1. My first trial is the using the photoresistor to detect if there are drinks in the fridge. It turns out photo resistor is more suitable for detecting food stock, for example, if there is food left in the fridge or if the food is out of stock. The photoresistor will sense the light once the food in the fridge is removed.


2. Since my goal is merely detecting one kind of food and requiring more precise metric, I came up with using the weight of drinks to measure the condition. After a while, I found the FSR (force sensitive sensor) is the right one.


This variable resistor is just like a photocell or a flex sensor. The resistance changes by applying force on it.

For this project, we will need:

Particle Photon;

Breadboard;

Resistor;

FSR sensor;

LED;

The LED is used to ensure the FSR is working without reading the output of sensor in the console.sensor in the console.

3. The circuit

4. The code

0
/*
 This sketch will demonstrate a basic Internet of Things function of the Photon.
It will report the sensor value from a pressure sensor
on Pin A5 to the Particle cloud server.

// Hardware Required:
// 1. Particle Photon
// 2. Pressure sensor
// 3. 1K ohm resistor between pins A5 and ground
// 4. USB to micro USB cable for powering the Photon

*/


//Define our pins.
int buttonPin = A5;
int fsrPin = A0;

//pressureChecktime defines how often does it take to check the pressure level.
int pressureChecktime = 1000000; //10000 milliseconds is  2.7hrs

//record the time we report the pressure status with this
int lastPressureReport;
char PressureValue[4];//this is a tring where we will actual pressure value read from the sensor.

//int buttonState = 0;

void setup() {

  //tell photon if our pins are inputs or outputs
  pinMode(fsrPin, OUTPUT);
  pinMode(buttonPin, INPUT);

  //read the range of sensor
  Serial.begin(9600);

  // Turn on power to the fsr sensor
  digitalWrite(fsrPin, HIGH);

  //initialize timer
  lastPressureReport = millis();
}

void loop() {

  //read the range to determin if announcement;
  int buttonPinVal = analogRead(buttonPin);
  Serial.println(buttonPinVal);
  delay(1000);

  //check if it is time to report
  if ((millis() - lastPressureReport) >= pressureChecktime) {
    lastPressureReport = millis();
    int pressureLevel = analogRead(buttonPin);

    //clarify the pressureLevel into one of three categories
    if (pressureLevel < 1000){
    Particle.publish("pressureLevel", "low", PRIVATE);
    //digitalWrite(ledPin, LOW);

    }
    if (pressureLevel >= 1000 && pressureLevel < 2000)
    Particle.publish("pressureLevel", "Medium", PRIVATE);
    if (pressureLevel >= 2000)
    {
        Particle.publish("pressureLevel", "High", PRIVATE);
        //digitalWrite(ledPin, HIGH);
    }
    //publish the event when the pressure is low
    sprintf(PressureValue, "%d", pressureLevel);
    Particle.publish("sensorValue", PressureValue, PRIVATE);
  }

 } // this is the end of the loop.
Click to Expand
0

Product


0

Reflection

1. Iteration is the process to move forward. There is no need for having a blueprint before getting down to manipulate the components.

2. Always find another way to solve the problem. Components are abundant more than we expect.

3. Setting up a test system that can exam whether it is a hardware issue or a software issue.

4. Manipulate others' code rather than build it from the scratch. Focus on the purpose of the project instead of coding.


x
Share this Project

Found In
Courses

49-713 Designing for the Internet of Things

· 26 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


About

How do you perfectly take good beer or milk from your fridge and make it awesome? Are you ever out shopping and forget if you are of your favorite drink or food? If so, this project is for you.

This project creates a real-time monitor that detect if you are low on a specific food or drink. For example, beer, it uses a weight detector to detect if it is a full beer bottle or an empty one. It connects to the Internet and sends a message to inform users that it is time to buy a new beer. The weight detector is a force sensitive material and is put under the beer.

Created

January 25th, 2017