Arduino Mad Scientist Laboratory EP#10: GAS leak finder (MQ-6 flammable gas sensor)

Today we will be attempting to take over the world by Building A flammable gas leak sniffer using a mq-6 gas sensor with ARDUINO.

 

Check us out on Facebook!

 

Parts List:

affiliate links

ARDUINO Board

10KΩ Potentiometer

Analog meter

MQ-6 Gas Sensor

Toggle Switch

330Ω Resistor

LED

AA Battery Holder (for 2 batteries)

MT3608 DC voltage step up module

Schematic:

 

ARDUINO Code:

 

#define met 3

void setup() {

// Serial.begin(9600); // 4 testing
pinMode(met,OUTPUT);
}

void loop() {

int val = analogRead(A1);
val=constrain(val,200,1000);
val=map(val,200,1000,0,255);
// Serial.println(val); // 4 testing
analogWrite(met,val);
delay(5);
}