Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. MG812(Co2) Sensor ppm calculation

MG812(Co2) Sensor ppm calculation

Scheduled Pinned Locked Moved Hardware
6 Posts 2 Posters 4.8k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Mahendra SondagarM Offline
    Mahendra SondagarM Offline
    Mahendra Sondagar
    wrote on last edited by Mahendra Sondagar
    #1

    Hello Folks,
    This one is my first post here :)

    from few day I'm playing with MG812 Co2 sensor let me tell you that the sensor is quite similar with famous MG811 Co2 sensor but instead of high voltage(6V) it uses** 5V**.
    both sensor produced EMF in mV at the output w.r.t Co2 concatenation when Co2 concentration rises output falls.

    here is the datasheet for MG812 sensor
    0_1473162025895_MG812 CO2 Manual V1.1.pdf

    I've taken MG811 as a reference for ppm calculation
    here is the link for the firmware from DFrobot
    link text

    I've use this code with my sensor when i play it my arduino shows, **Under heating/beyond range(400~10,000)
    **
    that's why I've decides to display it's o\p EMF,
    my problem is when i make simple code to to read it's sample voltage then sensor's o\p voltage is not same as suggested in datasheet(250-330mV)

    here is my pin config got the Sensor
    pin connection

    1(Heater1) ---------> +5V
    3(Heater2) ----------> GND
    2(TE1) ----------> GNG
    3(TE2) ----------> Arduino(A0)

    here is my o\p on Arduino terminal
    MG812 Co2 sensor Interfacing...
    Samplse: 23
    Volts: 0.11
    mV: 112.3046875000

    Samplse: 15
    Volts: 0.07
    mV: 73.2421875000

    Samplse: 21
    Volts: 0.10
    mV: 102.5390625000

    Samplse: 16
    Volts: 0.08
    mV: 78.1250000000

    Samplse: 18
    Volts: 0.09
    mV: 87.8906250000

    Samplse: 19
    Volts: 0.09
    mV: 92.7734375000

    Samplse: 15
    Volts: 0.07
    mV: 73.2421875000

    Samplse: 22
    Volts: 0.11
    mV: 107.4218750000

    Samplse: 16
    Volts: 0.08
    mV: 78.1250000000

    Samplse: 19
    Volts: 0.09
    mV: 92.7734375000

    Samplse: 19
    Volts: 0.09
    mV: 92.7734375000

    Samplse: 17
    Volts: 0.08
    mV: 83.0078125000

    Samplse: 20
    Volts: 0.10
    mV: 97.6562500000

    Samplse: 15
    Volts: 0.07
    mV: 73.2421875000

    Guys can any one help me here
    I'll appreciate all precious comments and suggestions :)

    YveauxY 1 Reply Last reply
    0
    • Mahendra SondagarM Mahendra Sondagar

      Hello Folks,
      This one is my first post here :)

      from few day I'm playing with MG812 Co2 sensor let me tell you that the sensor is quite similar with famous MG811 Co2 sensor but instead of high voltage(6V) it uses** 5V**.
      both sensor produced EMF in mV at the output w.r.t Co2 concatenation when Co2 concentration rises output falls.

      here is the datasheet for MG812 sensor
      0_1473162025895_MG812 CO2 Manual V1.1.pdf

      I've taken MG811 as a reference for ppm calculation
      here is the link for the firmware from DFrobot
      link text

      I've use this code with my sensor when i play it my arduino shows, **Under heating/beyond range(400~10,000)
      **
      that's why I've decides to display it's o\p EMF,
      my problem is when i make simple code to to read it's sample voltage then sensor's o\p voltage is not same as suggested in datasheet(250-330mV)

      here is my pin config got the Sensor
      pin connection

      1(Heater1) ---------> +5V
      3(Heater2) ----------> GND
      2(TE1) ----------> GNG
      3(TE2) ----------> Arduino(A0)

      here is my o\p on Arduino terminal
      MG812 Co2 sensor Interfacing...
      Samplse: 23
      Volts: 0.11
      mV: 112.3046875000

      Samplse: 15
      Volts: 0.07
      mV: 73.2421875000

      Samplse: 21
      Volts: 0.10
      mV: 102.5390625000

      Samplse: 16
      Volts: 0.08
      mV: 78.1250000000

      Samplse: 18
      Volts: 0.09
      mV: 87.8906250000

      Samplse: 19
      Volts: 0.09
      mV: 92.7734375000

      Samplse: 15
      Volts: 0.07
      mV: 73.2421875000

      Samplse: 22
      Volts: 0.11
      mV: 107.4218750000

      Samplse: 16
      Volts: 0.08
      mV: 78.1250000000

      Samplse: 19
      Volts: 0.09
      mV: 92.7734375000

      Samplse: 19
      Volts: 0.09
      mV: 92.7734375000

      Samplse: 17
      Volts: 0.08
      mV: 83.0078125000

      Samplse: 20
      Volts: 0.10
      mV: 97.6562500000

      Samplse: 15
      Volts: 0.07
      mV: 73.2421875000

      Guys can any one help me here
      I'll appreciate all precious comments and suggestions :)

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #2

      @Mahendra-Sondagar welcome to the forum!
      Did you check with a multimeter if the voltages are the same as the arduino reports?

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • Mahendra SondagarM Offline
        Mahendra SondagarM Offline
        Mahendra Sondagar
        wrote on last edited by
        #3

        yes, Yveaux
        I've check through multimeter before

        YveauxY 1 Reply Last reply
        0
        • Mahendra SondagarM Mahendra Sondagar

          yes, Yveaux
          I've check through multimeter before

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @Mahendra-Sondagar then most likely it is an issue with your code to read out the ads. Please share your code it with us.

          http://yveaux.blogspot.nl

          Mahendra SondagarM 2 Replies Last reply
          0
          • YveauxY Yveaux

            @Mahendra-Sondagar then most likely it is an issue with your code to read out the ads. Please share your code it with us.

            Mahendra SondagarM Offline
            Mahendra SondagarM Offline
            Mahendra Sondagar
            wrote on last edited by Mahendra Sondagar
            #5

            @Yveaux
            The code is straight foreword it simply reads ADC's channel and convert in to voltage

            Insert Code Here
            #include <Arduino.h>
            
            
            void Setup(){
            Serial.begin(9600);
            Serial.println("MG812 Co2 ppm calculation...");
            delay(1000);
            }
            
            void loop(){
            
            uint16_t  samplse= analogRead(0);
            Serial.print("Samplse: ");
            Serial.println(samplse);
            
            float volts=((5.0*samplse)/1024);
            Serial.print("Volts: ");
            Serial.println(volts);
            
            
            float mv=(volts*1000);
            Serial.print("mV: ");
            Serial.println(mv);
            
            
            delay(2000);
            }
            
            
            1 Reply Last reply
            0
            • YveauxY Yveaux

              @Mahendra-Sondagar then most likely it is an issue with your code to read out the ads. Please share your code it with us.

              Mahendra SondagarM Offline
              Mahendra SondagarM Offline
              Mahendra Sondagar
              wrote on last edited by Mahendra Sondagar
              #6

              @Yveaux
              Have you read datasheet here...
              At the o\p side they mention unity gain amplifier with OpAmp
              0_1473310561788_opamp.JPG

              but the thing is that unity gain amplifier always produced same output volts!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              17

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular