Hazardous Gas Detector

0 25306 Medium

The handheld hazardous gas detector is a lifesaving device for technicians and engineers who want to ensure their safety at work.

Hazardous Gas Detector

Things used in this project

 

Hardware components

HARDWARE LIST
1 DFRobot Gravity: Analog Gas Sensor (MQ2) For Arduino
1 DFRobot Gravity: Analog LPG Gas Sensor (MQ5) For Arduino
1 DFRobot Carbon Monoxide Sensor (MQ7)
1 DFRobot Gravity: Analog CO/Combustible Gas Sensor (MQ9) For Arduino
2 Particle Argon
6 LED (generic)
1 Jumper wires (generic)
2 Breadboard (generic)
2 Rechargeable Battery, Lithium Ion
1 Resistor 100 ohm

Software apps and online services

 

Particle Build Web IDE

Hand tools and fabrication machines

 

Hot glue gun (generic)

 

Tape, Electrical

 

3D Printer (generic)

Story

 

Alex Whitaker and Sam Weaver spent their past summer working at chemical plants with numerous hazards, including ethanol, nitric acid, nitrogen, hydrogen gas, ammonia, and other hazardous gasses. We both decided to develop a solution to help mitigate the risks engineers and technicians face as they accomplish their tasks. The hazardous gas detector can be worn around the belt and can hold up to 2 sensors. These can work very well if multiple technicians are together simultaneously. The problem we aim to solve is to allow technicians to know if they are in an area of immediate danger and if they are, they can take steps to vacate the premises. This technological solution has the potential to save lives, as there have been numerous cases of technician fatalities due to hazardous gasses, including the Valero refinery asphyxiation incident. The solution is ingenious because it can be easily worn on a belt rather than carrying it in a technician's hand. The newfound IOT skills can be used to test sensors, code the program needed to make the sensors output useful information, and could even save someone's life. Overall, the hazardous gas detector is quite useful for the safety of engineers and technicians, and everyone should consider using one, even in their own homes.

 

The team started by researching sensors to use for the particle argon. The team ultimately decided to use the MQ2, MQ5, MQ7, and MQ9 sensors. Each of these sensors would be connected to an LED and could communicate with the other person's particle via a "buddy" LED. Each of these sensors had a multitude of gasses it could detect, including:

 

MQ2 - LPG, Smoke, Alcohol, Propane, Hydrogen, Methane, and Carbon Monoxide

MQ5 - Hydrogen, LPG, CH4, Carbon Monoxide, and Alcohol

MQ7 - Carbon Monoxide

MQ9 - CH4, Propane, and Carbon Monoxide

 

These sensors would be tested through a car exhaust and isopropyl alcohol. MQ 2 and MQ 5 were used to test alcohol, while MQ 7 and MQ 9 were used to test the carbon monoxide output of a car. Check out our Youtube video for more information.

 

The live data from the sensors was graphed using Adafruit.

IOT Project Hazard Gas Detector - Sam Weaver and Alex Whitaker

 

Figure 1: Circuit Assembly with circuit exposed

 

Figure 1: Circuit Assembly with circuit exposed

 

Figure 2: Circuit exposed with Front Panel View of LED's and Sensors

 

Figure 2: Circuit exposed with Front Panel View of LED's and Sensors

 

Figure 3: Circuit case with Sensors and LED's exposed, hand used for reference of size

 

Figure 3: Circuit case with Sensors and LED's exposed, hand used for reference of size

 

Figure 4: Final Assembly of Hazard Gas Detector

 

Figure 4: Final Assembly of Hazard Gas Detector

 

Figure 5: Communication Flow Chart

 

Figure 5: Communication Flow Chart

 

Custom parts and enclosures

icon iot_project_CAexDjoauY.zip 1.09MB Download(0)

Schematics

 

IOT Hazard Gas Detector IOT Circuit

 


 

Code

 

Argon 1 Code

Arduino

CODE
// MQ-2 Smoke Sensor
int Led1 = D3;
int smokeSensor = A5;
int smokeThres = 1140;

// MQ-7 Carbon Monoxide Sensor
int Led2 = D5;
int coSensor = A3;
int coThres = 1060;

// led goes off when other Argon senses gas
int buddyLED = D1;

int natGasSensor = 0;
int combustibleSensor = 0;

