//co2 sensor needs 5v. Connect USB 5V directly (not through wemos d1 onboard diode which gives only 4.7V!)
//co2 sensor needs 5v. Maybe better to Connect USB 5V directly (not through wemos d1 onboard diode which gives only 4.7V! at '5V' output)
//if ABC is disabled (see in setup function) sensor should be calibrated manually. leave outdoors (=400ppm) with no direct sunlight for >20min, then connect HD pin to GND for at least 7 seconds.
/* Pinout (view from top, connector at the bottom)
@ -118,9 +118,15 @@ struct sensordata
*\-----------------/
*|||||
*VoRxTxNCHD
*
*[Connector]
*/
#ifndef SOFTWARESERIAL_H
#include<SoftwareSerial.h>
#define SOFTWARESERIAL_H
#endif
SoftwareSerialmhz19_swSerial;
#define BAUD_RATE_MHZ19 9600
@ -133,6 +139,31 @@ struct sensordata
intmhz19_readValue_reimplemented(Stream*_streamRef,MHZ19*_mhz19Ref);//declare function
#endif
#ifdef SENSOR_SDS018
structsensordatadataSDS018_pm25;
structsensordatadataSDS018_pm10;
//SDS18 dust sensor for 2.5µm and 10µm
//Needs 5V
boolsds018_dustok=false;
floatvalue_pm25=-1;
floatvalue_pm10=-1;
#ifndef SOFTWARESERIAL_H
#include<SoftwareSerial.h>
#define SOFTWARESERIAL_H
#endif
SoftwareSerialsds018_swSerial;
#define BAUD_RATE_SDS018 9600
unsignedlonglastread_sds018=0;//to save last read time for both readings
voidreadSDS018();
#endif
// data/homie/config.json hochladen mit platformio run --target uploadfs
// config contains homie device name, mqtt ip and wifi credentials