CJMCU-6814 adapter board with MICS-6814 CO/NH3/NO2-sensor

Hi there,

Things I learned about the MICS-6814 and CJMCU-6814 (please note that I'm no expert and I may be wrong):

  • MICS-6814 can measure up to 10 different gases, but the CJMCU-6814 (purple board that includes MICS-6814) only allows 3 gases to be detected, each one directly in a different analog output - which means NOT using I2C;

  • there are other boards which include the MICS-6814 which use I2C and thus allow support for the 10 gases, but it's not the case with the purple CJMCU-6814;

  • the datasheet (link below) states that this sensor is not meant to get exact values for the gases proportions in the air (ppm), it's meant only for relative use. Examples: now the air has 10% more CO than 10 minutes ago; Yesterday there was 20% less CO in the air;

  • in order to be able to relatively detect the changes, you must calibrate the sensor by using a certain amount of resistance, which you will have to find out in your own environment (it will be different on the top of a mountain, by the beach or in a big polluted city) - and that for each analog output or gas; It really doesn't make much sense to use it without calibrating, reason below;

  • the datasheet states that you should measure voltage between the sensor and ground - but like others, I couldn't make it work that way. You need to pull it up. By pulling it up (adding a resistor between the analog output of the sensor and Vcc), you get the opposite values of what the datasheet describes: in the datasheet, it says the more gas, the lesser resistance and thus, greater voltage. However, by pulling it up, it inverts that and you start having voltage drop when you detect an increase of the gas concentration;

  • the sensor must warm up, in the datasheet the example shows that even after 120 minutes the sensor was still heating up;

  • and which resistor value should I use, then? the datasheet says that the best resolution is achieved by using the midrange voltage. So as the sensor uses 5V, midrange is 2.5V, So, you pull up the analog output, and measure its value. You must increase or decrease the resistor value until you get the midrange voltage (2.5V). THAT'S WHY in the datasheet it is suggested to use a 820 ohm resistor in series with a potentiometer (I'm using a Trimmer pot for each gas);

  • the datasheet suggests a 820 ohm resistor so that even if the potentiometer (trimpot) is zeroed, you would still have a small resistor, thus not damaging your sensor; however, I believe it only gets damaged if it stays in use without resistors for a long time;

  • for CO, I'm using a 1M ohm resistor in series with a 1M trimmer pot;

  • for NH3, I'm using a 1K ohm resistor in series with a 500K trimmer pot;

  • for NO2, I'm using a 1K ohm resistor in series with a 100K trimmer pot;

  • that way I was able to calibrate it to 2.5V each;

  • after "calibrated", you'll get the variations quite quickly (that's a good thing about it, it reacts quite fast). So, if you were at 2.5V (and using a pull up), and voltage went down to 2.0V, then you have 20% more of that gas;

  • in the code sample below, I initialized it using pinMode(SENSOR_PIN, INPUT), which means I didn't use INPUT_PULLUP;

  • the readings fluctuate quite a lot, so you better make an average of the last X readings;

Hope this is correct and help others trying to use this board.

Cheers,
Feu.

datasheet:

other interesting documents:

#include <Arduino.h>

const float max_volts = 5.0;
const float max_analog_steps = 1023.0;
  
void setup() {
  Serial.begin(9600);
  delay(1000);
  Serial.println("Setup initializing");

  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
}

void loop() {
  int a0_read = analogRead(A0);
  int a1_read = analogRead(A1);
  int a2_read = analogRead(A2);

  Serial.print("Latest reading in volts, CO (a0): ");
  Serial.print(a0_read * (max_volts / max_analog_steps));
  Serial.print(" NH3 (a1): ");
  Serial.print(a1_read * (max_volts / max_analog_steps));
  Serial.print(" NO2 (a2): ");
  Serial.print(a2_read * (max_volts / max_analog_steps));
  Serial.println("");

  delay(200);
}

3 Likes