Calibration & problems with CO2 Sensor SEN0219

Hello,

As said in the title, I need help with my CO2 Sensor SEN0219.
Indeed I have 2 issues :

  1. I have problems with calibration. Indeed here it is :

I tried automatic zero calibration but it seems like it doesn't work so I wanted to try the 2nd method which is short circuiting HD and GND but on Google I only found sheet for SEN0219 V1.0 or V1.1 which have 9 pins on the first second row while on mine, a SEN0219 V1.2, there is only 6 pins in the rows so I do not know where is the HD pin. Can someone explain me how to calibrate it ?

  1. Even if it is not calibrated, I used it to know if it worked well and I found something strange : my code asks the sensor to take measure every 2sec and sometimes it gives me something like 500ppm and the next measure it goes up to 1200ppm and then 500ppm again like roller coaster. Do you know what is it due to ?

Thanks for your answers :slight_smile:

Circuit diagram, code

You got near it. You are a C0(2) expirator.

1 Like

My thoughts too :slight_smile:

Sorry I couldn't add more photo.

Here is my circuit and code (the circuit is with another sensor but it is the same circuit). It is for a project where I write CO2 measures in a SD card every 2sec :

#include <SD.h>

// Variables utilisées pour la carte SD
const int   sdCardPinChipSelect     = 10;               // Le lecteur de carte SD sera branché sur la pin 10 pour le CS (chip select), 11/12/13 pour le MOSI/MISO/SCK du bus SPI
const char* nomDuFichier            = "donnees.csv";    // Format 8.3 (c'est Ă  dire 8 lettres maximum pour le nom, et optionnellement 3 pour l'extension)
File monFichier;

// Variables utilisées pour le MG-811
int sensorIn = A0;

// Autres variables
const long delaiIntervalleDeMesures = 2000;
unsigned long t;

// Intervalle de mesure/enregistrement (exprimé en millis secondes)

// ========================
// Initialisation programme
// ========================
void setup() {
  
  // Initialisation de la liaison série (pour retourner les infos au moniteur série de l'ordi)
  Serial.begin(9600);
  Serial.println("=== Initialized ===");
  
  // ----------------------------------------------------------------------------
  // VĂ©rification : est-ce que la carte SD est bien accessible depuis l'arduino ?
  // ----------------------------------------------------------------------------
  Serial.print(F("Initialisation de la carte SD..."));
  if (!SD.begin(sdCardPinChipSelect)) {
    Serial.println();
    Serial.println();
    Serial.println(F("Échec de l'initialisation du lecteur de SD card. Vérifiez :"));
    Serial.println(F("1. que la carte SD soit bien insérée"));
    Serial.println(F("2. que votre câblage soit bon"));
    Serial.println(F("3. que la variable 'sdCardPinChipSelect' corresponde bien au branchement de la pin CS de votre carte SD sur l'Arduino"));
    Serial.println(F("Et appuyez sur le bouton RESET de votre Arduino une fois le pb résolu, pour redémarrer ce programme !"));
    while (true);
  }
  Serial.println(F(" réussie !"));
  Serial.println();

  // ----------------------------------------------------------------------------
  // Initialisation du temps
  // ----------------------------------------------------------------------------
  t = millis();

  // ----------------------------------------------------------------------------
  // Initialisation du capteur Ă©lectrochimique
  // ----------------------------------------------------------------------------
  Serial.begin(9600);
  // Set the default voltage of the reference voltage
  analogReference(DEFAULT);
}
// =================
// Boucle principale
// =================
void loop(){
  //Read voltage
  int sensorValue = analogRead(sensorIn);

  // The analog signal is converted to a voltage
  float voltage = sensorValue*(5000/1024.0);
  if(voltage == 0)
  {
    Serial.println("Fault");
  }
  else if(voltage < 400)
  {
    Serial.println("preheating");
  }
  else
  {
    int voltage_diference=voltage-400;
    float concentration=voltage_diference*50.0/16.0;
    // Print Voltage
    Serial.print("voltage:");
    Serial.print(voltage);
    Serial.println("mv");
    //Print CO2 concentration
    Serial.print(concentration);
    Serial.println("ppm");

  // Enregistrement de ces données sur la carte SD
  monFichier = SD.open(nomDuFichier, FILE_WRITE);
  if (monFichier) {    
    monFichier.print(t);
    monFichier.print(";");
    monFichier.print(voltage);
    monFichier.print(";");
    monFichier.println(concentration);
    monFichier.print(";");
    monFichier.close();                     // L'enregistrement des données se fait au moment de la clôture du fichier
    Serial.println(F("Enregistrement réussi en carte SD"));
  }
  else {
    Serial.println(F("Erreur lors de la tentative d'ouverture du fichier en Ă©criture, sur la carte SD"));
  }

  // Change la boucle (temps)
  t = t + 2;
  
  // Temporisation de X secondes
  Serial.println();
  delay(delaiIntervalleDeMesures);
  }
}

When I tried the automatic zero calibration method I let it run for 24h+ in my balcony where no ones goes and this phenomenon also happened :confused:

Your circuit drawing shows the sensor being powered from the Arduino 5 volt pin. The sensor draws WAY too much current for that! Use a separate 4.5 to 5.5 volt supply for the sensor.

Am I reading the datasheet wrong?

Average Current: <60mA @ 5V
Peak Current: 150mA @ 5V

Isn't that like, three to eight LEDs? Asking for a friend.

Yes, so? Still way to much current.

Okay. Thank you. I thought it was 500mA total output. Eek. What would you recommend? (total max and single-pin max)
[edit]
Thanks for the info. I did some quick reading. 500mA max on the 5v pin. 40mA max on PWM. Total max Vcc/GND PWM pin 200mA. Recommended not exceeding 25% lower than any max.
[/edit]
[x] SOLUTION

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.