Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Mallory KennedyJames Neale
Published

Oven Safety Detector

The Oven Safety Detector will help monitor the basic oven components that indicate if the oven has been left on and notify the owner.

IntermediateFull instructions provided132
Oven Safety Detector

Things used in this project

Hardware components

Argon
Particle Argon
×2
Breadboard (generic)
Breadboard (generic)
×1
Photo Sensor
×3
Thermistor
×1
High Temperature Flue Tape
×1

Software apps and online services

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

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires

Story

Read more

Schematics

Sensors Schematic

Flow Chart

Code

LEDs

ABAP
- Example of using the ChainableRGB library for controlling a Grove RGB.
- This code cycles through all the colors in any uniform way. This is accomplished using a HSB color space
#define NUM_LEDS  1
 
 //Variables
int i=0;
ChainableLED leds(A4, A5, NUM_LEDS);
double LBoundLED = 0.65;
double UBoundLED = 0.00;
int UBound = 1400;
int LBound = 1800;
double LEDval = 0.0;
double hue = 0.0;
String data;
String data2;
bool subscribe = false;
bool subscribe2 = false;

void setup() {
        
    leds.init();
    leds.setColorHSB(0, 0.0, 0.0, 0.0);
    int hue = LBoundLED;
    //Calling our two cloud variables
    subscribe = Particle.subscribe("OvenT", LED);
    subscribe2 = Particle.subscribe("OvenState", Call);
}

//Handlers
void LED(const char *event, String val)
{
  data = val;
}

void Call(const char *event, String val2)
{
  data2 = val2;
}

//Main Loop
void loop()
{
 
//Takes data and runs checks on it to see if the light should be on and what color it should take    
    if(subscribe == true and subscribe2 == true)
    {
        LEDval = data.toInt();
         if(LEDval < LBound)
        {
            hue = ((LEDval-LBound)*((UBoundLED-LBoundLED)/(UBound-LBound)))+LBoundLED;
            leds.setColorHSB(0, hue, 1, 0.5);
            Particle.publish("LED_on","ON");
            Particle.publish("Test", String(hue));
            i=0;
        }
        else if(data2 == "ON")
        {
            leds.setColorHSB(0, 0.8, 1, 0.5);
            Particle.publish("LED_on","ON");
            Particle.publish("Test", String(LEDval));
            i=0;
        }
        else
        {
            leds.setColorHSB(0, 0.0, 0, 0);
            if(i=0)
            {
                i++;
                Particle.publish("LED_on","OFF");
                Particle.publish("Test", String(data));
            };
        };
    
        //waits 10s
        delay(10000);
    }
    else 
    { 
        //lets me know if the it cannot  communicate with the other argon
        Particle.publish("Test","fail");
        delay(10000);
    };
}

Sensors

ABAP
//sensors.ino

// variables
int BurnL1 = 0;
int BurnL2 = 0;
int OvenL = 0;
int OvenT = 0;
int i = 0;
int i2 = 0;
bool LED_Con = false;

//Handler
void State(const char *event, const char *data)
{
    
}

void setup() {
    LED_Con = Particle.subscribe("LED_on", State);
}

//main loop
void loop() {
    
//reads sensors
BurnL1 = analogRead(A0);
BurnL2 = analogRead(A1);
OvenL = analogRead(A2);
OvenT = analogRead(A5);

    //checks to see if oven is on
    if(BurnL1 > 300 or BurnL2 > 300 or OvenL > 100 or OvenT < 1700)
    {
        //publish sensor information
        Particle.publish("OvenT", String(OvenT));
        delay(500);
        Particle.publish("OvenState", "ON");
        delay(500);
        Particle.publish("BurnL1", String(BurnL1));
        delay(500);
        Particle.publish("BurnL2", String(BurnL2));
        delay(500);
        Particle.publish("OvenL", String(OvenL));
        i2=0;
    }
    else
    {
        if(i2==0)
        {
        i2++;
        Particle.publish("OvenState", "OFF");
        }
    }

    delay(8000);
    if (LED_Con == true and i==0)
    {
        i++;
        Particle.publish("LED_Confirm", "true");
    }
    else
    {
        i=0;
    }
}

Credits

Mallory Kennedy
1 project • 0 followers
Contact
James Neale
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.