georgk / mq135 Goto Github PK
View Code? Open in Web Editor NEWArduino library for the MQ135
License: GNU General Public License v3.0
Arduino library for the MQ135
License: GNU General Public License v3.0
So basically, I'm looking for codes for MQ-135 and MQ-2. I hope everyone could see this and thank you so much in advance! ^^
Hi , I tried using this code on ESP32 but the values from the getPPM() function were just not the same like on the UNO.
I know for a fact that the GPIO on esp32 is 4096, but changing the value on the getPPM() function, did not work. Any ideas? Thank you.
Why not pass RLOAD
as a parameter instead of hardcoding it into the library? The same with RZERO
.
It seems that formula for calculating sensor resistance in getResistance() has an error, 5.0 multiplier (probably analog reference voltage) is unnecessary. The formula should read:
((1023./(float)val) - 1.)*RLOAD
Error in formula to calc Rzero. Missed minus in power.
src: MQ135.cpp, l:106
float MQ135::getRZero() {
return getResistance() * pow((ATMOCO2/PARA), (1./PARB));
}
MUST be:
float MQ135::getRZero() {
return getResistance() * pow((ATMOCO2/PARA), (-1./PARB));
}
or:
float MQ135::getRZero() {
return getResistance() * pow((PARA/ATMOCO2), (1./PARB));
}
See: http://davidegironi.blogspot.com/2014/01/cheap-co2-meter-using-mq135-sensor-with.html
After quite a while running the sensor (+24hrs) and correcting temp/humidity using the DHT22 I keep getting inf
RZero and CorrectedRZero, while PPM (and correctedPPM) stays at 0.00.
Currently using a CCS811 that reads CO2 at about ~500ppm which seems ok.
If I throw a bit i light gas into the sensor, RZero drops to zero, and then rapidly rises up untill 100k and then infinite, while PPM moves slightly (like 0.1 or 0.5, something like that).
I've already corrected the getResistance formula on my local library, but was wondering if there was anything else I should be doing. Thanks.
Line 25 in a9c0e64
Is Rload not 1kΩ or at least in the range of 20~47kΩ and not 10.0 which is defined in this line?
I thing there is a missing division by 1000 in the function MQ135::getRZero()
The function should look like:
float MQ135::getRZero() {
return getResistance() * pow((ATMOCO2/1000./PARA), (1./PARB));
}
Without this division, you get for RZero match to high values. I got same values by 500 and not by 76. After doing the division by 1000 I got values near 76.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.