co2_sensor.h 1.02 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef CO2_SENSOR_H_
#define CO2_SENSOR_H_

// The SCD30 from Sensirion is a high quality Nondispersive Infrared (NDIR) based CO₂ sensor capable of detecting 400 to 10000ppm with an accuracy of ±(30ppm+3%).
// https://github.com/sparkfun/SparkFun_SCD30_Arduino_Library
#include "src/lib/SparkFun_SCD30_Arduino_Library/src/SparkFun_SCD30_Arduino_Library.h"  // From: http://librarymanager/All#SparkFun_SCD30
#include "config.h"
#include "led_effects.h"
#include "csv_writer.h" // To close filesystem before restart.
#include <Wire.h>

namespace config {
  extern uint16_t measurement_timestep;  // [s] Value between 2 and 1800 (range for SCD30 sensor)
  extern const bool auto_calibrate_sensor; // [true / false]
  extern uint16_t co2_calibration_level;  // [ppm]
  extern const float temperature_offset; // [K] Sign isn't relevant.
}

namespace sensor {
  extern SCD30 scd30;
  extern int16_t co2;
  extern float temperature;
  extern float humidity;
  extern String timestamp;

  void initialize();
  void startCalibrationProcess();
}
#endif