OLIMEX guide for reading data from SNS-MQ2, SNS-MQ3, SNS-MQ7 and SNS-MQ135 sensors with an Arduino-like board.
This OLIMEX guide explains how to read the values of an MQ gas or air quality sensor. It covers hardware assembly, software configuration and the Arduino code used to read analog input from the sensor.
The example setup uses an SNS-MQ2 sensor, an OLIMEXINO-328 board, three jumper wires, a mini USB cable and a personal computer. The guide also describes the four sensors OLIMEX distributes and the substances each one is suitable for detecting.
| Sensor power supply | 5V voltage source and a ground line |
|---|---|
| Data output | Analog data line or digital data line |
| Analog input pin | analog input pin 0 |
| Serial baud rate | 9600 |
| Read interval | 100ms |
| Example host board | OLIMEXINO-328 with ATmega328p |
The SNS-MQ2 detects LPG, propane and hydrogen in the air, and can also be used to detect methane and other combustible substances.
The SNS-MQ7 is a highly sensitive detector of carbon monoxide in the air.
The SNS-MQ135 is an air sensor that detects NH3, NOx, alcohol, benzene, smoke, CO2, etc.
The SNS-MQ3 is an air detector suitable for detecting alcohol and benzin.