MH-Z19 offset and scale differences!?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

MH-Z19 offset and scale differences!?

#1 Post by chunter1 » 04 Nov 2017, 10:15

I got two MH-Z19 with the latest ESPEasy version running side by side.
One sensor is the "old" version, the other the "new".
Comparing both measurements show that the new version has a significant higher value than the old one. (see attachment)
What may be the cause for the offset and scaling difference and which senor shows the correct values?
Attachments
co2_comparison.png
co2_comparison.png (26.96 KiB) Viewed 7769 times

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#2 Post by TD-er » 04 Nov 2017, 11:04

Most likely, the sensor with the lowest value has had Auto Baseline Calibration (ABC) enabled, which is the default.
If you're running dev-12, I would suggest to disable ABC as soon as possible (within 24h of operation after first usage)
Then you keep the factory calibration active.

In short, ABC does remember the lowest recorded value in the last 24h and then uses that as new 400 ppm baseline.
You can 'restore' the old sensor by leaving ABC enabled (default value in ESP easy dev-12) and during the day do a lot of ventilation in that room. Then it will restore to a correct baseline. Only thing is, in a city you will probably never reach 400ppm, but something around 600-700 ppm.
Thus performing a baseline calibration in such atmosphere will lower the displayed values by about 200 - 300 ppm. (700ppm will then be considered as 400)
That difference will increase for higher concentrations of CO2.

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#3 Post by chunter1 » 04 Nov 2017, 12:08

I will set both sensors to ABC enabled and let them sit outside for at least 24h to see if both output the same results afterwards.
However i am a bit confused that both sensors reach the 400 ppm but after that they scale differently - not just offset but SCALE !?

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#4 Post by TD-er » 04 Nov 2017, 19:53

If the new sensor has not been running for 24h yet, I would suggest to disable ABC. Then you are using the factory calibration.

And running outside is not the best way to reset the baseline.
Internally the sensor stores its calibration value along with the temperature. Perhaps to compensate for something like humidity.

The sensor will not output any value lower than 400 ppm (+/-a few ppm) So all sensors will eventually read 400 ppm, even when you are running them in a very bad ventilated room with some gas burners inside. If ABC is enabled, it will use the lowest reading in 24h and regard that as 400 ppm.

So when still an option, disable ABC on the new sensor so you have at least one reading proper values.

And about the scale, that's also perfectly explainable.
As an example, consider the internal raw sensor value of 100 as "0" ppm.
The factory calibration exposed the sensor to 400ppm CO2 concentration and that gives raw value of "200".
Now you are reading "300" as raw value, which will output 800 ppm, because it is about 100 raw value increase per 400 ppm.

With ABC enabled and bad ventilation, the sensor considers the lowest measured raw value of "300" as the new 400 ppm.
So the sensor considers "200" raw points as 400 ppm.

At some room concentration, both sensors with factory calibration and your other sensor with ABC enabled, both have "400" as raw reading. How would they output the value in ppm?
The factory calibrated one will use 100 per 400 ppm and the other will use 200 per 400 ppm. Both have the "zero calibration level" at a raw value of 100.
So the first one outputs (400 - 100)/100 * 400 ppm + 400 ppm = 1600 ppm. The one with ABC enabled will show (400 - 100)/200 * 400 ppm + 400 ppm = 1000 ppm

It is like a line through 2 points, the 0ppm CO2 point and the 400 ppm CO2 point. That will explain the offset scale, not constant offset.
Last edited by TD-er on 04 Nov 2017, 20:04, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3325
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MH-Z19 offset and scale differences!?

#5 Post by grovkillen » 04 Nov 2017, 20:01

The ABC of the MH-Z19 is pretty weak. Only taking the last 24 hours into account. The S8 and it's siblings have a 3 week sampling period and only adjust a possible offset with a fraction of the difference. This makes it less influenced if it is used residential (i.e. people occupying the house more on weekends compared to offices etc.).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#6 Post by chunter1 » 05 Nov 2017, 09:56

