as I experienced, MQ sensors are not really gaz sensitive, they are more particle size sensitive when hot enough and when not totally scrap.
I would not rely my life on them, if you have an alcool spray use it around and any MQ will to go the sky...
as I experienced, MQ sensors are not really gaz sensitive, they are more particle size sensitive when hot enough and when not totally scrap.
I would not rely my life on them, if you have an alcool spray use it around and any MQ will to go the sky...
intermediary result: I have started a second gateway and now the nodes do communicate... puzzled...
I remove the extra gateway... same situation...
so reprogram gateway with:
#define MY_RF24_PA_LEVEL RF24_PA_LOW
so it seems this was the responsible for this !
thanks !
will try to put it in debug mode. now I've added a 1u and 100u with no result
Hello,
Today I migrated my gateway from 1.5.1 to 2.3.2, tested it fine.
Then I started trying to reprogram my sensors to 2.3.2 and none works. No wiring changed, previously fine working (CO2, DSM dust sensor)
16 MCO:BGN:INIT NODE,CP=RNNNA---,FQ=16,REL=255,VER=2.3.2
26 TSM:INIT
28 TSF:WUR:MS=0
34 TSM:INIT:TSP OK
36 TSF:SID:OK,ID=20
38 TSM:FPAR
41 ?TSF:MSG:SEND,20-20-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
2050 !TSM:FPAR:NO REPLY
2052 TSM:FPAR
2056 ?TSF:MSG:SEND,20-20-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
3899 TSF:MSG:READ,3-3-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
3904 TSF:MSG:BC
4063 !TSM:FPAR:NO REPLY
4065 TSM:FPAR
4069 ?TSF:MSG:SEND,20-20-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
5923 TSF:MSG:READ,3-3-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
5928 TSF:MSG:BC
6076 !TSM:FPAR:NO REPLY
6078 TSM:FPAR
6082 ?TSF:MSG:SEND,20-20-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
7947 TSF:MSG:READ,3-3-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
7952 TSF:MSG:BC
8089 !TSM:FPAR:FAIL
8090 TSM:FAIL:CNT=1
8092 TSM:FAIL:DIS
8094 TSF:TDI:TSL
Hy there, added an AMS1117 regulator board and a 4,7uF and this works agains ! thanks all for your help !
Hello,
my box:
https://photos.app.goo.gl/MQijz9SK8wBMnic47
can AMS1117 be enough or not powerful enough (I have some).
Not US sadly, but amazon has more stock than local providers as it seems, thanks for the hint !
Hello,
I have a basic arduino pro micro and the 3.3V is from the board. All is directly wired on it (arduino to ebyte module with antenna)
I suspect maybe that the 5V may not be that powerfull, I will enquire (I modified something recently...not sure anymore). Usually it is from phone charger. I've seen I have not changed the gain in the radio too, same code for a long time, my whole network is still in 1.6
I've searched for the ld1117d33 (retired) or its clone, seems difficult to find.
Hello,
I have a water counter that requires a value from the gateway.
So the request is received but the answer is never received as it seems.
Both are with a 5V 1A power generator, toward the arduino mini pro, then the 3.3V directly to the module.
I've looked at the datasheet, I've seen nothing about a capacitor ?
Hi All,
I wanted to use Ebyte nRF24L01P Wireless rf Transceiver E01-2G4M27D 27dBm SPI 2.4GHz with a bif antenna: TX2400-JKD-20 3.0dBi Flexible 2.4GHz RF
But it seems an emission issue on the gateway side where I did put it.
It is directly wired to the arduino.
Any idea ?
maybe check what they did here:
https://github.com/airgradienthq/arduino/blob/master/AirGradient.cpp
it you remove plastic it is not water proof anymore, and greyscale was not precise enough....
CNY70 has reflexion protection which is much better
not with mysensors, but could have been: CNY70 water sensor meter (rotating wheel) with extended wifi range, the heart of it is a Particle Photon pushing to domoticz

