## THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

Post discussions on applications you are writing
Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

THE MG8-11 CO2 SENSOR MODULE APPLIED TO THE DrDAQ

Sensor & sensor module
SUMMARY
Introduction
Sensor theory & Excel calculator
Sensor signal conditioning circuit (buffer) & other hardware
DrDAQ application
CO2 Sensor operation
Temperature behaviour and aging

INTRODUCTION

Measurement of CO2 concentration in air is useful in many processes. CO2 meters/sensors generally available are expensive and in many cases have a digital output which requires additional microprocessors for data decoding. The MG-811 is a solid electroloyte, cell type sensor with analog output. Its operating principle is similar to that of a pH electrode cell and its output voltage decreases with increasing CO2 concentration.

This sensor comes from China, is very inexpensive and is sold here:

http://sandboxelectronics.com/?p=147

The sensor assembly is complete with a small PC board holding the sensor’s socket, a signal conditioning circuit, a threshold detector circuit and a switching regulator to feed a stable voltage to the sensor’s internal heating element. The above mentioned page also provides some very sketchy technical information, which does not really help to achieve acceptable performance.

This post provides the missing technical information necessary for reliable and accurate measurement and recording of CO2 concentration in air using Picolog and the DrDAQ USB logger, as well as an Excel calculation tool giving complete insight into sensor’s operation.

SENSOR THEORY AND THE EXCEL CALCULATOR (1)

The MG-811 sensor cell outputs a voltage Vs inversely and linearly proportional to the base 10 logarithm of concentration of CO2 in the air present inside the cell. We define the following quantities:

Vo............This is the value Vs assumes at a CO2 concentration of 400 PPM and is the REFERENCE voltage.
Vc............This is the value Vs assumes at a concentration of 1,000 PPM (0.1% in a 99.9% air volume).
ΔVs = Vo - Vc............This is the REACTION VOLTAGE and defines the slope of the PPM Vs. Voltage Output curve.
Since we have an inverse relationship, Vo is by definition the maximum value possible, so that ΔVs is always positive.
C............This is the CONCENTRATION of CO2 expressed in PPM (parts per million).

The MG-811 is capable of measuring C in the range 400 – 10,000 PPM (0.04% to 1%). Unfortunately the output voltage reference Vo varies from sensor to sensor in a range of 200 to 600 mV and accurate calibration is necessary. To define the slope of the Concentration Vs. Output voltage curve, the sensor’s output Vc at 1000 PPM must also be calibrated. When these two parameters are known, the operational range of the sensor is fully calibrated and defined by the following equation:

Vs = 400 + (ΔVs / ((LOG (400) – LOG 1000) * (LOG (C) – LOG (400))) [1]

Vs = 400 - ( ΔVs / (0.398 * (LOG (C) -2.60206) [2]

Where Vs and ΔVs are in mV, C is in PPM and LOG is the natural logarithm (Base 10).

Any MG-811 sensor can fall into or near a Vo reference, approximating all other values as shown below:

MINIMUM:……….Vo=200 mV………. ΔVs=30 mV………Vc=170 mV……….Vs @ 10,000 PPM = 94.6 mV
MEDIUM:…………Vo=400 mV………. ΔVs=60 mV………Vc=340 mV……….Vs @ 10,000 PPM = 189.2 mV
MAXIMUM:………V0 =600 mV……... ΔVs=90 mV………Vc=510 mV……….Vs @ 10,000 PPM = 283.8 mV

In a future post I will upload the Excel tool "MG-811 calculator" which automatically computes all PPM values from Vs, for Vo minimum, medium and maximum. The enclosed PC screen describes the tool operation.
MG-811 Calculator PC screen
Last edited by Glovisol on Mon Dec 12, 2016 2:28 pm, edited 7 times in total.

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

Sensor Theory & Excel calculator (2)
FIGURE 1 - The Log equations compute Cell output voltage from CO2 concentration in PPM

FIGURE 1 shows the mathematical relationship between the CO2 concentration C in air, expressed in PPM and Sensor cell output voltage when Vo and Vc for the individual cell have been measured. The three equations are shown below together with their parameters. NOTE: the log function is incorrectly shown in the graphs as "Ln" by Excel, while it should be shown as "Log".

Vs = -98.222*LOG10(C) + 1,188.50.valid for Vo = 600 mV & Vc = 510 mV (Vs = 90 mV).[3]
Vs = -85.481*LOG10(C) + 792.33..valid for Vo = 400 mV & Vc = 340 mV (Vs = 60 mV)..[4]
Vs = -32.741* LOG10(C) + 396.16..valid for Vo = 200 mV & Vc = 170 mV (Vs = 30 mV)..[5]

The equation for an individual cell is automatically generated by the Excel calculator once the measured values for Vo and Vc are written into the spreadsheet, as will be detailed further on.

But, in order to operate the DrDAQ, we do not need a Log equation as shown above, but its inverse function, which is of course an exponential, as shown in FIGURES 2, 3 and 4 and as follows.

C = 179,884.35*e^(-0.0102*Vs)...valid for Vo = 600 mV & Vc = 510 mV (Vs = 90 mV)..[6]
C = 179,884.35*e^(-0.015*Vs)...valid for Vo = 400 mV & Vc = 340 mV (Vs = 60 mV)..[7]
C = 179,884.35*e^(-0.031*Vs)...valid for Vo = 200 mV & Vc = 170 mV (Vs = 30 mV)..[8]

By writing the measured values of Vo and Vc for the individual cell into the Excel calculator, the spreadsheet will compute the inverse exponential equation as shown above: e.g. the exponent of e will be known. This equation is then written into Picolog as the scaling function. Now, as soon as the DrDAQ reads the Vs value in mV from the cell, Picolog returns and displays the value of CO2 concentration C in PPM.
Attachments
FIGURE 2
FIGURE 3
FIGURE 4
Last edited by Glovisol on Tue Dec 13, 2016 2:01 pm, edited 2 times in total.

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

SENSOR THEORY AND THE EXCEL CALCULATOR (3)

Here is the MG-811 EXCEL CALCULATOR
Attachments
MG-811 CALCULATOR.xls
MG-811 EXCEL CALCULATOR - COMPUTES CO2 CONCENTRATION FILE FOR PICOLOG SCALING

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

SENSOR SIGNAL CONDITIONING & OTHER HARDWARE

With reference to the MG-811 module schematic diagram, high input impedance / low drift U2A accepts the 1 GOhm output of U1 and amplifies the cell output voltage Vc by a factor of 8.5. With a cell output of 600 mV, the module output would be in excess of 5V, a level not suitable for the DrDAQ and the gain must be reduced to unity. There are two possible modifications.

1. Remove R1 and short together with a solder bridge pins 1&2 of U2A.
Alternatively
2. Use the voltage divider R101/R102.

NOTE: any one of the modifications above presents a very low impedance to the EXT 1 input and therefore swamps to ground the DrDAQ error input voltage caused by the internal 100 KOhm pull- up resistor.

The module uses the second half of U2 (U2B) as a voltage comparator to trigger an alarm for a presettable level of Vc, which has no use in this project as alarms are better implemented in Picolog.

Integrated circuit U3 is a switch mode regulator for feeding the Cell heater with a stable 6V. Preferred input voltage is 12V, which must come from an external PSU.
Attachments
Sensor/Buffer schematic diagram
Last edited by Glovisol on Thu Dec 08, 2016 2:46 pm, edited 1 time in total.

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

DrDAQ APPLICATION
Setting up Picolog for CO2 measurement
1. Bill of materials
- Picotech DrDAQ.
- MG-811 CO2 Module complete with MG-811 sensor plugged in.
- MG-811 CO2 Module connector cable.
- AC/DC PSU: 12 V @ 0.2 A.
- 1000 c.c. Standard gas bottle @ CO2 0.1%. Do not be frightened, bottles are currently available on Internet and quite inexpensive; moreover, if used with care, they last a long time.
- Calibration vessel.

The calibration vessel is a container (tin, wood, plexiglass) which can house the MG-811 module with some spare volume. The container has two pluggable holes: one input port to receive free air or the mixture from the gas bottle and another for air exit. Cable interconnection to the outside is made trough a tight rubber grommet. It is easy to make the vessel reasonably airtight as it must work at zero pressure.

2. Assembly & calibration

2.1 Interconnect parts as shown in the diagram. Remember to either modify the MG-811 Module or to add the Voltage divider for 8.5 reduction of Vc.
2.2 Open Picolog and activate EXT 1.
2.3 Configure EXT 1 OPTIONS: Units: mV / 3 Digits / 1 Decimal / Min: 200.0 /Max: 600.
2.4 Configure EXT 1 SCALE: Equation: X*1000.
2.5 Turn on 12 V. PSU.
2.6 Let the system cook for 24 to 48 hours, see "Additional technical information post" following for warm-up times & other precautions.
2.7 After the cooking the Picolog reading on EXT 1 will be any value 200 to 600 mV.
2.8 Place the MG-811 module in the calibration vessel and leave outdoors still connected to the +12 V heater supply for at least 4 hours. After at least 4 hours plug the holes of the vessel and proceed.
2.9 Re-connect all units: on Picolog, EXT 1 there will be a reading of 200 to 600 mV. Mark down this reading. EXAMPLE: reading Vc = 380 mV.
2.10 Remove plugs and slowly inject contents of the standard 0.1% gas bottle into the calibration vessel. The Vc reading will start to go down. When the reading stabilises close the the influx of gas, plug the holes in the vessel and mark the reading. EXAMPLE: reading Vc = 315 mV.
2.11 Open the Excel MG-811 Calculator and write 380 in C3 and 315 in C4. In C12 you will read calculated Vs @ 10,000 PPM: Vs = 151.5 mV and in columns E and F you will read all calculated values from Vc = 380 mV down to Vc = 151.7 mV (400 to 10,000 PPM) in steps of 100 PPM.
2.12 Following this EXAMPLE, in the Excel diagram you will read the Vs vs. PPM expression automatically calculated as:
C = 84,816 * e^(-0.0141*Vc) = 84,816 / (e^(0.0141*Vc)).
2.13 Open Picolog and add a calculated parameter channel writing - in the PPM expression as shown in the above enclosed screen.
2.14 The CO2 measuring /recording system is now calibrated and ready.
Attachments
CO2 Vc calibration values inserted into the Excel MG-822 Calculator

[The extension bmp has been deactivated and can no longer be displayed.]

Last edited by Glovisol on Mon Dec 12, 2016 10:22 am, edited 6 times in total.

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

CO2 SENSOR OPERATION

Typical operation in outside open air, where typical CO2 concentration is 400 PPm +/- 10 PPM is illustrated in FIGURE 1. Sensor operation is quite stable.

A few recorded CO2 variations are shown in FIGURE 2.
Attachments
FIGURE 2 - Simple tests with the CO2 system
FIGURE 1 - 400 PPM stability test

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

SPECIFICATIONS

Two CO2 detectors based on the solid electrolyte technology are presently available: the MG-811 used for this series and the MG-812 which uses half the heating power. Specifications for both are given below. Note that the +12V input (Switching Regulator) of the Module is protected against accidental polarity reversal by Shottky diode D3 (SS14).

Sensor Model MG-811
Standard pack Metal shell
Target gas CO2
Detection range 400—10,000 PPM CO2
Heater voltage 6.0 ± 0.1 V
Heater resistance 30.0 ± 5Ω
Heater current 200 ± 10mA
Heater consumption 1.2 W ± 0.2 W
Working temp. -20 ～ 50℃
Storage temp. -20 ～ 70℃
Range of Reference voltage Vo: 200 - 600mV
Range of Output voltage Vc: 70 - 600 mV
Range of reaction voltage ΔVs (400 - 1000 PPM): 30 - 90 mV

Sensor Model MG-812
Standard pack Metal shell
Target gas CO2
Detection range 350 — 10,000 PPM CO2
Heater voltage 5.0 ± 0.1 V
Heater resistance 60.0 ± 5Ω
Heater current 90 ± 10mA
Heater consumption 450 ± 50mW
Working temp. -20 ～ 50℃
Storage temp -20 ～ 70℃
Range of Reference voltage Vo: 200 - 500mV
Range of Output voltage Vc: 70 - 500 mV
Reaction voltage ΔVs (350 - 1000 PPM) ≧ 25mV

OPERATING PRECAUTIONS

Additional technical data and operating precautions are available here:

http://www.winsen-sensor.com/d/files/PD ... 20V1.1.pdf

Glovisol
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

### Re: THE MG-811 FOR METERING & RECORDING CO2 WITH THE DrDAQ

TEMPERATURE BEHAVIOUR AND AGING

Air temperature into the sensor slightly influences the sensor's reading. Temperature correction can be applied according to the following table referred to an air temperature of +25°C:

AIR TEMPERATURE °C......................CORRECTION
-10...........................................-2.55%
- 5...........................................-2.18%
0...........................................-1.82%
+ 5...........................................-1.45%
+10...........................................-1.09%
+15...........................................-0.73%
+20...........................................-0.36%
+25............................................0.00%
+30............................................0.36%
+35............................................0.73%
+40............................................1.09%
+45............................................1.45%
+50............................................1.82%

Starting from cold, CO2 measurement is reliable only after a suitable warm-up period which can be in the order of hours, if the sensor has been kept off for a long time (guidance in "operating precautions" in the previous post). For this reason it is advisable to keep the sensor on continously: in this case the sensor output drifts with time and it is advisable to do a two point re-calibration at 400 and 1000 PPM at least every week.