Almost 24 hours passed since power up and placement outdoors.
Am curiouse if calibration sets both sensors to the same level.
Otherwise i am not sure what they are good for (except for making money).
Attachments
CO2_diag.png
CO2_diag.png (20.32 KiB) Viewed 7724 times

User avatar
grovkillen
Core team member
Posts: 3325
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MH-Z19 offset and scale differences!?

#7 Post by grovkillen » 05 Nov 2017, 10:34

They are good enough for use in a room with good ventilation and occupation less than half that time (or at least enough time for the ventilation to purge the room).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Shardan
Normal user
Posts: 1122
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: MH-Z19 offset and scale differences!?

#8 Post by Shardan » 05 Nov 2017, 12:41

All sensors more or less deviate. In fact there is no "perfect" sensor, tolerances occur for a lot of reasons.
See https://www.letscontrolit.com/wiki/inde ... d_Accuracy for some info about tolerances and calibration.

The MH-z19 is a somewhat cheap sensor (below 20 EUR at Aliexpress).
On top these sensors from china often are remakes done only with price in mind.
There is a reason why good CO2-sensors are much more expensive.

It's the same with dust sensors. The cheap GP2Y10 is good enough to drive an air cleaner
but don't expect reliable "µg/m³" values - the result will be disappointing.
Even the more expensive laser based "PMSx003" or "SDS011" sensors are still cheap sensors
giving remarkable deviations.

There's a reason why reliable and calibrated measuring devices are very expensive.
Even these have tolerances, just lower ones.

Regards
Shardan
Regards
Shardan

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#9 Post by chunter1 » 05 Nov 2017, 14:34

After 24h outdoors, both sensors have run a calibration cycle (see attachment).
The sensors differ by approx. 38 ppm (452 vs. 414 ppm).
Next, i will test if their values scale equally inside the house.
Attachments
CO2_diag_24h_cal.png
CO2_diag_24h_cal.png (17.78 KiB) Viewed 7705 times

User avatar
grovkillen
Core team member
Posts: 3325
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MH-Z19 offset and scale differences!?

#10 Post by grovkillen » 05 Nov 2017, 15:01

38 ppm equals 38 molecules out of 1 000 000 which is 0,0038% difference. So it's ok for that price tag.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#11 Post by chunter1 » 05 Nov 2017, 15:21

