user56839: We are to make a project.We have to connect MQ7, buzzers and lights to Arduino. And one buzzer will make sound when gas reaches high level and another buzzer will beep when gas level is very low.. High gas amount will lead to red light glow and very low gas will lit green light.. HOW TO EXECUTE ??

user30341: Easy, this is one of the simple projects used as an introduction to Arduino programming.  You will find many versions of free code out there.  below is an example and a total newbie step-by-step.

Download Arduino IDE.  Buy an MQ7, an Arduino or NodeMCU, a breadboard, a LED and some jumper wires and you are in business.  Use the sketch below or google "MQ7 arduino sketch".
/* MQ-7 Carbon Monoxide Sensor Circuit with Arduino */

const int AOUTpin=0;//the AOUT pin of the CO sensor goes into analog pin A0 of the arduino
const int DOUTpin=8;//the DOUT pin of the CO sensor goes into digital pin D8 of the arduino
const int ledPin=13;//the anode of the LED connects to digital pin D13 of the arduino

int limit;
int value;

void setup() {
  Serial.begin(115200);//sets the baud rate
  pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino
  pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino
}

void loop() {
  value= analogRead(AOUTpin);//reads the analaog value from the CO sensor's AOUT pin
  limit= digitalRead(DOUTpin);//reads the digital value from the CO sensor's DOUT pin
  Serial.print("CO value: ");
  Serial.println(value);//prints the CO value
  Serial.print("Limit: ");
  Serial.print(limit);//prints the limit reached as either LOW or HIGH (above or underneath)
  delay(100);
  if (limit == HIGH){
    digitalWrite(ledPin, HIGH);//if limit has been reached, LED turns on as status indicator
  } else {
    digitalWrite(ledPin, LOW);//if threshold not reached, LED remains off
  }
}

original sketch published by Learning About Electronics

56839: <p>We are to make a project.We have to connect MQ7, buzzers and lights to Arduino. And one buzzer will make sound when gas reaches high level and another buzzer will beep when gas level is very low.. High gas amount will lead to red light glow and very low gas will lit green light.. HOW TO EXECUTE ??</p>
 30341: <p>Easy, this is one of the simple projects used as an introduction to Arduino programming.  You will find many versions of free code out there.  below is an example and a total newbie step-by-step.</p>

<p><a href="https://i.stack.imgur.com/m0QMU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m0QMU.png" alt="enter image description here"></a></p>

<p>Download Arduino IDE.  Buy an MQ7, an Arduino or NodeMCU, a breadboard, a LED and some jumper wires and you are in business.  Use <a href="http://www.learningaboutelectronics.com/Articles/MQ-7-carbon-monoxide-sensor-circuit-with-arduino.php" rel="nofollow noreferrer">the sketch below</a> or google "MQ7 arduino sketch".</p>

<pre><code>/* MQ-7 Carbon Monoxide Sensor Circuit with Arduino */

const int AOUTpin=0;//the AOUT pin of the CO sensor goes into analog pin A0 of the arduino
const int DOUTpin=8;//the DOUT pin of the CO sensor goes into digital pin D8 of the arduino
const int ledPin=13;//the anode of the LED connects to digital pin D13 of the arduino

int limit;
int value;

void setup() {
  Serial.begin(115200);//sets the baud rate
  pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino
  pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino
}

void loop() {
  value= analogRead(AOUTpin);//reads the analaog value from the CO sensor's AOUT pin
  limit= digitalRead(DOUTpin);//reads the digital value from the CO sensor's DOUT pin
  Serial.print("CO value: ");
  Serial.println(value);//prints the CO value
  Serial.print("Limit: ");
  Serial.print(limit);//prints the limit reached as either LOW or HIGH (above or underneath)
  delay(100);
  if (limit == HIGH){
    digitalWrite(ledPin, HIGH);//if limit has been reached, LED turns on as status indicator
  } else {
    digitalWrite(ledPin, LOW);//if threshold not reached, LED remains off
  }
}
</code></pre>

<p>original sketch published by <a href="http://www.learningaboutelectronics.com/" rel="nofollow noreferrer">Learning About Electronics</a></p>
