mics2714 ADC to ppm (?)

userHead Lorenzo.Barale 2023-06-28 12:45:43 289 Views5 Replies

I am using the mics2714 breakout sensor (sen0441) with arduino uno. I am using this code, which is provided by the official website:

/*!

  * @file  getGasPPM.ino

  * @brief Reading Gas concentration, A concentration of one part per million (PPM).

  * @n When using IIC device, select I2C address, set the dialing switch A0, A1 (Address_0 is [0 0]), (Address_1 is [1 0]), (Address_2 is [0 1]), (Address_3 is [1 1]).

  * @n When using the Breakout version, connect the adcPin and PowerPin

  * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)

  * @licence     The MIT License (MIT)

  * @author      ZhixinLiu([email protected])

  * @version     V1.1

  * @date        2021-04-19

  * @get         from https://www.dfrobot.com

  * @url         https://github.com/dfrobot/DFRobot_MICS

  */

#include "DFRobot_MICS.h"


 

#define CALIBRATION_TIME   3                      // Default calibration time is three minutes


 

// When using the Breakout version, use the following program to construct an object from DFRobot_MICS_ADC

/**!

  adcPin is A0~A5

  powerPin is General IO

*/

#define ADC_PIN   A0

#define POWER_PIN 10

DFRobot_MICS_ADC mics(/*adcPin*/ADC_PIN, /*powerPin*/POWER_PIN);


 

void setup()

{

  Serial.begin(115200);

  while(!Serial);

  while(!mics.begin()){

    Serial.println("NO Deivces !");

    delay(1000);

  } Serial.println("Device connected successfully !");


 

  /**!

    Gets the power mode of the sensor

    The sensor is in sleep mode when power is on,so it needs to wake up the sensor.

    The data obtained in sleep mode is wrong

   */

  uint8_t mode = mics.getPowerState();

  if(mode == SLEEP_MODE){

    mics.wakeUpMode();

    Serial.println("wake up sensor success!");

  }else{

    Serial.println("The sensor is wake up mode");

  }


 

  /**!

     Do not touch the sensor probe when preheating the sensor.

     Place the sensor in clean air.

     The default calibration time is 3 minutes.

  */

  while(!mics.warmUpTime(CALIBRATION_TIME)){

    Serial.println("Please wait until the warm-up time is over!");

    delay(1000);

  }

}


 

void loop()

{

  /**!

    Gas type:

    MICS-4514 You can get all gas concentration

    MICS-5524 You can get the concentration of CH4, C2H5OH, H2, NH3, CO

    MICS-2714 You can get the concentration of NO2

      Methane          (CH4)    (1000 - 25000)PPM

      Ethanol          (C2H5OH) (10   - 500)PPM

      Hydrogen         (H2)     (1    - 1000)PPM

      Ammonia          (NH3)    (1    - 500)PPM

      Carbon Monoxide  (CO)     (1    - 1000)PPM

      Nitrogen Dioxide (NO2)    (0.1  - 10)PPM

  */

  float gasdata = mics.getGasData(NO2);

  Serial.print(gasdata,1);

  Serial.println(" PPM");

  delay(1000);

  //mics.sleepMode();

}


The problem is that I am always getting 0.2 ppm as result in the serial monitor. With the shown code do I get the ppm concentration of NO2 or I need to use the mics.getADCData(RED_MODE) function to convert ADC to ppm? Thank you very much

2023-06-29 18:25:18

Hello,

According to the comment section of the code, the reading is within the range of detection. You could maybe try testing in an environment with higher concentration, possibly near a car's gas exhaust, and see if the result changes.

 

Best regards,

userHeadPic xingzhao.zhu
Lorenzo.Barale wrote:

Even if I put the sensor next to a car exhaust I still get 0.2 ppm constant. Could be the sensor broken? Thank you 

2023-06-30 02:12:11
xingzhao.zhu wrote:

Okay, we will test one of our sensors during the weekend and get back to you with  our results on Monday, thank you for your understanding. 

2023-06-30 12:05:05
jenna wrote:

We tested this product next to the car exhaust. It has an output of 2-3 ppm. The output is close to 0 ppm when there is no car exhaust.

2023-07-03 10:42:33
3 Replies
2023-06-29 18:20:07

pls check this forum.

https://www.dfrobot.com/forum/topic/321127

 

userHeadPic jenna