After 30 minutes inside the house, both sensors start to settle.
The Version B at 832 ppm, the old Version at 615 ppm.
OUCH! :( :(
I wonder if they did care a lot (or better... at all) calibrating the SCALE correctly at production?

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#12 Post by TD-er » 05 Nov 2017, 15:36

You should set the 400 base calibration in the same environment, as you normally use.
Currently outside is humidity and temperature different from inside use. This will have impact on both sensors and both differently.

You can let both sensors perform an automatic base calibration, but then please use the same interval. So power-up both at the same time (not reboot, power disconnect/connect) and let them run for several days inside the home.

Please do not use the "perform base calibration" command via the URL too frequently. I managed to kill one sensor by running it multiple times within seconds.
And only run that command with the sensor positioned in the room with proper ventilation (and no people/animals around).

Shardan
Normal user
Posts: 1122
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: MH-Z19 offset and scale differences!?

#13 Post by Shardan » 05 Nov 2017, 15:41

chunter1 wrote:
05 Nov 2017, 15:21
I wonder if they did care a lot (or better... at all) calibrating the SCALE correctly at production?
Easy answer: Calibrating is expensive - these sensors are cheap.

The genuine MH-z19 and 19B made by Winsen have a tolerance of +/- (50ppm + 3% of the reading value).
( Datasheet: http://www.winsen-sensor.com/d/files/in ... ver1_0.pdf see page 4 ).
So a deviation up to +/- 58 ppm per sensor at 600 ppm reading is normal.

With two sensors compared you will have to expect tolerances up to about 120 ppm in that case.

As almost all MH-Z i found on AliExpress are remakes produced only with price in mind - what can you expect?
The only thing i'd expect is even more tolerance.
Regards
Shardan

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#14 Post by chunter1 » 05 Nov 2017, 16:04

Shardan wrote:
05 Nov 2017, 15:41
The genuine MH-z19 and 19B made by Winsen have a tolerance of +/- (50ppm + 3% of the reading value).
So a deviation up to +/- 58 ppm per sensor at 600 ppm reading is normal.
You mean +/- 68 ppm.
With two sensors compared you will have to expect tolerances up to about 120 ppm in that case.
You mean up to 136 ppm.
As mentioned before, they differ by approx. 217 ppm which is almost twize the worst case range, advertised in the DS.
And statistically it's very unlikely that one sensor outputs the full negative tolerance at the same time the other sensor outputs the full positive tolerance range. ;)
So, yet another chinese temperature/humidity/any gas/any light/any supply voltage and so on by far overpriced random number generator ""sensor"".
Unreliable sensors are crap.

Shardan
Normal user
Posts: 1122
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: MH-Z19 offset and scale differences!?

#15 Post by Shardan » 05 Nov 2017, 16:45

Yep 68, sry... i need more coffee :oops:

Well, depends on the purpose you use them for. For ventilation control they are sufficient.
But no one should expect the accuracy of a 800 EUR meter from a 16 EUR copy of a cheap sensor,
that's expecting too much.

Anyways, for home control a cheap sensor will do. Usually fans and ventilation are switched
or you get a "Open the Windows" signal at a given threshhold, these sensors do that job.

If you want exact metering you will have to pay really much more.
It needs some exact calibrating - and calibrating to an accuracy of 1% needs a calibration source
(another meter for example) of at least 0,1% accuracy! Such meters cost a fortune and that's why
I doubt the super cheap remakes are really good calibrated. An industrial production of calibrated sensors
needs a climate chamber with exactly controlled conditions.
I don't think you'll find that at the small remake production sites in asia.
Regards
Shardan

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#16 Post by TD-er » 05 Nov 2017, 20:27

It is remarkably cheap to create some specified CO2 conditions using chemicals. (given you do it for batches of sensors at once)

But the problem being faced here is that the MH-Z19 sensor's baseline calibration will be affected by several parameters like temperature and humidity.
Also the automatic base calibration seems to update only partially. It takes several days to reach the same level as the new sensor.

You can run the manual set base calibration command in ESPeasy at the moment the sensor value is at its lowest point. (e.g. good ventilation, without people/animals present)
That will set the current value to resemble 400 ppm. But please make sure you do not re-run that command within a short interval (e.g. within several seconds) or else you will reset the 0 ppm point.

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#17 Post by chunter1 » 08 Nov 2017, 10:04

TD-er wrote:
05 Nov 2017, 15:36
Please do not use the "perform base calibration" command via the URL too frequently.
I did not know about that possibility yet.
Can you give an example how to do it please?
EDIT:
Found it myself.. calling "http://x.x.x.x/control?cmd=mhzCmdCalibrateZero" does the trick.

I did a test over night comparing a MH-Z19, MH-Z19B and a Netatmo CO2 sensor.
The MH-Z19B and the Netatmo correlate quite well, whereas the (old) MH-Z19 shows a negative offset although both MH-Z19 versions gone through ABC 3 times now with CO2 levels below 400 in between.
Attachments
cocomp.png
cocomp.png (14.71 KiB) Viewed 7631 times

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#18 Post by TD-er » 09 Nov 2017, 13:46

What voltage are you using for the sensors? 3.3V or 5V?
I know the MH-Z19 takes more time to performs the measurement when using a lower voltage.
Perhaps this voltage-/timedifference also affects the accuracy?

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#19 Post by chunter1 » 10 Nov 2017, 08:30

TD-er wrote:
09 Nov 2017, 13:46
What voltage are you using for the sensors? 3.3V or 5V?
Both sensors run on clean, LDO stabilized 5V.
3.3V would not be possible anyway since the MH-Z19 needs at least 3.6V and the MH-Z19B 4.5V.

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#20 Post by TD-er » 10 Nov 2017, 10:56

chunter1 wrote:
10 Nov 2017, 08:30
[...]
3.3V would not be possible anyway since the MH-Z19 needs at least 3.6V and the MH-Z19B 4.5V.
They do work at 3.3V, but as I said, no idea about the impact on accuracy.

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#21 Post by chunter1 » 10 Nov 2017, 13:20

TD-er wrote:
10 Nov 2017, 10:56
chunter1 wrote:
10 Nov 2017, 08:30
[...]
3.3V would not be possible anyway since the MH-Z19 needs at least 3.6V and the MH-Z19B 4.5V.
They do work at 3.3V, but as I said, no idea about the impact on accuracy.
Ignoring the minimum supply voltages specified in the datasheets is simply no good idea. ;-)

Shardan
Normal user
Posts: 1122
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: MH-Z19 offset and scale differences!?

#22 Post by Shardan » 10 Nov 2017, 14:15

chunter1 wrote:
10 Nov 2017, 13:20
TD-er wrote:
10 Nov 2017, 10:56
chunter1 wrote:
10 Nov 2017, 08:30
[...]
3.3V would not be possible anyway since the MH-Z19 needs at least 3.6V and the MH-Z19B 4.5V.
They do work at 3.3V, but as I said, no idea about the impact on accuracy.
Ignoring the minimum supply voltages specified in the datasheets is simply no good idea. ;-)
Agree.
The "3,6V" on many sensors, not only the MH-Z19 have a certain reason:
These sensrs use an internal CPU running on 3.3V. This 3,3V are provided from a voltage regulator,
LM1700, AM1117-3.3 or whatever similar is in the garbage bag of the manufacturer.

These regulators need a bit of voltage for themselves to work correctly, the so called drop-out voltage.

If you feed the circuit below recommended minimum voltage, the onboard regulator simply can't do his job,
delivering constant voltage to CPU and the sensor itself.

Even if the sensor is still running i won't trust any readings from that sensor.
Regards
Shardan

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: MH-Z19 offset and scale differences!?

#23 Post by chunter1 » 18 Dec 2017, 10:22

In the past few weeks, i had the opportunity to test several different CO2 sensors side by side.
Each sensor (except the netatmo ofcourse) was connected to it's own ESP8266, all running the same ESPEasy firmware.
The power-supplies used were also of same type.

Sensors unter test:
- MH-Z19 (old version)
- MH-Z19B
- Senseair S8
- Netatmo

Results:
From the observation of the CO2"-curves over time, i come to the following conclusion:
a) The Netatmo and the Senseair S8 Sensor correlated very well over time.
Curves were quite smooth without significant correction-jumps.
Measurements seem to be the most trustworth and comprehensible.
b) Compared to the Natatmo and Sensair S8, the MH-Z19B measurements also correlate quite well over several hours.
However auto calibration sometimes kicks in radically resulting in large jumps and constant offsets.
Though, ventilating the room more often helps bringing the sensor back to plausible measurements after a while, it's not that reliable.
In my oppinion, the Netatmo and Senseair S8 show a more advanced auto-calibration implementation.
c) The old MH-Z19 version almost always measured too low CO2 values (compared to the Netatmo).
Very seldomly a kind of base-line calibration was observed that raised the curve - however never that high to really correlate with the others.

