Zach CJacob LyttonAndrew Pervere
Published

Team 11 - "Get off the boat" Emergency system

Combination of three sensors that can be placed remotely to alert based on smoke, fire, or water. Hence, "Get off the boat".

IntermediateFull instructions provided286
Team 11 - "Get off the boat" Emergency system

Things used in this project

Hardware components

Argon
Particle Argon
×3
Breadboard (generic)
Breadboard (generic)
×3
Elegoo Flame Sensor
×1
Elegoo Water Level Sensor
×1
MQ-2 Smoke Sensor
×1
SparkFun Breadboard Power Supply 5V/3.3V
SparkFun Breadboard Power Supply 5V/3.3V
×1
9V battery (generic)
9V battery (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor Kit, 50-Pieces each
Resistor Kit, 50-Pieces each
×1
LED (generic)
LED (generic)
×6
Fasteners
Miscellaneous fasteners to secure enclosures around sensors
×1

Software apps and online services

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

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
To manufacture enclosures for water level and flame sensors
Laser cutter (generic)
Laser cutter (generic)
To manufacture enclosures made of acrylic for smoke sensor

Story

Read more

Custom parts and enclosures

Smoke Detector Enclosure

For use with 0.2" material

Flame Sensor Enclosure

CAD files, .stl files, and Prusa Slicer project file for the flame sensor enclosure

Water Level Sensor Enclosure

.ipt and .stl files of the two piece enclosures for both the breadboard and the sensor itself

Schematics

Flame Sensor Schematic

Flame Sensor Schematic File

Smoke Detector Schematic

Smoke Detector Schematic File

Note the MQ2 sensor was used, refer to product documentation.

Water Level Sensor Schematic

Water Level Sensor Schematic File

Code

Flame Sensor Code

C/C++
Flashed to Particle Argon
int sensor = A3;        //Flame sensor pin
int LED_PIN = 13;
int Water_LED = D5;      //WaterLED
int Smoke_LED = D4;      //SmokeLED
int detect = 0;         //Fire detection initial variable

bool fire = false;      //Boolean thing

void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);                                         
pinMode(sensor, INPUT);                  //Assigns flame sensor to pin as input
pinMode(Smoke_LED, OUTPUT);             //Assigns Smoke LED to pin as input
pinMode(Water_LED, OUTPUT);              //Assigns Smoke LED to pin as input
Particle.subscribe("hook-response/Fire Status", myHandler1, MY_DEVICES);
Particle.subscribe("Smoke",myHandler2);                  //Smoke
Particle.subscribe("Water Level",myHandler3);            //Water Level

int status = 3;        //Flame sensor status pin

}
void myHandler1(String event, String data)
{
   
}
//void myHandler(String event, String data)
void myHandler2(const char *event, const char *data)
{
    if(data >= "2500")
        digitalWrite(Smoke_LED, HIGH);
        delay(2500);
        digitalWrite(Smoke_LED, LOW);
        delay(500);
      
}


void myHandler3(const char *event, const char *data) 
{
    if(data >= "10")
        digitalWrite(Water_LED, HIGH);
        delay(2500);
        digitalWrite(Water_LED, LOW);
        delay(500);
}




void loop() {
    detect = analogRead(sensor);          //Sensor reads
    if(detect <= 3500 && fire == false){ //If fire is detected and not reported already
        fire = true;    //Fire Flag assignment
         // Get some data
         String data = String(3500); 
         // Trigger the integration
        Particle.publish("Fire Status", String(detect), PRIVATE); 
        // Wait 60 seconds
        delay(6000);        //Slows publish rate
    }
    
    if(fire == true && detect >= 3000){   //If fire not detected
        fire = false;          //fire flag unassignment
    }
}

Smoke Detector Code

C/C++
Flashed to Particle Argon
int BLed=D6;
int RLed=D8;
int smoke=A5;   
int smokethresh=2850;       //Adjust for based on local baseline readings
int sensor = 0;             

void setup() 
{
pinMode(BLed,OUTPUT);
pinMode(RLed,OUTPUT);       //Set pinmode outputs
pinMode(smoke,INPUT);


Serial.begin(9600);

Particle.subscribe("Fire Status",myHandler1);
Particle.subscribe("Water Level",myHandler2);

}

