Tutorial (german): https://tutorials-raspberrypi.de/raspberry-pi-gas-sensor-mq2-konfigurieren-und-auslesen
Tutorial (english): https://tutorials-raspberrypi.com/configure-and-read-out-the-raspberry-pi-gas-sensor-mq-x
Raspberry Pi Library for several MQ Gas Sensors (MQ-2, MQ-3, etc.)
Hello,
Is it possible to not process the calibration each time I started the script ?
I would like to use it with munin. So I do only one calibration.
Thanks
Hi, may i know how you able to get this value data format:{ x, y, slope}; point1: (lg200, 0.21), point2: (lg10000, -0.59) . FYI, the -0.59 value cannot be found on the datasheet and does not form the curve with the LPG gas
Hello,
Is it the same program for MQ2 and MQ9 sensors ?
I am using both on my Rpi with MCP3008 and I change the channel (0 for MQ2 and 1 for MQ9).
Aborts immediately after run. Pulled "mq = MQ()" outside of the try statement to see what was going on. Got the following error. The GPIO pins are reading voltage, but whatever's going inside of MCP3008, it returns zero.
Traceback (most recent call last):
File "example2.py", line 4, in
mq = MQ()
File "/home/pi/Desktop/CO_sensor/Raspberry-Pi-Gas-Sensor-MQ/mq.py", line 48, in init
self.Ro = self.MQCalibration(self.MQ_PIN)
File "/home/pi/Desktop/CO_sensor/Raspberry-Pi-Gas-Sensor-MQ/mq.py", line 84, in MQCalibration
val += self.MQResistanceCalculation(self.adc.read(mq_pin))
File "/home/pi/Desktop/CO_sensor/Raspberry-Pi-Gas-Sensor-MQ/mq.py", line 69, in MQResistanceCalculation
return float(self.RL_VALUE*(1023.0-raw_adc)/float(raw_adc));
ZeroDivisionError: float division by zero
Hardware: Raspberry Pi Zero, MQ-2, MCP3008 (20307)
I'm trying to modify the mq.py settings for this sensor:
http://www.sensorica.ru/pdf/MQ-136.pdf
But I don't understand how to find this value:
RO_CLEAN_AIR_FACTOR.
I setted this value to 1.5
After I calculated this Curve:
self.H2SCurve = [1,0.176,-0.306]
But when I execute the example.py after calibrating it send me the Ro and exit with "Abort by user".
code gets abort after 1st print.
I try to change MQ-135 to MG-811 on board. When i used MQ-135, the data is appear. But when i change to MG-811, the data is gone. Can you explained it?
Hi,
I don't have the MCP3008 laying around and want to use the ads1115 ADC.
But I don't have any clue how to add this in the code?
Would this be possible to add this to the code (commented ofcourse)
Hi,
I realized that there is a little mistake on the code. In python math.log() takes log on base 2, not on base 10. math.log10() should be used for log based on 10.
def MQGetPercentage(self, rs_ro_ratio, pcurve):
return (math.pow(10,( ((math.log(rs_ro_ratio)-pcurve[1])/ pcurve[2]) + pcurve[0])))
Therefore the code above should be updated as like the below.
def MQGetPercentage(self, rs_ro_ratio, pcurve):
return (math.pow(10,( ((math.log10(rs_ro_ratio)-pcurve[1])/ pcurve[2]) + pcurve[0])))
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.