Find attached a diagram that shows the "most observed relation" of the sensor measurements.
Please ignore the curve named "Senseair" since that sensor was somewhat misconfigured!!

To come to a conclusion, my personal choice is absolute clearly the Senseair S8 because of it's good measurement continouity and flawless automatic baseline calibration.
There is nothing worse than having a sensor that you can not rely on.
However, if you REALLY can accept part-time offsets and jumps, then the MH-Z19B sensor is "ok" for it's price.
Attachments
co2_sensor_camparison.png
co2_sensor_camparison.png (45.75 KiB) Viewed 9748 times

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#24 Post by TD-er » 18 Dec 2017, 16:08

If you run the latest version, you can disable the automatic base calibration of the MH-Z19.
In the Mega branch, you can even use the "unstable" measurements if you like (or need to due to unstable air)

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#25 Post by batal131 » 20 Dec 2017, 08:33

Happy to find this forum and this topic :)

Already ordered few S8, but also have pair of MH-Z19 and pair of MH-Z19B.

And my own tests are pretty the same as chunter1's! (for comparing 19 and 19B).

MH-Z19 always shows ppm in about 200 less then MH-Z19B. Even after few days in well ventilated room.

My plans currently (while waiting for S8) is to play with disabling ABC (with manual calibration) and again compare 4 sensors that I have ( I know that old MH-Z19 is crap).

