Monday, August 4, 2014

SainSmart MG811 Carbon Dioxide Gas CO2 Sensor


The MG811 in the name refers to the actual sensor itself which uses a heater inside of an electro-chemical sensor. This sensor must be primed (turned-on) for about 24-36 hours before actually being able to use the sensor. Also, it takes a few minutes for the heating mechanism to reach full potential. SainSmart here has put the sensor onto a board along with resistors including a potentiometer and an op-amp. The way that the sensor works has to do with the voltage changes depending on the CO2 it senses. The sensor required a total of 6 volts, although we usually used it with 5V which should have been fine. This sensor was very difficult to work with because it only senses more than 400 PPM which was hard to accomplish. However, after a while it would not sense anything even as dry ice was sublimating before it. The sensor would read 0 or simply 1 after it would be turned on a more than 15 minutes.

Vin -->5V on Arduino
GND --> GND on Arduino
AO --> A1 on Arduino

Coding this sensor should have been simple, as the following code shows:

int sensorValue;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
sensorValue = analogRead(0); // read analog input pin 0
Serial.println(sensorValue, DEC); // prints the value read
delay(100); // wait 100ms for next reading
}

This is the code that was outputting 0 and 1 after a while, but this was not always the case. The sensor would read values of 20-40 when the sensor was first acquired but simply went downhill from this point on. I really wanted this sensor to work but unfortunately it was close to impossible to figure it out. We worked weeks on it before finally giving up and simply taking it out of the equation. 

Future recommendations for this sensor would be to find another one. www.sandboxelectronics.com has a sensor that seems to give people better results. Honestly, the data sheet for this sensor was very thin and the SainSmart website had little to no information about the sensor itself. Jose Saspa's code that he posted for this sensor as well seems to be the code for the Sand Box Electronics sensor and it seems as it would work fine with it. 

Datasheet:
http://netdrive.envell.com/pic/ebay/SEN-000007/SEN-000007_Datasheet.pdf

SainSmart Website:
http://www.sainsmart.com/sensors/eco/sainsmart-mg811-gas-co2-carbon-dioxide-sensor-module-sensor-module.html

Wiki Page:
http://www.spencerpages.com/wiki/index.php?title=MG811_Carbon_Dioxide_(CO2)_Sensor


1 comment:

  1. This is really nice blog. i feel happy to read this CO2 Gas Transmitter blog information. Thanks for sharing this information with us. Acorn Controls Pvt.Ltd. is also one of the best company that manufacturer and supply the Ultrasonic Flow Meter.

    ReplyDelete