ESP8266 Dust Sensor PPD42

Yeppers the PPD42 is a 5V device.

The dust sensor has a wire that is used for power, attach it to 5V.

guy uses Due, a 3.3V device, and writes about voltage dividers, which is one way of how to do that. and logic level shifters are another way to do that. I am sure there are other examples that can be found on the Internet as to how to do that, no?

My ESP8266 has a Vin 5V pin, can i use it to power de PPD42?

gbaets, If i use int pin D5 I get:

exit status 1
expected initializer before 'D5'

osfuco:
My ESP8266 has a Vin 5V pin, can i use it to power de PPD42?

If you are asking me for permission, Yes you may use the 5V pin to power the PPD42. Really though, the only way to answer that question is for you to try it and let us know if you can or cannot do.

Curious, did you do the voltage divider thingy or the level shifter thingy before you applied power or did you just try it without hooking up level shifters and now the thing won't work anymore?

Just connect the PPD42 power cable to the Vin pin, GND to GND PIN, and data to D5 pin.

The syntax is
int pin=D5;

By writing
int pin=5;
you are referring to the GPIO pin number. GPIO5 is connected to D1.

Guy

osfuco:
Just connect the PPD42 power cable to the Vin pin, GND to GND PIN, and data to D5 pin.

Do you get that the sensor is a 5V device and the MCU you are using is a 3.3V device and the output of the sensor needs to be conditioned so that the MCU is not damaged by the higher voltage output of the sensor?

Here below the nodemcu v1 pinout diagram.
You see that D5 corresponds to GPIO14.
So alternatively you could write
int pin=14;
Guy

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.