(currently my both MH-Z19B not working properly on dev12, so I need to compile my own firmware from sources or wait for dev13)

User avatar
grovkillen
Core team member
Posts: 3325
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MH-Z19 offset and scale differences!?

#26 Post by grovkillen » 20 Dec 2017, 08:59

batal131 wrote:
20 Dec 2017, 08:33
Happy to find this forum and this topic :)

Already ordered few S8, but also have pair of MH-Z19 and pair of MH-Z19B.

And my own tests are pretty the same as chunter1's! (for comparing 19 and 19B).

MH-Z19 always shows ppm in about 200 less then MH-Z19B. Even after few days in well ventilated room.

My plans currently (while waiting for S8) is to play with disabling ABC (with manual calibration) and again compare 4 sensors that I have ( I know that old MH-Z19 is crap).

(currently my both MH-Z19B not working properly on dev12, so I need to compile my own firmware from sources or wait for dev13)
Welcome and I would love to see some graphs comparing the sensors side by side (like chunter1 did).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#27 Post by batal131 » 05 Jan 2018, 09:20

Image

Here is my tests of 4 sensors:
MH-Z19B (named with ABC)
MH-Z19B with ABC turned off
MH-Z19 (named with ABC)
MH-Z19 with ABC turned off (I know that there is nothing about ABC in MH-Z19 datasheet, but I've tried to turn it off)

All 4 sesnosrs installed on one breadboard (and its about 2cm between each of them). All powered from the same source. All transmitting data with similar Wemos D1 mini.
Tests performed for 2 weeks (MH-Z19B datasheet says that ABC period is 1 day)

Some thoughts:
1) ABC does nothing in my environment (living room). Completely no difference for MH-Z19B with ABC and without ABC.
2) MH-Z19 always shows less PPM than MH-Z19B. Sometimes difference is very big (about 400-500ppm).
3) ABC (MH-Z19B only):
When ABC is turned on, "U" continuously increases from 0 to about 37 000 when its self-calibrating (24h ABC period).
When ABC is turned of, "U" always 0.
4) Internal temperature difference between MH-Z19 and "B" is about 6 degrees (Celsius). MH-19B heats more because of higher measurement frequency (in about 2 times as I can see on red blinking)
5) Boards with MH-Z19B has some problems with stability. They restarts in maximum 30 minutes (usually uptime is only 4-5 minutes). Boards with MH-Z19 does not have this problem and uptime is few days. With S8 I'll try to replace all boards to see if this helps. And I'll try to configure Syslog server to investigate this.

Sensair S8 arrives in few days. I'll replace one of MH-Z19 with it and continue testing.

BTW, does anyone knows, is it possible to connect multiple CO2 sensors to the one Wemos?
Attachments
co2.png
co2.png (76.42 KiB) Viewed 9582 times

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#28 Post by TD-er » 06 Jan 2018, 12:46

batal131 wrote:
05 Jan 2018, 09:20
[...]
Some thoughts:
1) ABC does nothing in my environment (living room). Completely no difference for MH-Z19B with ABC and without ABC.
2) MH-Z19 always shows less PPM than MH-Z19B. Sometimes difference is very big (about 400-500ppm).
3) ABC (MH-Z19B only):
When ABC is turned on, "U" continuously increases from 0 to about 37 000 when its self-calibrating (24h ABC period).
When ABC is turned of, "U" always 0.
4) Internal temperature difference between MH-Z19 and "B" is about 6 degrees (Celsius). MH-19B heats more because of higher measurement frequency (in about 2 times as I can see on red blinking)
5) Boards with MH-Z19B has some problems with stability. They restarts in maximum 30 minutes (usually uptime is only 4-5 minutes). Boards with MH-Z19 does not have this problem and uptime is few days. With S8 I'll try to replace all boards to see if this helps. And I'll try to configure Syslog server to investigate this.

