NodeMCU + GY-BME280 + GP2Y1010AU0F and Arduino IDE
Posted: Thu Aug 09, 2018 7:47 am
Hi,
I'm new to this board, so I hope I've posted this in the right subforum...
I have recently obtained a NodeMCU v1.0 (ESP 12-E) and would like to connect it up with a GY-BME280 "environment sensor" and GP2Y1010AU0F dust sensor and have run into a couple of problems.
The image below is exactly how everything is wired up
The NodeMCU is being powered via the Vin pin using a 5V power brick. There is a 220µF capacitor used as a bypass right where I plug the brick into the breadboard
Both the GY-BME280 and GP2Y1010AU0F work on an Arduino Uno with no problems.
My first issue (in order of perceived seriousness)
If anyone can help or even just explain why things aren't going to plan, it will be much appreciated!
I'm new to this board, so I hope I've posted this in the right subforum...
I have recently obtained a NodeMCU v1.0 (ESP 12-E) and would like to connect it up with a GY-BME280 "environment sensor" and GP2Y1010AU0F dust sensor and have run into a couple of problems.
The image below is exactly how everything is wired up
The NodeMCU is being powered via the Vin pin using a 5V power brick. There is a 220µF capacitor used as a bypass right where I plug the brick into the breadboard
Both the GY-BME280 and GP2Y1010AU0F work on an Arduino Uno with no problems.
My first issue (in order of perceived seriousness)
- The ADC of the NodeMCU is reading a far lower voltage than expected from the GP2Y1010AU0F.
- I have tested the the ADC of the NodeMCU on known references and it is producing reasonable readouts.
- I have also tested the GP2Y1010AU0F on the Arduino Uno with the same breadboard and same wiring (the only difference is the Uno has 5V logic as opposed to 3v3 logic the NodeMCU has).
- I am using the AdaFruit library for the BME280 module and the command Code: Select all
bme.takeForcedMeasurement()
not only does not work but causes the NodeMCU to hang... This is an issue as I know from experience that if I run the BME280 module in MODE_NORMAL, it runs hot (however it does "work" with MODE_NORMAL). The sketch runs past the commandCode: Select allbme.setSampling(Adafruit_BME280::MODE_FORCED,
Adafruit_BME280::SAMPLING_X1,
Adafruit_BME280::SAMPLING_X1,
Adafruit_BME280::SAMPLING_X1,
Adafruit_BME280::FILTER_OFF );
But when it's time to take a measurement, I either get nothing [because I don't use the command takeForcedMeasurement()] or the whole thing hangs [right after the takeForcedMeasurement() command] - I cannot get the wire the BME280 to pins D5, D6, D7 and D8. Originally I wanted to run the module in SPI mode, however I am unable to upload the code when this pins were connected to the BME280 module. In addition, after uploading (by disconnecting GPIOs D5-D8) and the reconnecting said pins, the NodeMCU does not seem to switch on!
This last problem isn't an urgent issue for me anymore, since I can run it in I2C mode instead but I would appreciate explanations for potential future projects...
If anyone can help or even just explain why things aren't going to plan, it will be much appreciated!