Darren SciortinoAlberto SteffensSpencer Smith
Published

MEGR 3171- Kitchen Monitoring System

This device can allow notifications for flames, filling the water pitcher, and fridge operating temperature.

BeginnerFull instructions provided10 hours70
MEGR 3171- Kitchen Monitoring System

Things used in this project

Hardware components

Solderless Breadboard Full Size
Solderless Breadboard Full Size
×3
Temperature Sensor
Temperature Sensor
×1
Gravity: Analog Flame Sensor For Arduino
DFRobot Gravity: Analog Flame Sensor For Arduino
×1
Grove - Water Sensor
Seeed Studio Grove - Water Sensor
×1
5 mm LED: Green
5 mm LED: Green
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Argon
Particle Argon
×3
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×3
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Google Sheets
Google Sheets
fritzing

Story

Read more

Schematics

Flame Sensor

Water Level Sensor

Temperature Sensor

Code

Water Level Sensor

C/C++
int waterlevel;
bool f=false;
bool b=false;
char tempstr[30];
// the setup routine runs once when you press reset:
void setup() {
    pinMode(A0, INPUT);
    pinMode(D2, OUTPUT);
  
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  Particle.variable("waterlevel", waterlevel);
}



void myHandler(const char *event, const char *data) // Recieves event data to save as a variable for processing
{
    if ((strcmp(data,"flame")==0))
        f=TRUE;
        
    if ((strcmp(data, "BritaHOT")==0))
        b=TRUE;
    else
     b=false;
     f=false;
}
// the loop routine runs over and over again forever:
void loop() 
{
  // read the input on analog pin 0:
  waterlevel = analogRead(A0);
  // print out the value you read:
  Serial.println(waterlevel);
  delay(2000);// delay in between reads for stability
  
  
  if (waterlevel > 800)
  Particle.publish("waterlevel","high",PRIVATE); // for bi direction communication
  else
  Particle.publish("waterlevel","low",PRIVATE);  // for bi direction communication
  
  if (waterlevel < 800 && f==1 && b==1)
   digitalWrite(D2,HIGH);
  else
    digitalWrite(D2,LOW);
    
}

Flame Sensor

C/C++
int flame;


// the setup routine runs once when you press reset:
void setup() {
    pinMode(A5, INPUT);
    pinMode(D3, OUTPUT);
  
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  Particle.variable("flame", flame);
  Particle.subscribe("waterlevel",myHandler, ("e00fce68e492a4e6bb553c3d"));
  Particle.subscribe("Brita",myHandler,("e00fce68ed4b905a7bfa0fc7"));

}
void myHandler(const char *event, const char *data) // Recieves event data to save as a variable for processing
{
    if ((strcmp(data,"high")==0) && (strcmp(data, "READY")==0))
      digitalWrite(D3, HIGH);
    else 
       digitalWrite(D3, LOW);
}
// the loop routine runs over and over again forever:
void loop() 
{
  // read the input on analog pin 0:
  flame = analogRead(A5);
  // print out the value you read:
  Serial.println(flame);
  delay(2000);// delay in between reads for stability
  
  
  if (flame < 500)
  Particle.publish("flame","flame",PRIVATE); // for bi direction communication
  else
  Particle.publish("flame","noflame",PRIVATE);  // for bi direction communication
  
}

Temperature Sensor

C/C++
int temp;
bool waterlevelrecieved;

// the setup routine runs once when you press reset:
void setup() {
    pinMode(A5, INPUT);
  
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  Particle.variable("temp", temp);
  Particle.subscribe("waterlevel",myHandler, ("e00fce68e492a4e6bb553c3d"));

}
void myHandler(const char *event, const char *data) // Recieves event data to save as a variable for processing
{
    if ((strcmp(data,"high")==0))
       waterlevelrecieved = 1;
    else 
       waterlevelrecieved = 0;
}
// the loop routine runs over and over again forever:
void loop() 
{
  // read the input on analog pin 0:
  temp = analogRead(A5);
  // print out the value you read:
  Serial.println(temp);
  delay(2000);// delay in between reads for stability
  
  
  if (temp < 1000)
  Particle.publish("temp","britaHOT",PRIVATE); // for bi direction communication
  else
  Particle.publish("temp","britaCOLD",PRIVATE);  // for bi direction communication
  
}

Credits

Darren Sciortino

Darren Sciortino

1 project • 1 follower
Alberto Steffens

Alberto Steffens

1 project • 1 follower
Spencer Smith

Spencer Smith

1 project • 1 follower
Thanks to Alberto Steffens and Spencer Smith.

Comments