Sensair S8 arrives in few days. I'll replace one of MH-Z19 with it and continue testing.

BTW, does anyone knows, is it possible to connect multiple CO2 sensors to the one Wemos?
Can you also write down what color in the graph what sensor is?
About your last question. You can only add more than one when using different pins.
The MHZ19 plugin uses the SoftSerial code, which allows multiple instances to be used.
In the last Mega code, I changed it to max. 3 simultaneous instances on the same device. Because you simply do not have more pins to use Rx and Tx on an ESP8266 and it will reduce the amount of cache ram used. (which is really sparse)

Also make sure your power supply is sufficient. These sensors may peak during a measurement. If all sensors peak at the same time, the voltage may drop due to resistance in the power cables, or even because the power supply may not deliver.
One sensor may peak up to 150 mA if I'm correct. So 4 sensors may peak up to 600 mA.
Also these sensors really should run on 5V, not 3.3V.
I have several of these sensors here and they almost never reset themselves.
Perhaps you should add some capacitors over the Vcc lines of the sensors.

If the sensor reboots, it may affect the ABC functionality.
The U value is believed to reflect the raw internal value reflecting the lowest concentration recorded in the last 24h. The sensor will consider this then as the new 400 ppm point.
So if you did not ventilate enough, the lowest recorded concentration may actually be way above 400 ppm and thus the displayed value will be too low and may show hours of 400 ppm recorded values.

Do you also have the values stored in some kind of CSV? Then you can create a scatter plot in Excel.
I did this for S8, MHZ19A and MHz19B (only very short interval of 22 hours):
Image
Horizontal axis shows the ppm values of the S8 sensor (considered to be the "truth", since I just opened the package of the sensor and it had still factory calibration)
Vertical is the concentration of all 3 sensors at the same time.
So then you can see if the sensors agree (for example the S8 agrees very well with itself ;) ) on a given concentration.
If one may react faster or slower, the average should still be the same.

Edit:
One not to myself; I may have swapped the data from the A and the B sensor, since the A never gets below 400 ppm and the B version may give a bit lower values.

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#29 Post by batal131 » 09 Jan 2018, 09:00

TD-er wrote:
06 Jan 2018, 12:46
Can you also write down what color in the graph what sensor is?
About your last question. You can only add more than one when using different pins.
The MHZ19 plugin uses the SoftSerial code, which allows multiple instances to be used.
In the last Mega code, I changed it to max. 3 simultaneous instances on the same device. Because you simply do not have more pins to use Rx and Tx on an ESP8266 and it will reduce the amount of cache ram used. (which is really sparse)

Also make sure your power supply is sufficient. These sensors may peak during a measurement. If all sensors peak at the same time, the voltage may drop due to resistance in the power cables, or even because the power supply may not deliver.
One sensor may peak up to 150 mA if I'm correct. So 4 sensors may peak up to 600 mA.
Also these sensors really should run on 5V, not 3.3V.
I have several of these sensors here and they almost never reset themselves.
Perhaps you should add some capacitors over the Vcc lines of the sensors.

If the sensor reboots, it may affect the ABC functionality.
The U value is believed to reflect the raw internal value reflecting the lowest concentration recorded in the last 24h. The sensor will consider this then as the new 400 ppm point.
So if you did not ventilate enough, the lowest recorded concentration may actually be way above 400 ppm and thus the displayed value will be too low and may show hours of 400 ppm recorded values.

Do you also have the values stored in some kind of CSV? Then you can create a scatter plot in Excel.
I did this for S8, MHZ19A and MHz19B (only very short interval of 22 hours):
Image
Horizontal axis shows the ppm values of the S8 sensor (considered to be the "truth", since I just opened the package of the sensor and it had still factory calibration)
Vertical is the concentration of all 3 sensors at the same time.
So then you can see if the sensors agree (for example the S8 agrees very well with itself ;) ) on a given concentration.
If one may react faster or slower, the average should still be the same.

