0

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

}


2
  • 1
    how can anyone know? ... you said nothing about the sketch that you are using Commented Mar 5, 2021 at 2:24
  • 1
    Share some schematic/code. Commented Mar 5, 2021 at 6:39

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.