today I connected the SDS011 to NodeMCU. I noticed that this only works when the sensor is connected to the voltage VU. If I connect the sensor to another pin for the voltage, it does not respond. Why is this so?
If I see it correctly, the reason must be that data is exchanged via RX and TX.
#include "SdsDustSensor.h"
int rxPin = 5; //d1
int txPin = 4; //d2
SdsDustSensor sds(rxPin, txPin);
void setup(){
Serial.begin(9600);
sds.begin();
sds.setCustomWorkingPeriod(0);
}
void loop(){
PmResult pm = sds.readPm();
if (pm.isOk()) {
Serial.println(pm.pm25);
Serial.println(pm.pm10);
}
delay(250);
}