1. Description
kidsbits blocks coding MQ-2 gas sensor is fully compatible with kidsbits control board and Lego building blocks.
You can easily connect it to kidsbits control board for communication using an RJ11 cable without worrying about wrong wiring and damage.
The gas-sensitive material used in this sensor is tin dioxide (SnO2), which has a low conductivity in clean air. When there is a flammable gas in the environment where the sensor is located, the conductivity of the sensor increases as the concentration of flammable gas in the air increases.

This analog gas sensor – MQ2 is used in gas leakage detecting equipment in consumer electronics and industrial markets.
This sensor has high sensitivity and quick response. It is suitable for detecting Liquefied gas, methane, Hydrogen and natural gas, etc.
In addition, the sensitivity can be adjusted by the blue potentiometer.
2. Technical Parameters
- Interface: EASY plug
- Operating voltage: DC 5V
- Output signal: analog signal
3. Hookup Guide

4. Import kidsbits Library
Begin with the Mixly blocks coding, you should first import the corresponding kidsbits library for those sensor modules.
Connect the control board to your computer using a USB cable.
Then open the Mixly blocks software 0.998, set the board to UNO R3, select your correct COM port. On the upper right corner you can switch the language.

After that, click Import, import the keyes-kidsbits library. Shown below.


If import custom library successfully, you should see the sensor module library.

Click on the analog read block of keyes_kidsbits, you can directly drag out the corresponding module to use.

5. Test Code

Open or directly drag the Mixly code of sensor to the Mixly window.

Click the Code to check it or click the right side bar:

6. Test Result

Hook it up and upload the code success, the POW led on the sensor lights up. When detecting the gas, the SIG led turns on.
Open the monitor and set the baud rate to 9600, you should be able to see the analog value. The greater the gas concentration, the greater the analog value is.
You are able to adjust the sensitivity by turning the blue potentiometer.
Note: the sensitivity is the best when turn the potentiometer to adjust the SIG led at the threshold between ON and OFF.
