Hi,
I have just purchased and a gas sensor for carbon monoxide meter by i2c:
I´m using an ESP32 Feather and the i2c Feather.
I was able to read other i2c sensor wihtou problem for example another gas sensor (MQ5)
But when I try to read the MQ7 I always get nan (not a number).
I´m using the following library to read from this sensor:
When I remove the sensor I can see a message that the sensor has been disconnected but never returns a value.
What can I do?
Thanks!!
Is there any other i2c device connected to the ESP32 while you are testing MQ7?
Hi,
I have tried in both ways, with more devices and also alone. But the results are the same.
does the i2c devices scans?
try this code
// Distributed with a free-will license.
// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
// ADC121C_MQ9
// This code is designed to work with the ADC121C_I2CGAS_MQ9 I2C Mini Module available from ControlEverything.com.
// https://www.controleverything.com/content/Gas?sku=ADC121C_I2CGAS_MQ9#tabs-0-product_tabset-2
#include <Wire.h>
// ADC121C_MQ9 I2C address is 0x50(80)
#define Addr 0x50
void setup()
{
// Initialise I2C communication as MASTER
Wire.begin();
// Initialise serial communication, set baud rate = 9600
Serial.begin(9600);
delay(300);
}
This file has been truncated. show original
Hi,
I have just tried your code, only with MQ5 sensor connected to the chain and the results are:
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = 270.63
Sensor Voltage = 0.00V
Concentration = 270.63
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Concentration = inf
Sensor Voltage = 0.00V
Looks like somethin is broken becouse the sensor is returning 0V…
earlier you mentioned that MQ5 is working. are you testing MQ7 or MQ5 in the above test case.
run the i2c scan and see if the devices shows up with an i2c address.
Thanks
Hi,
I was testing only the MQ-7 in this test and the I2C scanner find the device correctly in the desired I2C address.
I will test one over here. Meanwhile can you post a picture of the board.
Thanks