Edit:
One not to myself; I may have swapped the data from the A and the B sensor, since the A never gets below 400 ppm and the B version may give a bit lower values.
1) Right under graph you can see legend :)
2) I've investigated reboot problem and found that problem is in "Generic HTTP Advanced". When I've switched to "Generic HTTP" - reboot problems gone. (I know that Advanced still in "testing")
3) There are no problems with power supply. I've checked different power sources - no changes.
4) I'm powering sensors directly from power supply, so if wemos reboots - this does not affect sensors. I can even remove wemos at all - and all sensors will continue blinking :)
5) About CSV and scatter - good idea, I'll do that lately.


I'm currently testing following sensors
1) Sensair S8 (0053)
2) MH-Z19B with ABC turned off (I've turned it off when it was in good ventilated room for few days, so calibration is good)
3) MH-Z19B with ABC.

I've started testing only 3 days ago and as I can see now - MH-Z19B (both versions) performs not bad. Max difference between all 3 sensors is only about 100ppm (max ppm was about 1600, min 400).
Of course I'll post graphs after at least 10 days of testing (as S8 has 8 days ABC). And I'll prepare scatter plot in Excel also :)

BTW, I've paid 20$ for MH-Z19B and only 36$ for Sensair S8. As for now I thing it's fair price for both of them.

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#30 Post by TD-er » 09 Jan 2018, 09:15

batal131 wrote:
09 Jan 2018, 09:00
1) Right under graph you can see legend :)
2) I've investigated reboot problem and found that problem is in "Generic HTTP Advanced". When I've switched to "Generic HTTP" - reboot problems gone. (I know that Advanced still in "testing")
3) There are no problems with power supply. I've checked different power sources - no changes.
4) I'm powering sensors directly from power supply, so if wemos reboots - this does not affect sensors. I can even remove wemos at all - and all sensors will continue blinking :)
5) About CSV and scatter - good idea, I'll do that lately.


I'm currently testing following sensors
1) Sensair S8 (0053)
2) MH-Z19B with ABC turned off (I've turned it off when it was in good ventilated room for few days, so calibration is good)
3) MH-Z19B with ABC.

I've started testing only 3 days ago and as I can see now - MH-Z19B (both versions) performs not bad. Max difference between all 3 sensors is only about 100ppm (max ppm was about 1600, min 400).
Of course I'll post graphs after at least 10 days of testing (as S8 has 8 days ABC). And I'll prepare scatter plot in Excel also :)

BTW, I've paid 20$ for MH-Z19B and only 36$ for Sensair S8. As for now I thing it's fair price for both of them.
About 1), simply overlooked :)

When you reboot, could you test with the latest source to see if the problems with the Generic HTTP Advanced are now fixed?

If you do the scatter plot, then you can see how well they correlate. And even 100 ppm off is not bad, as long as the average offset is close to 0. Some sensors may react slower, or faster to changes due to internal filtering.
But that also means they will show a shift in time on rise and fall of the curve. However the rise of CO2 concentration may still be more steep than the fall of the concentration.
For example when cooking on gas, the CO2 levels increase really fast, but they take more time to go back to lower levels, with people in the same room.

It is quite fascinating to look into these figures :)

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#31 Post by batal131 » 09 Jan 2018, 10:08

TD-er wrote:
09 Jan 2018, 09:15
When you reboot, could you test with the latest source to see if the problems with the Generic HTTP Advanced are now fixed?
Ok, I'll try to update to latest version.
TD-er wrote:
09 Jan 2018, 09:15
If you do the scatter plot, then you can see how well they correlate. And even 100 ppm off is not bad, as long as the average offset is close to 0. Some sensors may react slower, or faster to changes due to internal filtering.
But that also means they will show a shift in time on rise and fall of the curve. However the rise of CO2 concentration may still be more steep than the fall of the concentration.
For example when cooking on gas, the CO2 levels increase really fast, but they take more time to go back to lower levels, with people in the same room.