here is a link with the schematics (so simple !):https://easydomoticz.com/forum/viewtopic.php?f=17&t=1737&start=70
Hello,
I've dropped this approch to use the CNY70 ir on this water meter.
I did that for a friend that has not the mysensors gateway (range issue) so I made it with a Particle Photon using a wifi extender, but it is quite straightforward reading the pulse up and down.
MQ are always a bad choice, saturate air around with any gas and they will react ...
Mics are used by sensely, but even them aren ot calibrated... and they are a hell to get working even when you have the pins soldered to them.
@lukács-attila check wiring first, seems there are several sub version around thay may need other values from datasheet
@ambuj please see the begining of the discussion regarding MQ like reliability
@gohan I would have too much work going to 2.0 on every node I have, but I have to do this as a background task since I'll have to upgrade all my sketches first...
swapping hardware is an option, recabling everything is not my cup of tea 
Hello,
I am trying to get my sensors back, and I have one that goes off the road several time...
board is a uno, with long antennae, mysensors lib is 1.5.
send: 3-3-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=fail:1.5.1
send: 3-3-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=fail:1.5.1
sometime resetting the uno button is enough, other not, and unpowering several times is the only way to make it work. BTW is is less than 1m from the controller.
sometimes, it goes well for 2h, then I have a 'fin parent' message on console and hten everything fail after.
any idea ?
@jumping see just above on power regressin curves, this is the result from a power regression based on the data sheet provided by one maker. Sometime I leave the data points in the sketch, sometime not (based on history 
@jumping you will need to scale down the script obviously, in term of power it will be too short to have more than one.
@bezeefly said:
@epierre I obtained the following equation by polynomial fit the low ratio vs particle (pcs/283ml) graph in the DSM501 datasheet.
concentration = (0.1 * pow(ratio, 2)) + (619 * ratio) + 50;
Please help to check whether the equation is correct.
looks correct for the red curve
using http://www.xuru.org/rt/PR.asp with:
4 2500
8 5000
12 7500
16 10000
20 12500
22 15000
gives =7,613212955POWER(B3;2) + 467,3617082B3 + 631,9862425
a bit better 
and on the previous one datasheet http://www.mouser.com/ds/2/744/Seeed_101020012-838657.pdf:
2 1000
3.9 2000
5.8 3000
7.2 4000
9 5000
10 6000
11.3 7000
12.6 8000
y = 19.09464953 x2 + 383.1041412 x + 174.9189116
@bezeefly said:
Samyoung DSM501A and Shinyei PPD42NS
This is formula for Shinyei, you're right, I'searched back but don't know if a formula was made out : https://groups.google.com/forum/#!topic/airqualityegg/A1F9padoW10
strangely here it is used too : http://learn.linksprite.com/arduino/shields/use-dust-sensor-dsm501-with-arduino/
a formula by Chris Nafis here: https://github.com/OSBSS/Samyoung_Dust_Sensor/blob/master/Samyoung_Dust_Sensor.ino
@AtmosCheme said:
I was going off of the SainSmart website that says the range for their module is 10 ppb to 200 ppm. That would cover 10 ppb to 200,000 ppb.
check their datasheet (or ask for it !)
The values keep dropping down as more and more ozone is added, I'm not thinking it is a problem with range as much as a problem with resolution. I have gone as high as around 50,000 ppb and continue to get response from the sensor.
yes it should be possible but you don't know from the datasheet the value. On a power regression you make an estimation with error, but that may change outside of know datapoints.
Ive thought of using mapping functions in my code as well as resolution functions. But I just wasn't sure if there was a component I could add to the circuit to improve resolution.
some as the Particle Photon has a better ADC that goes up to 4096
@AtmosCheme the datasheet gives the MQ131from 1 to 1000 ppb, so you reach the limit obviously
I had the contact with this seller, but an international money transfer was needed and is expensive...
You're courageous th have gone on kickstarter, from memory seeedstudio nearly went down because of an error on a crowdfunding project and had to produce and ship (the more expensive par of it) a remlacement for the first batches...
@tuimanso said:
@epierre Also, what is the purpose of #define MQ135_MAXRSRO 2.428 //for CO2
#define MQ135_MINRSRO? I don't see them being referenced after they're defined?
Datasheet defines min and max values they should guarantee, this is an application of it.
if(validinterval<MQ135_MAXRSRO && validinterval>MQ135_MINRSRO) {
@alexsh1 said:
@mortommy I'd strongly suggest you go for this sensor. It is expensive, but very-very precise and reliable. You can go for MQ-135 - this is what I did at the beginning. It is utterly useless and can probably be used in enclosed premises, but not in normal houses/flats as its reading are just jumping up and down.
agreed ! that comes with experience !
You can go for the MH-Z19 sensor - it is not much cheaper than MH-Z14 (or MH-Z14A).
it is now $3 difference
@mortommy the €23 is the same I have (I paid $70 at the time...)
@Tore-André-Rosander said:
t=37
I don't know, would it be possible to have someone knowing the difference of the gateway with domoticz for 2.0 ? here it seems correct to me, some value are well seend from the sensor, so it is between the gateway and domoticz for me.
yes, for me he also repaired a board that went dead, premium service !
@Tore-André-Rosander said:
ut nothing in log or the device list when i expose it for gas.
huh you're on which version of mysensors ? have you tried the console (in arduino programmer) to see if there are some readings or a good wiring ?
@alexsh1 well any I would think for they are similar technology
@alexsh1 said:
@epierre said:
the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)
So DOUT is not used. Just AOUT?
yes !
@alexsh1 said:
Also how do you connect it if it comes on the board like this?
http://i.ebayimg.com/00/s/NjAwWDYwMA==/z/vMIAAOxycD9TTOVW/$_1.JPG
easy here, the AOUT is the one you will put on an analog one.
the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)
@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 ?
@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:
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!");
@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
@mareked you could power everything only from the 24V AC as they do !
@mrc-core said:
To test the UV sensor at night you can use a UV light.
does a halogen lamp does this ?
@marekd said:
@m26872
Thanks!
You can squeeze, but I wanted to have more options and not to be limited by memory - anyway at this stage of developing. Because normally you have only one sprinkler controller you can use better uC - I did this way. Playing with more advance programming for memory optimization - is not for me (at this stage of my knowledge) - but thanks for this hint , I might use it in future.I was reading your post about 2AA battery node... this is my let's say next step to make.
on the OsPi hardware, both Arduino/PI (depending on installation) are powered from 24V AC for the sprinkler valves
a quick question as I try to revive a node with UV sensor (a UVM-30A) : is there a simple way to simulate the UV after sundown which is the time I can test it ?
@alexsh1 so mine is CO-MHZ14, no wiring on the 20+ pins, written on it 0~5000ppm
I have this one, but did not have time to test it yet 2-16M : Gravity: Digital Microwave Sensor (Motion Detection)
http://www.dfrobot.com/index.php?route=product/product&product_id=1403#.VzNKlfndWnk
@alexsh1 which is a good idea, also a temp/him is quite usefull though I didn't added the impact in the formulas so far.
Hello,
What have you used on the hardware side ?
The OpenSprinkler project is interresting as it is designed to run on arduino with some interresting logic such as EvapoTranspiration or the "Mr Zimmermann" method.
https://github.com/rayshobby/opensprinkler
It would be interresting to have it running on your domotiz platform and connect the remotes valves through mysensors 
//and maintaining grass is more a problem than a solution, too many time and water wasted on it... (not talking of polluants...)
@mrc-core said:
ML8511
Have you checked the wiring (from https://github.com/sparkfun/ML8511_Breakout/blob/master/firmware/MP8511_Read_Example/MP8511_Read_Example.ino
Connect the following MP8511 breakout board to Arduino:
3.3V = 3.3V
OUT = A0
GND = GND
EN = 3.3V
3.3V = A1
@alexsh1 sorry I don't read chinese, but my datasheet says 2000:
http://www.futurlec.com/Datasheet/Sensor/MH-Z14.pdf
are you using an alternate wiring or alternate version (the A at the end for enhanced or revised ?
@alexsh1 said:
(shinyei ppd42ns)
I corrected the following sketch which had bad yg/m3 to ppm conversion thanks to LouiS22 from Domoticz forum remark (type conversion errors leading to 0 values).
https://github.com/empierre/arduino/blob/master/DustSensor_SamYoung_DSM501.ino
I guess I'll have to do the same here (but I lack time...):
DustSensor_Shinyei_PPD42NS.ino
@mfalkvidd sadly 1960's houses have no floor to cave wiring spaces ;('
@AnneFR by design, it wont, the MQ are $2 value and work n accuracy for this value.
They analyze particles of a certain size, that the maker/wholesaler says he tested it for, but it does not mean it will react only to this one.
I always use the broken perfume bottle that made all my MQ (at that time 3 different running on a mega) peak because my daughter broke in a bathroom a bottle of perfume and the air was saturated with particles.
Make your tests but don't rely on a $2 sensor.
@Samuel235 the ionisation for smoke ensor was the old method with radioactive elements.
maybe a particle sensor but you would need to simulate a smoke to set levels, compared to a dusty room I think. Maybe a barbecue test (beware of greasy dusts !)
@alexsh1 said:
I am going to convert it into MySensors now
you have it here:
https://github.com/empierre/arduino/blob/master/AirQuality-CO2-MH-Z14.ino
@Samuel235 said:
IONISATION METHOD
I'm very tempted to just use a MQ2 sensor with its circuit on my board rather than a separate board.
MQ2 consumes a lot of energy as every MQ. Also don't rely on your life on this kind of sensors...
Have you tried the bottle of perfume around ?
@hek said:
The NRF doesn't provide any RSSI value unfortunately.
this is what somehow I thought of, is there a possibility to have a mysensors over HTTP ?
maybe something like this in the next room... or have a pi receiving the data ?
http://www.tp-link.fr/products/details/TL-WR702N.html
no idea how to handle that for the Z-wave...
Hello,
I have a room where z-wave used to work... but not anymore, that is also blind to nrf24l01+ .
Has anyone some idea how to test reception / signal strength so I can find a way out (so bad it is in the same room as my gas and electricity meter...)
well he offres also great service ! and so far it is the best board I have that goes through witer without a glitch !
@alexsh1 said:
@epierre I wonder if you looked at this sensor Figaro TGS8100:
http://www.figarosensor.com/products/entry/tgs8100.html
Looks like it is perfect for a low-powered platform.
as a replacement for MQ in low power yes could be... the bad part is how to get one ?
@micah said:
Alarm clock (with remote access, personalized wake-up midi songs, manual and auto snooze i.e.: if you don't get out of bed it rings again)
Wake-up light
MH-Z14 is working fdine for me over 2 years... no fault, always good values out of it, I can only recomment it 
@Elfnoir said:
; need to move it to another place in the room, and works perfectly now
temp/hum are "less" sensitive on environment, here the sensors heats up to 40-60° (or more) so temp/hum is not the most impacting (I can be wrong anyway 
@alexsh1 hard to say, could be something moving inside if someone makes vibration around and thus this strange reaction... the down curve at the end is correct, the in between not
there must be something out, spectographic mass analysis was the way, reflectivity for the fields, but in air this must be some particle siez for the MQ like so I'd rather say clever manufacturing and calibration
Hello,
I did made one in perl for my experiments:
https://github.com/empierre/domoticz/blob/master/mysensors-gw1.4.pl
If you are interested in having an interface to Imperihome, or just for continuous test/delivery/packaging for all PI and more on node JS, I can help (this is the project taking me time at the moment, full rewrite from perl to node js of an app used by more than 100 people):
@alexsh1 said:
@epierre do you think it is a faulty sensor though?
coud be, hard to know without possibility to compare to another one.
@tantt2810 said:
Hello,
Can I use pinMode(digitalpin, OUTPUT) to turn off sensor? Or Is there any way to wirte a function that turn off sensor?
I want to remote it on web to turn on or off it.
Thank you so much !!!
well no, powering is through Vcc/GND, so you whould use a switch on this. Digital pins do not gives enough power for such sensors.
Some times ago, there was a constructor for the Mega that could change the pin allocation to use it:
MySensor gw(48,49);
But it doesn't seems possible anymore, and the only other wway around found is this one:
MyConfig.h
@hek is that correct ? if not, would it be possible that information be available in the "wiring" section ?
thanks,
sound based sensor is complicated...
you would need to calibrate the mic to have it sensible enough
you would have to fo FFT (hard to do in an arduino) to get the sound mesure
@ceech what did you use for soldering, I cannot see it myself (sure I have a lot to learn for SMD soldering...
@alexsh1 said:
This is a value gw.send(msg.set(MQ135_DEFAULTPPM+(int)ceil(valAIQ))) reported to Domoticz.
It does not make any sense to me at all.
same for mle, sometime it is good to have two piece to compare their behavior... I have 3 o them ...
is your R0 in Ohm or KOhm in your formula ?
@alexsh1 is that raw ADC output or with a calculation ? normaly this should go up or down but not in sucha drastic way
@tantt2810 said:
@epierre
Thank you. Your mean is Vcc->5V, GND->GND, Dout->Digital pin, Aout->Analog pin. Is it right?
But I don't know the tcm pin connect with ? I have read datasheet but I don't find any info about tcm pin. Please help me. Thank you so much !!!
do not use the digital pin !!! it only reacts with the potentiometer in on/off mode, so useless... you need to power the device with Vcc/Gnd, and read the output with Aout (A stands for analog). The last one forget it.
@wreiner said:
Th function MQCalibration should calibrate the sensor in clean air, the calibration function uses the PPM concentration of the gas in a clean air environment.
You already use the appropriate value for i.e. CO2 (around 399 PPM) in the MQ135 sketch - but why are you using those obscure values in the calibration (1, 10) here?
Well, I didn't know the concentration in clean air so I had to put in a value even random... I took the hypothesis there are very few in the air so low value.
hello,
Thanks for reporting, I will check again here, for I never really successfully managed to have this one working.
Beside this, the two others (cheaper but good anyway !) are working fine, see my repo here:
https://github.com/empierre/arduino
@moskovskiy82 well looks like a strange sensor... try averaging several samples/// always remember to have it running several days before measuring for there are chemical left from china factories...
I was a bit disappointed when a project I contributed to on Kickstarter showed the inside of their boxes, I wonder how they will manage to satisfy customers with calibration... or their home made index as netatmo did

@tantt2810 sorry for not being more responsive, I left MQ/TGS behind me but I've not kept all my notes on mesuring this and that, that would require me to search for it again. But I appreciate if you can spot me some float/type error conversion in sketches !
@tantt2810 said:
Hi everyone,
I have an CO2 MG811 sensor. I don't know where tcm pin connect with ?
Please help me. Thank you so much !!!!
this is an analogic sensor, so VCC/Gnd to power it, and readings on analogic Aout
@tantt2810 said:
Hello,
I'm don't understand the recipe below. Why RL_Value(Load Resistance)(1023-raw_adc)/raw_adc)? Can you explain for me?
Thank you so much !!!
Input: raw_adc - raw value read from adc, which represents the voltage
Output: the calculated sensor resistance
Remarks: The sensor and the load resistor forms a voltage divider. Given the voltage
across the load resistor and its resistance, the resistance of the sensor
could be derived.
float MQ2::MQResistanceCalculation(int raw_adc)
RL_VALUE(1023-raw_adc)/raw_adc));
in fact it is above described, you have a voltage, you want a resistance.
https://learn.sparkfun.com/tutorials/voltage-dividers
datasheet needs a value which is the Rs/Ro (called here RL) where
Ro: sensor resistance at 100ppm of NH3 in the clean air.
Rs:sensor resistance at various concentrations of gases
here the formula is a simplification of this:
float Vrl = val * ( 5.00 / 1024.0 ); // V
float Rs = 20000 * ( 5.00 - Vrl) / Vrl ; // Ohm
int ratio = Rs/Ro;
ppm = 37143 * pow (ratio, -3.178);
@jenbaker said:
sorry i am a little confused by with these new formulate.
is it the key for module?
if you have a module the datasheet gives you the values, yes. Remember this is their """""generic"""" calibration, in fact they all copy the other so don't expect your MQ** would follow this by the letter...
@tantt2810 as explained above, if the datasheet has a logarithmic scale, you can use the power regression to approximate the curve. One tool for example to do this calculus:http://www.xuru.org/rt/powr.asp
for a sensor discussed above I read this on the datasheet:
H2
1.3 50
0.8 100
0.28 400
0.16 1000
0.05 4000
The xuru website gives me this:
y = 73.59123879 x-1.355617483
Residual Sum of Squares: rss = 87393.44418
and thus I have::
H2Curve[3] = {73.5912, -1.355617};
@ceech said:
had to replace the battery management IC. The LTC4067. The output was fried. I also replaced the voltage regulator while I was at it.
@ceech thanks a lot, any idea why this would happen ?
what kind of bluetooth module are you using ? I've managed nothing good with the HC-05, maybe faulty hard to know.
@ceech actually the Particle Photon is doing less well than yours: https://thingspeak.com/channels/88622
@ceech should I put the power on Vin / Gnd as I guess ?
I have started graphing the solar / lipo one here:
https://thingspeak.com/channels/89944
for me it has impact on the accuracy of readings... if we can speak of accuracy on MQ series sensors...
be carefull about power pikes surge when powering up such lights...
For me a PI and a camera is expensive and overkill ... you'll get about €50+energy running a PI where a water meter with impulse will only require some plumbing and an arduino...
well it is a simple URL call with field1 to 8...
http://api.thingspeak.com/update?key=API_KEY&field1=
Xively was much more fun with more possibilities... I publish from Particle Photons directly to it, looks a correct way, a bit antique, mostly limited to 8 fields
looks like I have to rework something... but not in the todo list right now... Imperihome is now back on top, and Particle on lipo/solar also...
@Keifru said:
Re Weather: I had not thought of having something to measure lux inbuilt on, but as the inside of the vivarium [...]
Be carefull on how much energy will go through those relays, I do not see it on the page.
For leds, I don' know for sure, I have only an aquarium well planted, but quantity of light is critical to some plants, so be careful on this but you may already know.

@Keifru said:
heating/lighting/rain/weather/seasonal
Hello,
I don't know the subject but mysensors+rpi2 should be the best choice in your case.
heating/lighting: this is on/off, no variator I guess ? light can be RGB
rain: rain gauge or open/close watering (which is on/off)
weather: Temp, Hum, Lux maybe
seasonal: by programming your season's parameter
@supersjimmie said:
Vlr is the value of 'val', which is: uint16_t val = ((float)22000*(1023-valr)/valr);
yes and this is why I did rewrite it to https://github.com/empierre/arduino/blob/master/AirQuality-Multiple_Gas_Sensor1_4.ino but did not updated this one...
yes for the code must be updated, the value is the CO2 (or something else) detected above the 399 in atmosphere
gw.send(msg.set(MQ135_DEFAULTPPM+(int)ceil(valAIQ)));
@supersjimmie replace MQ135_DEFAULTRO by your value 20875 in the sketch