Kaptain.
Telegram /
LinkedIn /
Email /
GIT /
RSS /
GPG /
Заказ печатных плат

№ 11876 В разделах:
Electronics
ESP8266
от January 3rd, 2023,
В подшивках: Arduino, ESP8266, Sensors, Smart Home
Judging by the reaction to various gases and the operating algorithm, they are based on the same tin oxide catalyst. Both detected the presence of gas from a lighter, and both identified methanol, ethanol and isopropanol vapors perfectly. The air exhaled by a person does not affect them in any way. When tested with carbon monoxide, only the MQ-7 showed minor changes.
Both sensors have a low- and high-level digital output and an analogue ADC output. It’s clear that the digital output is very easy to read and often you don’t even need a microcontroller for some logic to work, for example, to turn on an alarm through a relay, but with an analog leg it’s not so simple. The level of the output analog signal is regulated by a variable resistance to an acceptable level of the initial signal. No special libraries are required, just use the ADC built into your microcontroller.
#define MQAnalogPin A0
int gasLevelWarning = 300;
void setup() {
Serial.begin(9600);
}
void loop() {
int gasLevel = analogRead(MQAnalogPin);
Serial.print(gasLevel);
if (gasLevel > gasLevelWarning) {
Serial.println(": WARNING! GAS LEAK!");
} else {
Serial.println(": clean");
}
delay(50);
}
Testing
Everywhere it is recommended to preheat the sensor for 2 minutes, after which it can be read.
Fortune cookie: On SECOND thought, maybe I'll heat up some BAKED BEANS and watch REGIS PHILBIN ... It's GREAT to be ALIVE!!
Leave a Reply