It is quite fascinating to look into these figures :)
Currently MH-Z19B without ABC is very good correlated with S8 (with factory calibraion).
And yes, we have gas oven, so sometimes I have >1500ppm :) (and that's good for testing!)

Both MH-Z19Bs are reporting raw values, not sure if I need to change theirs filters.

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#32 Post by TD-er » 09 Jan 2018, 13:45

batal131 wrote:
09 Jan 2018, 10:08
[...]
Both MH-Z19Bs are reporting raw values, not sure if I need to change theirs filters.
The filters I created are only making it less responsive.
And the option "Use unstable readings" (or how it is called) does not have effect on the B version. Only on the A version.
It should make the A and B version behave the same. (based on what I think the B version does internal)

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#33 Post by batal131 » 10 Jan 2018, 08:53

TD-er wrote:
09 Jan 2018, 09:15
When you reboot, could you test with the latest source to see if the problems with the Generic HTTP Advanced are now fixed?
Updated all 3 boards to latest sources (manually compiled) - still has problems with one board (reboots every 10-15 minutes).

All boards identical (wemos mini 3.0.0). Bought together.

Currently (with HTTP Advanced) 2 of 3 boards works ok (no reboots). One reboots every 10 minutes :(

With Generic HTTP no problems.

Logs are empty (with level 4).

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#34 Post by batal131 » 10 Jan 2018, 22:36

Implemented scatter :)

ppm reported every 1 minute. For graph grouped by 5 minutes. Data for last day (after 5 days of running)
And basic chart (same data)

average difference for MH-Z19B without ABC is only 41 ppm! For ABC version is 95 ppm (and its increasing each day, damn 1 day calibration)
Attachments
co2_1.png
co2_1.png (56.05 KiB) Viewed 9366 times
co2_2.png
co2_2.png (20.99 KiB) Viewed 9366 times

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#35 Post by TD-er » 12 Jan 2018, 15:18

That looks quite nice, the scatter plot.
So if you're running for a while, the version with ABC should show some drift and thus a wider band?
Also interesting to "swap" the data by placing other sensors on the X-axis.

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#36 Post by batal131 » 15 Jan 2018, 14:20

TD-er wrote:
12 Jan 2018, 15:18
That looks quite nice, the scatter plot.
So if you're running for a while, the version with ABC should show some drift and thus a wider band?
Also interesting to "swap" the data by placing other sensors on the X-axis.
Yes, I'll create different graphs after few weeks of testing

BTW, have you checked latest datasheet for MH-Z19B? I've found only Chinese version :(
http://style.winsensor.com/pro_pdf/MH-Z19B.pdf

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#37 Post by batal131 » 15 Jan 2018, 15:03

Small update.

Room wasn't ventilated properly for 26 hours (it was just before previous calibration). And now MH-Z19B (ABC) calibrated. From +100ppm (comparing to S8) to -100ppm...
Lowest ppm during last 24h was 600ppm. So MH-Z19B now thinks that this 600ppm is 400ppm... Terrible behavior.

TD-er
Core team member
Posts: 1928
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z19 offset and scale differences!?

#38 Post by TD-er » 15 Jan 2018, 16:52

batal131 wrote:
15 Jan 2018, 14:20
[...]
BTW, have you checked latest datasheet for MH-Z19B? I've found only Chinese version :(
http://style.winsensor.com/pro_pdf/MH-Z19B.pdf
This one is more readable ;) http://www.winsen-sensor.com/d/files/in ... ver1_0.pdf

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#39 Post by batal131 » 15 Jan 2018, 19:15

TD-er wrote:
15 Jan 2018, 16:52
This one is more readable ;) http://www.winsen-sensor.com/d/files/in ... ver1_0.pdf
Yep, but mine is newer :) (1.3 vs 1.0) But I could not find any reasonable difference. Need to translate it somehow.

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: MH-Z19 offset and scale differences!?

#40 Post by batal131 » 22 Jan 2018, 08:59

I've finished with my tests (MH-Z19B vs SenseAir S8).

So, finally MH-Z19B is very good with ABC turned OFF (and properly calibrated, of course).
At the same time MH-Z19B very bad if you room not ventilated every day.

Here is graph of two MH-Z19B (both with ABC turned OFF!) and one S8. Average difference (comparing to S8) is 1ppm and 10ppm.
Attachments
co2.png
co2.png (73.12 KiB) Viewed 9224 times

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 28 guests