Git Product home page Git Product logo

raspberry-pi-gas-sensor-mq's Introduction

raspberry-pi-gas-sensor-mq's People

Contributors

karensimonyan avatar renatosc avatar tutrpi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raspberry-pi-gas-sensor-mq's Issues

Avoid Calibration

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

:{ x, y, slope}; problem

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

Same program for MQ2 et MQ9 sensors

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).

MQ not reading any voltage.

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)

mq.py setting in MQ-136

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".

Can it use on MG-811?

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?

Possible to add ADS1115 to the code?

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)

Wrong Line Calculation

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])))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.