I took your post as criticising the commercialising.
@nickrout got it - sorry I was not - I think it’s cool and definitely ordered 1 to try out will let you know how it is. (Also this reminded me of the famous “Was that sarcasm” scene from Big Bang Theory: "Was That Sarcasm?" - Sheldon Cooper - The Big Bang Theory - YouTube)
Sorry I didn’t get it, I am not a Sheldonista, more my son’s generation. I get the humour, just haven’t fanatically followed the show 
Hello all,
I am relatively new to ESPhome and Home Assistant, so I think it is better to ask…
I noticed that the MQ-2 initial resistance change over time or at the startup. So I found this article.
https://diyprojects.io/mq2-gas-smoke-detector-arduino/#.YVzBTdpByUk
So how can I make the automatic calibration… something like…
on boot… from 2nd to 5 minute to calculate the mid-value and set that value to a global variable
(I am using NodeMCU)
(i don’t know should I calculate all the curve ppm values, coz it’s good for me to be notified if the analog value increases dramatically from the initial mid-value).
Hi,
Is there any best practice solution to calibrate this sensor accurately? Since the gas sensor will provide a kind of security at my kitchen, this is critical for me 
That’s the ugliest PCB of all time! Just kidding man. Gotta start somewhere. Been wanting to start myself…designing PCBs. Been a few years…hope you’re still watching. Would love to see how it worked out.
Here is the config from @AlexBelfegor
Using global CO2 level from: Daily CO2
And corrected: “CorrectedRZero” from the balcony with an open window.
It also uses Temp & Humid sensor: AM2302
Interestingly, this sensor still drifts strangely:
- Twenty-four hours at the balcony, and values are continuously drifting upward.
- A few days at home env, in the bedroom and values are up to tens of thousands!
The PPM:
The correction resistance drift graph:
I don’t think this sensor is reliable for CO2 measurement, and it’s instead the air quality at max.
Or I have a bad sensor.
UPD: Or I am a silly person, who powered both sensors from 3v3. While MQ135 datasheet asks 5V! I’ll update this post after re-calibration later.
UPD2: The MQ-135 sensor is utterly unreliable. After I’ve fixed all my flaws, it is still pretty inaccurate. This sensor will panic as soon as you start cooking, for example. The CO2 levels will go to the sky level.
Here is the graph for 2 days of CO2 stats in the bedroom:
There is SOME correlation between people sleeping in that room and opened windows, but all peaks are random, the biggest one just cooking in the other room!
By the way, I only realized now that there is the use of an i2c while there are no sensors on such a bus for me since I only use a cheap DHT22.


