Ks0131 keyestudio EASY plug Analog Gas Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
Line 64: Line 64:
==What You Should See==
==What You Should See==
Done uploading the test code, open the serial monitor and set the baud rate to 9600, you should be able to see the “Gas not leak” and analog value.
Done uploading the test code, open the serial monitor and set the baud rate to 9600, you should be able to see the “Gas not leak” and analog value.
<br>[[File:ks0131 Result.png|500px|frameless|thumb]]  [[File:ks0131 Result1.png|600px|frameless|thumb]]<br>
<br>[[File:ks0131 Result.png|600px|frameless|thumb]]  [[File:ks0131 Result1.png|600px|frameless|thumb]]<br>


<br>
<br>

Revision as of 10:53, 27 November 2018

EASY plug Analog Gas Sensor

Introduction

This analog gas sensor - MQ2 is used in gas leakage detecting equipment in consumer electronics and industrial markets.
This sensor is suitable for detecting LPG, I-butane, propane, methane, alcohol, Hydrogen and smoke. It has high sensitivity and quick response.
In addition, the sensitivity can be adjusted by the potentiometer.
Note: this module should be used together with EASY plug control board.


Features

  • Connector: Easy plug
  • Power supply: 5V
  • Interface type: Digital and Analog
  • Wide detecting scope
  • Simple drive circuit
  • Stable and long lifespan
  • Quick response and High sensitivity


Technical Details

  • Dimensions: 56mm*20mm*18mm
  • Weight: 9g


Connect It Up

Connect the EASY Plug analog gas sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code

Copy and paste below code to Arduino IDE and upload.

int gas_din=2;
int gas_ain=A7;
int led=13;
int ad_value;
void setup()
{
  pinMode(led,OUTPUT);
  pinMode(gas_din,INPUT);
  pinMode(gas_ain,INPUT);
  Serial.begin(9600);
}
void loop()
{ 
  ad_value=analogRead(gas_ain);
  if(digitalRead(gas_din)==LOW)
  { 
    digitalWrite(led,HIGH);
    Serial.println("Gas leakage");
    Serial.println(ad_value);
  }
  else
  {
    digitalWrite(led,LOW);
Serial.println("Gas not leak");
Serial.println(ad_value);
  }
  delay(500);
}


What You Should See

Done uploading the test code, open the serial monitor and set the baud rate to 9600, you should be able to see the “Gas not leak” and analog value.
thumb thumb


Resources

PDF
https://drive.google.com/open?id=1pyThscSF3TAERFTrTj7xfPnUuO15KSsR


Buy from

Official Website
http://www.keyestudio.com/keyestudio-easy-plug-analog-gas-sensor-mq-2-for-arduino-starter.html