Ks0131 keyestudio EASY plug Analog Gas Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
==EASY plug Analog Gas Sensor==
[[image:ks0131图.jpg|thumb|600px|right|EASY plug Analog Gas Sensor ]]
<br>[[File:ks0131-1.png|500px|frameless|thumb]]<br>


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


<span style=color:red> '''Special Note:''' <br>
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface. <br> If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module. </span><br>


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


==Connection Diagram ==
<br>
<br>[[File:ks0131-2.png|500px|frameless|thumb]]<br>
==Technical Details==
* Dimensions: 56mm*20mm*18mm
* Weight: 9g


<br>
==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.
<br>[[File:ks0131.jpg|500px|frameless|thumb]]<br>


==Sample Code==
<br>
<pre>
==Upload the Code==
int gas_din=18;
Below is an example code. Open or drag below code to [https://wiki.keyestudio.com/Getting_Started_with_Mixly  Mixly Blocks] and upload. <br>
int gas_ain=A5;
<br>[[File:ks0398 18.1.png|500px|frameless|thumb]]<br>
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);
}
</pre>


<br>
==What You Should See==
<br>[[File:ks0398 18-1.png|600px|frameless|thumb]]<br>
<br>
Done uploading the test code, open the serial monitor and set the baud rate to 9600, you should be able to see the analog value.
<br>[[File:ks0398 18-2.png|600px|frameless|thumb]]<br>
<br>[[File:ks0131 Result.png|600px|frameless|thumb]]
<br>
==Adding OLED Display==
<br>
If you want to display the gas analog value more convenient, you can add  OLED screen.
<br>
'''Hookup Guide'''<br>
<br>[[File:OLED气体.jpg|500px|frameless|thumb]]<br>
<br>
'''Test Code'''<br>
<br>[[File:ks0398 18.1.png|500px|frameless|thumb]]<br>
<br>
'''What You Should See'''<br>
Upload success, you should be able to see the analog value is showed on the OLED screen. 
<br>[[File:ks0398 18-3.png|500px|frameless|thumb]]<br>
<br>
<br>
==Resources ==
==Resources ==


'''PDF'''
https://fs.keyestudio.com/KS0131


https://drive.google.com/open?id=1pyThscSF3TAERFTrTj7xfPnUuO15KSsR
<br>


==Buy from ==
==Buy from ==
'''Official Website'''
*[https://www.keyestudio.com/newkeyestudio-easy-plug-analog-gas-sensor-mq-2-for-arduino-starter-steam-p0103.html  '''Official Website''' ]
 
*[https://www.aliexpress.com/store/product/NEW-Keyestudio-EASY-plug-Analog-Gas-Sensor-MQ-2-for-arduino-starter/1452162_32647755242.html?spm=2114.12010612.8148356.54.60624ba73cp1Lj  Shop on aliexpress ]


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


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

Latest revision as of 16:43, 7 January 2021

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.
This module should be used together with EASY plug control board.

Special Note:
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface.
If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module.


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

Below is an example code. Open or drag below code to Mixly Blocks and upload.

thumb


What You Should See


thumb

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

thumb


Adding OLED Display


If you want to display the gas analog value more convenient, you can add OLED screen.
Hookup Guide

thumb


Test Code

thumb


What You Should See
Upload success, you should be able to see the analog value is showed on the OLED screen.
thumb



Resources

https://fs.keyestudio.com/KS0131


Buy from