SEN0441 (mics2714)

userHead Lorenzo.Barale 2023-06-23 23:52:31 263 Views3 Replies

Hi everyone, 

 

I attached the 5V, GND, A0 and 10 pins of the mics2714 to both an Arduino UNO and a nano but I get the same problem. I am trying to measure NO2 but  always get 0.0 PPM as result in the serial monitor. I calibrated the sensor in a closed room for 3 minutes as requested and then tried to stay just above highway (getting 0.00 PPM as result). Wiring seems fine, but for example when I disconnect the analog pin the arduino doesn't recognize the sensor as removed and says “Device connected successfully !”. This is the code:

 

#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()

{

 

  float gasdata = mics.getGasData(NO2);

  Serial.print(gasdata,1);

  Serial.println(" PPM");

  delay(1000);

  //mics.sleepMode();

}

 

Thanks for any help

2023-06-28 04:20:02

If I have pin D10 connected, should I also connect the 5V to the sensor or the D10 pin in enough? If I connect the 5V wire to the sensor (to the arduino) I always get 0.00 PPM, if I remove the 5V wire I get 0.21 PPM. Can you please repeat which wires should I connect to the arduino? Thank you very much

userHeadPic Lorenzo.Barale
jenna wrote:

It needs to be connected to 5V, GND, A, and EN. The EN pin lets you control whether the sensor is de-energized, like a switch.

 

When the 5V is not connected, is the output value of the sensor stable at 0.21 PPM? When the analog port of the board is floated, the analog value read is unstable. You can see this by uploading getADCData.ino and plugging and unplugging the sensor.

2023-06-28 13:51:59
1 Replies
2023-06-27 18:15:30

1. I checked the sample code. Only the sensor initialization is mentioned in the setup() function. The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup() function will only run once, after each powerup or reset of the Arduino board. After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.

The function of mics. begin() is to enable powerPin. This function is not to detect if the sensor is disconnected. 

Pls check the library: https://github.com/DFRobot/DFRobot_MICS/blob/master/DFRobot_MICS.cpp

For IIC or UART sensors, we can add monitoring-related commands in loop(). But for analog sensors (such as SEN0441), it is temporarily impossible to monitor its status.

 

 

2. This sensor can only detect nearby gases. It is recommended that the sensor be close to the exhaust pipe (NO2) of the starting car or the H2 collection device of the electrolyzed water, and its value will change immediately. If you put it on the road to detect ambient gas, the value may not be satisfactory.

userHeadPic jenna