void natGasHandler(const char *event, const char *data) {
  natGasSensor = String(data).toInt();
}

void combustibleHandler(const char *event, const char *data) {
  combustibleSensor = String(data).toInt();
}

void setup() {
  pinMode(Led1, OUTPUT);
  pinMode(smokeSensor, INPUT);
  pinMode(Led2, OUTPUT);
  pinMode(coSensor, INPUT);
  pinMode(buddyLED, OUTPUT);

  Particle.subscribe("Natural Gas Sensor", natGasHandler);
  Particle.subscribe("Combustible Sensor", combustibleHandler);
}

void loop() {
  // reads the smoke sensor data
  int smokeSensorReading = analogRead(smokeSensor);

  // lights up LED if sensor is higher than the sensor threshold
  if (smokeSensorReading > smokeThres) {
    digitalWrite(Led1, HIGH);
  }
  else {
    digitalWrite(Led1, LOW);
  }

  // publishes data and waits until a set amount of time has passed to keep running
  Particle.publish("Smoke Sensor", String(smokeSensorReading));
  delay(4500);
  
  // reads the data from the CO sensor
  int coSensorReading = analogRead(coSensor);
  
  // lights up another LED if sensor is higher than sensor threshold
  if (coSensorReading > coThres) {
    digitalWrite(Led2, HIGH);
  }
  else {
    digitalWrite(Led2, LOW);
  }

  // publishes data and waits until a set amount of time has passed to keep running
  Particle.publish("Carbon Monoxide Sensor", String(coSensorReading));
  delay(4500);
  
  // turns on LED if the other Argon detects hazardous gas
  if (natGasSensor>880 || combustibleSensor>1400) {
    digitalWrite(buddyLED, HIGH);
  } else {
    digitalWrite(buddyLED, LOW);
  }
}

Argon 2 Code

Arduino

CODE
// MQ-5 Natural Gas Sensor
int Led1 = D3;
int natGasSensor = A5;
int natGasThres = 880;

// MQ-9 Combustible Sensor
int Led2 = D5;
int combustibleSensor = A3;
int combustibleThres = 1400;

// led goes off when other Argon senses gas
int buddyLED = D1;

int smokeSensor = 0;
int coSensor = 0;

void smokeHandler(const char *event, const char *data) {
  smokeSensor = String(data).toInt();
}

void coHandler(const char *event, const char *data) {
  coSensor = String(data).toInt();
}

void setup() {
  pinMode(Led1, OUTPUT);
  pinMode(natGasSensor, INPUT);
  pinMode(Led2, OUTPUT);
  pinMode(combustibleSensor, INPUT);
  pinMode(buddyLED, OUTPUT);

  Particle.subscribe("Smoke Sensor", smokeHandler);
  Particle.subscribe("Carbon Monoxide Sensor", coHandler);
}

void loop() {
  // reads the natural gas sensor data
  int natGasSensorReading = analogRead(natGasSensor);
  
  // lights up another LED if sensor is higher than sensor threshold
  if (natGasSensorReading > natGasThres) {
    digitalWrite(Led1, HIGH);
  }
  else {
    digitalWrite(Led1, LOW);
  }

  // publishes data to particle
  Particle.publish("Natural Gas Sensor", String(natGasSensorReading));
  delay(4500);
  
  // reads the data from the combustibel sensor
  int combustibleSensorReading = analogRead(combustibleSensor);
  
  // lights up another LED if sensor is higher than sensor threshold
  if (combustibleSensorReading > combustibleThres) {
    digitalWrite(Led2, HIGH);
  }
  else {
    digitalWrite(Led2, LOW);
  }
 
  // publishes the data to particle
  Particle.publish("Combustible Sensor", String(combustibleSensorReading));
  delay(4500);

  // turns on LED if the other Argon detects hazardous gas
  if (smokeSensor>1140 || coSensor>1060) {
    digitalWrite(buddyLED, HIGH);
  } else {
    digitalWrite(buddyLED, LOW);
  }
}

The article was first published in hackster, November 17, 2022

cr: https://www.hackster.io/iot-project-team-44/hazardous-gas-detector-b6be30

author: IoT Project Team 44: Alex Whitaker, Sam Weaver

License
All Rights
Reserved
licensBg
0