user72810: 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);

}




user37622: The SDS011 needs 5 V powering and the VU pin is the 5 V from USB on the NodeMCU development board.

72810: <p>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?</p>
<p>If I see it correctly, the reason must be that data is exchanged via RX and TX.</p>
<pre><code>#include &quot;SdsDustSensor.h&quot;

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);

}


</code></pre>
 37622: <p>The SDS011 needs 5 V powering and the VU pin is the 5 V from USB on the NodeMCU development board.</p>
