Ks0131 keyestudio EASY plug Analog Gas Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
Line 65: Line 65:
http://www.keyestudio.com/keyestudio-easy-plug-analog-gas-sensor-mq-2-for-arduino-starter.html
http://www.keyestudio.com/keyestudio-easy-plug-analog-gas-sensor-mq-2-for-arduino-starter.html


[[category:Module]]
[[category:EASY Plug]]

Revision as of 10:49, 30 October 2018

EASY plug Analog Gas Sensor


thumb

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 needs to be used together with EASY plug control board.


Specification

  • Interface: Easy plug
  • Power supply: 5V
  • Interface type: Digital and Analog
  • Wide detecting scope
  • Quick response and High sensitivity
  • Simple drive circuit
  • Stable and long lifespan
  • Size: 56*20mm
  • Weight: 10g

Connection Diagram


thumb


Sample Code

int gas_din=18;
int gas_ain=A5;
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);
}

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