Air Quality Sensor
-
@alexsh1 said:
@epierre I started looking at the formula you have used in ppmv calculation. Why do you need ppmv? All values in EPA or Europe are in μg/m3.
because domoticz only knows ppm... and many AIQ like use only that except for particles.
- temp = °C + 273.15
int temp=273.15 + 22;
22C - is a typical temp inside though the intention is to use a sensor
not for me ;-)
- The amended ppmv equation is going to be:
ppmv=(((concentrationPM250.0283168)/100) * ((0.08205temp)/28.97))/1000;
I have not changed 0.0283168 /100 - not sure that this is. And the whole thing is divided by 1000? why?was a volume conversion
The molecular weight is 28.97 for dry air
2.08 mg/m3 is equivalent to 1.74ppm for a gas with molecular weight=28.97 Pressure=1013.25, Temperature=22CSuccess!
success for the mysensors value ?
MySensors: Unknown/Invalid sensor type (43)Domoticz doesn't recognize this command... I use 1.5.x but I have my own gateway to domoticz
- temp = °C + 273.15
-
Which one to use for detection of fire smoke? Currently have got several MQ-7 but they don't seem so good at it
-
Which one to use for detection of fire smoke? Currently have got several MQ-7 but they don't seem so good at it
@moskovskiy82 said:
Which one to use for detection of fire smoke? Currently have got several MQ-7 but they don't seem so good at it
as discussed just above, a particle sensor could be good for smoke is a particle concentration, coupled with heat this would be a good indicator
if (concentration > 315000) { Serial.println("Smokes from cigarettes detected! Or It might be a huge fire! Beware!"); -
What about mq2 or mq135? Any experience? As a gas sensor will be more suitable detecting early fire
-
What about mq2 or mq135? Any experience? As a gas sensor will be more suitable detecting early fire
@moskovskiy82 said:
What about mq2 or mq135? Any experience? As a gas sensor will be more suitable detecting early fire
please see what it does, this is not a gas sensor this only detect particle size whatever the gas...
-
@moskovskiy82 said:
What about mq2 or mq135? Any experience? As a gas sensor will be more suitable detecting early fire
please see what it does, this is not a gas sensor this only detect particle size whatever the gas...
@epierre
It still detects concentration. Both state CO detection. So in case of fire won't they detect the increase in concentration much faster that the particle sensor like Sharp’s GP2Y1010AU0F or alternative? -
@epierre
It still detects concentration. Both state CO detection. So in case of fire won't they detect the increase in concentration much faster that the particle sensor like Sharp’s GP2Y1010AU0F or alternative?@moskovskiy82 For a fire smoke, you can use pretty much any gas or particle sensor - there are a quite few gases formed during the burning process. MQ2 is highly sensitivity and has a fast response time. I can recommend it for a fire detection usage. However, I have been disappointed in MQ* sensors in general - there are not accurate, require 24h heat-up time, consume a lot of power etc. The only advantage is the price.
To detect fire to can use a flame sensor - http://www.instructables.com/id/Flame-detection-using-Arduino-and-flame-sensor/
-
Can someone tell me how to read this line?
float mq135_ro = 10000.0; // this has to be tuned 10K OhmDo I have to messure the sensor and adjust the variable or do I have to tune the resistance? If I have to do the first thing, when do I have to messure it? In warm state and clean air with a multimeter?
-
@epierre Did you check out the airbeam, which is based on a more expensive sensor Shinyei PPD60PV?
http://www.takingspace.org/airbeam-technical-specifications-operation-performance/They made a step-by-step manual about building the same on Shinyei PPD42NS. I took their code and stripped a few parts and this is what I am left with:
#include <SoftwareSerial.h> #include <FlexiTimer2.h> int pin = 3; volatile double rawParticalCount; volatile double totalParticles = 0; volatile double particleCountToDisplay = 0; volatile double ratio = 0; volatile uint16_t timeCounter = 0; #define numberOfPeaksRecording 5 volatile uint32_t previousPeaks[numberOfPeaksRecording]; volatile uint32_t sumOfPreviousPeaks = 0; volatile uint32_t instantGoal = 0; volatile int32_t delta = 0; volatile uint32_t slowMovingAverage = 0; volatile boolean readyToSendData = false; void setup() { Serial.begin(115200); pinMode(pin,INPUT); FlexiTimer2::set(1,1.0/10000,readPin); FlexiTimer2::start(); } void loop() { if(readyToSendData){ Serial.print(rawParticalCount, DEC); Serial.print(" Raw Particle Count (0-10000) "); Serial.print(ratio, DEC); Serial.print(" Ratio (0-100%) "); Serial.print(particleCountToDisplay, DEC); Serial.print(" Particle Count"); Serial.println(""); readyToSendData = false; } } void readPin(){ if(digitalRead(pin) == LOW){ rawParticalCount++; } timeCounter++; if (timeCounter == 10000) { timeCounter=0; //Changes are made here based on Chris Nafis's code: http://www.howmuchsnow.com/arduino/airquality/grovedust/ ratio = rawParticalCount/100.0; //Convert to percentage, the shinyei reads 10milliseconds to 90milliseconds duration for particles. Basing on 10milliseconds, smallest particle assumingly from specification sheet. //FlexiTimer2, reads 10,000 readings per second, which would be 1 reading per 100 microseconds. 100 readings would be 10 milliseconds. Since Shinyei runs at minimal 10 millisecond range. I divided 10,000 readings by 100 to get 100. //Good example would be rawPArticalCount is 5000 half of the 10,000 readings were active. 5000/100 would be 50 which translate to 50% low pulse occupancy. totalParticles = (1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62); rawParticalCount = 0; // shift counters over, code adapted from template provided by Mike Taylor and Joshua Schapiro from Carnegie Mellon University's CREATE Lab for (uint8_t i = 0; i < (numberOfPeaksRecording-1); i++) { previousPeaks[i] = previousPeaks[i+1]; } previousPeaks[numberOfPeaksRecording - 1] = totalParticles; sumOfPreviousPeaks = 0; for (uint8_t i = 0; i < numberOfPeaksRecording; i++) { sumOfPreviousPeaks += previousPeaks[i]; } instantGoal = 2*sumOfPreviousPeaks; delta = instantGoal - slowMovingAverage; if (delta < -5000){ slowMovingAverage = slowMovingAverage - 250; } else if (delta < -2500){ slowMovingAverage = slowMovingAverage - 120; } else if(delta < -1200){ slowMovingAverage = slowMovingAverage - 60; } else if(delta < -500){ slowMovingAverage = slowMovingAverage - 25; } else if(delta < -5){ slowMovingAverage = slowMovingAverage - 5; } else if(delta < -1){ slowMovingAverage = slowMovingAverage - 1; } else if(delta > 5000) { slowMovingAverage = slowMovingAverage + 500; } else if(delta > 2500){ slowMovingAverage = slowMovingAverage + 250; } else if(delta > 1200){ slowMovingAverage = slowMovingAverage + 120; } else if(delta > 500){ slowMovingAverage = slowMovingAverage + 50; } else if(delta > 5){ slowMovingAverage = slowMovingAverage + 5; } else if(delta > 1){ slowMovingAverage = slowMovingAverage + 1; } particleCountToDisplay = slowMovingAverage; readyToSendData = true; } }I have not adopted it for MySensors yet.
I like moving average they use, but the values do not make sense to me:0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 53470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 27.0000000000 Ratio (0-100%) 53970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 54470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 21.6200008392 Ratio (0-100%) 54970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 55470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 24.2800006866 Ratio (0-100%) 55970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 56470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 24.1200008392 Ratio (0-100%) 56970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 57470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 22.3199996948 Ratio (0-100%) 57970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 58470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 20.3600006103 Ratio (0-100%) 58970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 59470.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 17.6299991607 Ratio (0-100%) 59970.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 60220.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 19.0499992370 Ratio (0-100%) 60720.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 0.0000000000 Ratio (0-100%) 60715.0000000000 Particle Count 0.0000000000 Raw Particle Count (0-10000) 20.6599998474 Ratio (0-100%) 61215.0000000000 Particle Count -
@alexsh1 said:
I took their code and stripped a few parts and this is what I am left with:
@alexsh1 the PPDN42 is for 1 micron and 2.5 micron , this one is for 0.5 micron
airbeam has standard code: https://github.com/HabitatMap/AirCastingAndroidClient/blob/master/arduino/aircasting/aircasting_shinyeiPPD42NS.ino
or I've not seen ?
-
@alexsh1 said:
I took their code and stripped a few parts and this is what I am left with:
@alexsh1 the PPDN42 is for 1 micron and 2.5 micron , this one is for 0.5 micron
airbeam has standard code: https://github.com/HabitatMap/AirCastingAndroidClient/blob/master/arduino/aircasting/aircasting_shinyeiPPD42NS.ino
or I've not seen ?
-
Hey guys, I am struggeling to get the MQ135 to work. Is there a step by step howto? Or can someone answer my question from 3 days ago?
I would appreciate it very much. -
Hey guys, I am struggeling to get the MQ135 to work. Is there a step by step howto? Or can someone answer my question from 3 days ago?
I would appreciate it very much.@rollercontainer I followed David Gironi method to calibrate - it is described as follows:
Before you can use the sensor, it has to be calibrated. For this, connect the sensor to your circuit and leave it powered on for 12-24 h to burn it in. Then put it into outside air, preferably at 20°C/35% rel. hum. (humidity is not so crucial). Read out the calibration value as such
float rzero = gasSensor.getRZero();
Wait until the value has somewhat settled (30min-1h). Remember, this is an ADC measurement so you might not want to wait some time between reading the sensor and also do some averaging. Once you have determined your RZero, put it into the MQ135.h. Note: Different sensors will likely have different RZero!#define RZERO 76.63
Congrats, you have calibrated the sensor and can now read the CO2 ppm value in your sketch
float ppm = gasSensor.getPPM();
-
@rollercontainer I followed David Gironi method to calibrate - it is described as follows:
Before you can use the sensor, it has to be calibrated. For this, connect the sensor to your circuit and leave it powered on for 12-24 h to burn it in. Then put it into outside air, preferably at 20°C/35% rel. hum. (humidity is not so crucial). Read out the calibration value as such
float rzero = gasSensor.getRZero();
Wait until the value has somewhat settled (30min-1h). Remember, this is an ADC measurement so you might not want to wait some time between reading the sensor and also do some averaging. Once you have determined your RZero, put it into the MQ135.h. Note: Different sensors will likely have different RZero!#define RZERO 76.63
Congrats, you have calibrated the sensor and can now read the CO2 ppm value in your sketch
float ppm = gasSensor.getPPM();
@alexsh1 Thx
Is "RZERO" the same as "mq135_ro" or is it a seperate variable? (ro = R0 = RZERO?) -
@alexsh1 Thx
Is "RZERO" the same as "mq135_ro" or is it a seperate variable? (ro = R0 = RZERO?)So, obvious these are two variables. Wherefore is the mq135_ro? Is it the load resistor from signal to ground?
-
So, obvious these are two variables. Wherefore is the mq135_ro? Is it the load resistor from signal to ground?
@rollercontainer let's start from the basic - which MQ-135 do you have? A bare unit or with a logic controller and a variable resistor?
-
@rollercontainer let's start from the basic - which MQ-135 do you have? A bare unit or with a logic controller and a variable resistor?
@alexsh1 I bought a breakout board and desoldered everything but the sensor and the 33Ohm resistor for the heating. Then I soldered a 10kOhm pulldown from analog signal out to ground.
-
@alexsh1 Thx
Is "RZERO" the same as "mq135_ro" or is it a seperate variable? (ro = R0 = RZERO?)Apologies for the confusion. @epierre did not use this library, but I have used MQ135.h library, but have not adopted it for MySensors and I did not like the sensor's reading jumping up and down.
In MQ135.h:
// Calibration resistance at atmospheric CO2 level #define RZERO 394.5 //RZERO 76.63I think the principle of RZERO is the same as mq135_ro
-
@alexsh1 I bought a breakout board and desoldered everything but the sensor and the 33Ohm resistor for the heating. Then I soldered a 10kOhm pulldown from analog signal out to ground.
@rollercontainer I have do not done any changes to my breakout board. Just tuning the variable resistor and that's it.
One thing I noticed is that the sensor performs much better in enclosed premises (no windows and no doors). Alternatively, it has to be in the box or something. Any small light draft dramatically changing the readings.
-
@rollercontainer I have do not done any changes to my breakout board. Just tuning the variable resistor and that's it.
One thing I noticed is that the sensor performs much better in enclosed premises (no windows and no doors). Alternatively, it has to be in the box or something. Any small light draft dramatically changing the readings.
@alexsh1 I dont think so, in epierres sketch both values appear:
https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L25
https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L33So, what the heck is mq135_ro? And what to tune to?