void myHandler1(const char *event, const char *data)
{
        if(data > "2500")
        
        digitalWrite(RLed, HIGH);
        delay(2500);
        digitalWrite(RLed, LOW);
         delay(500);
        digitalWrite(RLed, HIGH);
         delay(2500);
        digitalWrite(RLed, LOW);
         delay(500);
         digitalWrite(RLed, HIGH);
        delay(2500);
        digitalWrite(RLed, LOW);
         delay(500);
        digitalWrite(RLed, HIGH);
         delay(2500);
        digitalWrite(RLed, LOW);
         delay(500);
         digitalWrite(RLed, HIGH);
        delay(2500);
        digitalWrite(RLed, LOW);
         delay(500);
}
void myHandler2(const char *event, const char *data)
{  
    if(data > "5")
        digitalWrite(BLed, HIGH);
        delay(2500);
        digitalWrite(BLed, LOW);
        delay(500);
         digitalWrite(BLed, HIGH);
        delay(2500);
        digitalWrite(BLed, LOW);
        delay(500);
         digitalWrite(BLed, HIGH);
        delay(2500);
        digitalWrite(BLed, LOW);
        delay(500);
         digitalWrite(BLed, HIGH);
        delay(2500);
        digitalWrite(BLed, LOW);
        delay(500);
}         
void loop() {

digitalWrite(BLed, LOW);
digitalWrite(RLed, LOW);

int sensor = analogRead(smoke);

if (sensor > smokethresh)
{
digitalWrite(RLed, HIGH);
digitalWrite(BLed, LOW);
}
else
 {
digitalWrite(BLed, HIGH);
digitalWrite(RLed, LOW);
}

 
String data = String(sensor);
Particle.publish("Smoke", data , PRIVATE);

delay(60000);

}

Water Sensor Code

C/C++
Flashed to Particle Argon
int resval = 0;
int water = A0;
int Flame_LED = D2;      
int Smoke_LED = D3;
int Water_LED = D4;
int val;

void setup()
{   
pinMode(Flame_LED,OUTPUT);
pinMode(Smoke_LED,OUTPUT);
pinMode(Water_LED,OUTPUT);

Serial.begin(9600);

Particle.subscribe("hook-response/Water Level", myHandler1, MY_DEVICES);
Particle.subscribe("Fire Status",myHandler2);
Particle.subscribe("Smoke",myHandler3);


}

void myHandler1(String event, String data)
{

}

void myHandler2(const char *event, const char *data)
{
       if(data >= "3000")
        
        digitalWrite(Flame_LED, HIGH);
        delay(2500);
        digitalWrite(Flame_LED, LOW);
         delay(500);
        digitalWrite(Flame_LED, HIGH);
         delay(2500);
        digitalWrite(Flame_LED, LOW);
         delay(500);
         digitalWrite(Flame_LED, HIGH);
        delay(2500);
        digitalWrite(Flame_LED, LOW);
         delay(500);
     
}
void myHandler3(const char *event, const char *data)
{  
    if(data >= "2500")
    
        digitalWrite(Smoke_LED, HIGH);
        delay(2500);
        digitalWrite(Smoke_LED, HIGH);
        delay(500);
        digitalWrite(Smoke_LED, HIGH);
        delay(2500);
        digitalWrite(Smoke_LED, LOW);
        delay(500);
        digitalWrite(Smoke_LED, HIGH);
        delay(2500);
        digitalWrite(Smoke_LED, LOW);
        delay(500);

}         


void loop() 
{
 // Get some data
  String data = String(10);
  // Trigger the integration
  Particle.publish("Water Level", data, PRIVATE);
  // Wait 30 seconds
    delay(30000);    
    
water = analogRead(A0)/25.6;

{
    if(water>=12)
    
    digitalWrite(Water_LED, HIGH);
        delay(2500);
        digitalWrite(Water_LED, LOW);
         delay(500);
        digitalWrite(Water_LED, HIGH);
         delay(2500);
        digitalWrite(Water_LED, LOW);
         delay(500);
}
    

Particle.variable("Water Level (mm)", water);

Particle.publish("Water Level (mm)", String(water));

delay(2000);
}

Credits

Zach C

Zach C

1 project • 2 followers
Jacob Lytton

Jacob Lytton

1 project • 1 follower
Andrew Pervere

Andrew Pervere

0 projects • 1 follower

Comments

Add projectSign up / Login