Close the Fridge Door !

Made by Kedi Zhang

Found in DIoT 2018 1- Home Hack

This product detects the light inside the fridge when we open it and begin to count time. If it lasts for more than 5 mins, then it means we forget to close the door and the product will beep.

0

Intention

I have an eco-enthusiast roommate who often gets angry when we forget to close the fridge door.
Therefore, this product will save both energy and our friendship haha~
0

Proposal

The device will be placed in the refrigerator unit rather than freezer unit. The sensor will start a timing if it receives sufficient light, no matter the light from outside or the light from fridge bulbs. Timing is cut if the light goes. If it lasts for 5 mins, it will trigger the beeper and beep for 10 seconds to remind us that we forget to close our fridge door. After completing these steps, I will try how to generate push up message send to my phone because sometimes we may already leave the kitchen and may not hear the noise.

0

Process (Plan)

Major components will be a light sensor, a beeper, the particle board and a battery module.

Here are two steps to achieve the ideal performance. The first step is to build a minimal functioning prototyping working locally. It receives local data (light), processes on a local chip, and actuated local beeper. This device becomes a connected object in the second step when we monitor the data in the online console and send out messages to another device.

0

Product

Quick summary:

1. Three components: photoresistor (SENSOR, INPUT), beeper(OUTPUT), resistor

2. Sensor data is available on Particle cloud and can trigger TWILIO API to send messages to the user.

3. Local feedback: beeper generate NOKIA TONE


The product will alert you locally by playing NOKIA TONE for 3 times if you leave your door open for more than 5 mins (3s in my current code). If you close the fridge door, it will not play another time. If you fail to close the door before the 3rd NOKIA TONE ends, you will receive an SMS. If you ignore all of these alerts, you will hear the alert and receive SMS every 20mins (1 min in my current code).

Nice :)

Here are videos:

0

Open the door for 3s and it begins to alert:

0
0

2. It rings 3 times and send you an SMS

0
0
// Creative Project 1: Home Hack, Kedi Zhang, 30 Jan 2018
int speakerPin = D0;
int photoCellPin = A1;
int photoCellReading = 0;
int count = 0;
String body = "Close your fridge door!!!";

// create an array for the notes in the melody:
//C4,G3,G3,A3,G3,0,B3,C4
int melody[] = {0,2637,2349,1480,1661,2217,1976,1175,1319,1976,1760,1109,1319,1760};

// create an array for the duration of notes.
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {4,8,8,4,4,8,8,4,4,8,8,4,4,2};

void playNotes()
{
    // iterate over the notes of the melody:
    for (int thisNote = 0; thisNote < 14; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      int noteDuration = 1000/noteDurations[thisNote];
      tone(speakerPin, melody[thisNote],noteDuration);

      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
      // stop the tone playing:
      noTone(speakerPin);
    }
}



void setup(){

  // Set up the LED for output
  pinMode(speakerPin, OUTPUT);

  // Create a cloud variable of type integer
  // called 'light' mapped to photoCellReading
  Particle.variable("light", &photoCellReading, INT);

  Serial.begin(9600);

}


void loop() {
  photoCellReading = analogRead(photoCellPin);

  Serial.print("Analog reading = ");
  Serial.print(photoCellReading);     // the raw analog reading

  // We'll have a few threshholds, qualitatively determined
  if (photoCellReading < 3250) {
      Serial.println(" - Dark");
      delay(100);
      count = 0;
    } else {
      Serial.println(" - Bright");
      if (count == 0) {
        delay(3000);
        if (photoCellReading > 3249) {
          count++;
        }
      } else if (count < 4) {
        playNotes();
        count++;
      } else if (count == 4) {
        count++;
        Particle.publish("twilio_sms", body, PRIVATE);
      } else {
        delay(60000);
        count = 0;
      }

    }
}
Click to Expand
0

Reflection

Reflect on the process of making this project. What did you learn? What would you do differently?

x
Share this Project

Courses

49713 Designing for the Internet of Things

· 25 members

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


Focused on
About

This product detects the light inside the fridge when we open it and begin to count time. If it lasts for more than 5 mins, then it means we forget to close the door and the product will beep.

Created

January 24th, 2018