Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Mahmood AlathiahJose Valles-RojasJose Maldonado
Published

MEGR-3171 Group 22: Stove Safety Monitory System

The Stove Safety Monitory System monitors the temperature and motion around the stove with real-life data to maintain home safety.

IntermediateShowcase (no instructions)310
MEGR-3171 Group 22: Stove Safety Monitory System

Things used in this project

Hardware components

Argon
Particle Argon
×2
Breadboard (generic)
Breadboard (generic)
×2
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Gravity: DS18B20 Temperature Sensor (Arduino Compatible)
DFRobot Gravity: DS18B20 Temperature Sensor (Arduino Compatible)
×1
Jumper wires (generic)
Jumper wires (generic)
×9
Photo resistor
Photo resistor
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Maker service
IFTTT Maker service

Hand tools and fabrication machines

Tape, Electrical
Tape, Electrical
Tape, Clear
Tape, Clear

Story

Read more

Schematics

Flow Diagram

Temperature and Distance sensors Particle ARGON Circuit

Circuit Diagram

Light Sensor Particle ARGON Circuit

Circuit Diagram

Temperature and Distance Sensors

Light Sensor

Code

Temperature/Distance

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

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

// Data wire is plugged into digital pin 5 on the Arduino
#define ONE_WIRE_BUS 5

// Setup a oneWire instance to communicate with any OneWire device
OneWire oneWire(ONE_WIRE_BUS);  

// Pass oneWire reference to DallasTemperature library
DallasTemperature sensors(&oneWire);


////////////////////   OVEN
#define echoPin D2 // attach pin D2 Arduino to pin Echo of HC-SR04
#define trigPin D3 //attach pin D3 Arduino to pin Trig of HC-SR04
// defines variables
long duration; // variable for the duration of sound wave travel
int distance; // variable for the distance measurement


void setup(void)
{
  sensors.begin();  // Start up the library
  Serial.begin(9600);
  
  pinMode(trigPin, OUTPUT); // Sets the trigPin as an OUTPUT
  pinMode(echoPin, INPUT); // Sets the echoPin as an INPUT
  Serial.begin(9600); // // Serial Communication is starting with 9600 of baudrate speed
  Serial.println("Ultrasonic Sensor HC-SR04 Test"); // print some text in Serial Monitor
  Serial.println("with Arduino UNO R3");
 
  Particle.subscribe("Light", stoveonfunc, MY_DEVICES); 
 
 
}

void loop(void)
{ 
  // Send the command to get temperatures
  sensors.requestTemperatures(); 

  //print the temperature in Celsius
  Serial.print("Temperature: ");
  Serial.print(sensors.getTempCByIndex(0));
  Serial.print((char)176);//shows degrees character
  Serial.print("C  |  ");

  
  if (sensors.getTempCByIndex(0) > 37) Particle.publish("Temperature", "The stove is ON", PRIVATE);
  delay(1000);
  
  if (sensors.getTempCByIndex(0) < 29) Particle.publish("Temperature", "The stove is OFF", PRIVATE);
  delay(60000);
  
   // Clears the trigPin condition
 digitalWrite(trigPin, LOW);
 delayMicroseconds(5);

 // Sets the trigPin HIGH (ACTIVE) for 10 microseconds
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigPin, LOW);

 // Reads the echoPin, returns the sound wave travel time in microseconds
 duration = pulseIn(echoPin, HIGH);

 // Calculating the distance
 distance = duration * 0.034 / 2; // Speed of sound wave divided by 2 (go and back)

 if ( distance > 10) Particle.publish("Oven", "The Oven door is OPEN", PRIVATE);
  
 delay(60000);
}

Photosensor

C/C++
#include "lib1.h"



int lightSensor = A0;





void setup() {
    pinMode(lightSensor, INPUT);
    
}

void loop() {
    
    int lightLevel = analogRead (lightSensor);
    
    if (lightLevel > 1) Particle.publish("Light", "Light", PRIVATE);
    if (lightLevel < 1) Particle.publish("Light", "No_Light", PRIVATE);
    
    delay(10000);
}

Credits

Mahmood Alathiah
2 projects • 3 followers
Contact
Jose Valles-Rojas
1 project • 3 followers
Mechanical Engineering
Contact
Jose Maldonado
1 project • 3 followers
Mechanical Engineering Student
Contact

Comments

Please log in or sign up to comment.