Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
ELEDTROLED
Published © CC BY-ND

Smoke and Gas Sensor

In this project, we will use the MQ-02 sensor to detect smoke and gas.

BeginnerFull instructions provided3,563
Smoke and Gas Sensor

Things used in this project

Story

Read more

Schematics

schematic

Code

Smoke and gas sensor code

Arduino
to implement in the kitchen or workshop
int VALOR;
int AVISO = 2;
int VERDE = 3;

void setup() {
  pinMode(A0, INPUT);
  pinMode(AVISO, OUTPUT);
  pinMode(VERDE, OUTPUT);
}

void loop() {
  digitalWrite(VERDE, HIGH);
  VALOR = analogRead(A0 > 400);
  if(VALOR == 400) {
    digitalWrite(AVISO, HIGH);
    delay(500);
    digitalWrite(AVISO, LOW);
    delay(500);
  } 
  
}

Credits

ELEDTROLED
0 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.