CO (Carbon Monoxide) concentration from MQ7 sensor
The files are used to obtain parts per million (ppm) of the Carbon Monoxide gas using the analog input of the MQ7 gas sensor.
The following involves the basic connection of MQ7 and Arduino board and the use of this library.
- Connect the Vcc and GND pins of the MQ7 sensor to the Arduino 5v and GND pin respectively.
- Wire the A0 (analog pin) of MQ7 sensor to any analog pin on the Arduino board.
- Make sure the load resistance of the MQ7 is 10k ohm. (In the MQ7 board make sure the potentiometer measures 10k ohm).
- Download Arduino Software.
- Clone or download this files and place them under \Program Files\Arduino\libraries\MQ7 folder for including them in the Arduino code.
- Include the header file to the source code.
#include "MQ7.h"
- Initialize the sensor object
MQ7 mq7(A0, 5.0); // param[1] : Analog pin number, param[2] : Sensor Vcc value
- To find the ppm
float ppm = mq7.getPPM();
This library can be used on any Arduino or ESP boards. Just vary the param[2] based on the Vcc.