Adafruit BME280 StemmaQT not work w/ESP8266mod

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
johnzbesko
 
Posts: 15
Joined: Wed Jan 09, 2013 12:34 pm

Adafruit BME280 StemmaQT not work w/ESP8266mod

Post by johnzbesko »

I can successfully compile and load a sketch to an Arduino Uno that senses and reports pressure, temperature and humidity, using SPI. However, when I try to do so on an ESP8266mod (after making appropriate pin changes), the sketch compiles but the Arduino IDE cannot connect to the ESP. If I pull the voltage pin to the BME280, the sketch is able to be loaded, but when I then plug in the power, the ESP resets, cannot sense the the BME and resets again (and again.) Using I2C has the same problem.

The ESP is able to run a Sainsmart 1.8" TFT ST7735 with a microSD, which I would think uses more power than the BME. What could be wrong?

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: Adafruit BME280 StemmaQT not work w/ESP8266mod

Post by Franklin97355 »

How are you connecting the bme280 to the 8266? Can you post the code and perhaps a picture of the connection?

User avatar
johnzbesko
 
Posts: 15
Joined: Wed Jan 09, 2013 12:34 pm

Re: Adafruit BME280 StemmaQT not work w/ESP8266mod

Post by johnzbesko »

I've tried various combinations of VIN and 3.3v on both the ESP and the BME. I also have a 6 pin GY-BME/BMP280 that I think I fried using the ESP VIN pin to power. I bought the Stemma QT because it has the level shifter. I also bought two, thinking the first one was defective. They both work on the Arduino Uno. I also discovered one of my patch wires was defective and replaced it. Again, the BME works with an Uno, but not the ESP. I suppose I could try an ESP32-WROOM and I think it worked on a MEGA3250.

I've also tried other BME libraries without success.

Thank you for your help!
Attachments
ESP8266BME280.jpg
ESP8266BME280.jpg (838.39 KiB) Viewed 646 times

[The extension ino has been deactivated and can no longer be displayed.]


User avatar
johnzbesko
 
Posts: 15
Joined: Wed Jan 09, 2013 12:34 pm

Re: Adafruit BME280 StemmaQT not work w/ESP8266mod

Post by johnzbesko »

The error message I get when trying to connect and upload a sketch is:

A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x65)

BTW, the ESP32-WROOM-32 doesn't work, just like the ESP8266mod

User avatar
oesterle
 
Posts: 806
Joined: Tue Sep 17, 2013 11:32 pm

Re: Adafruit BME280 StemmaQT not work w/ESP8266mod

Post by oesterle »

Hi, johnzbesko!

Thanks for including sharp photos of your build, and your code. (In the future, please feel free to paste the code right here, surrounded by CODE tags; that makes it easier for people to help without having to download anything.)

I have a few ideas about what might get it to work on your ESP8266.
  • I'd connect the 8266 3V3 pin to the BME280 VIN. Typically, a breakout's 3V pin is intended for power output, rather than input.
  • Your attached code references pins 12, 13, 14, and 15 for SPI. I'd change these to the pins you appear to be using on the 8266: 5, 6, 7, and 8.
  • You may need to change pin 8 to something else, since it is used by your 8266 during boot, which may fail if there is a high level on that pin when the 8266 starts up. (Adding a pulldown resistor between CS and GND might be another option.) See Random Nerd Tutorials article, ESP8266 Pinout Reference: Which GPIO pins should you use?
  • Your most recent post mentions "Failed to connect to ESP32". I assume that error is when you're connecting to an ESP32 rather than the pictured ESP8266. If you're trying to upload to the ESP8266 and getting this error, then the wrong board type is selected in the Arduino IDE.
Hope this helps; let us know how things are progressing.

Cheers,

Eric

User avatar
johnzbesko
 
Posts: 15
Joined: Wed Jan 09, 2013 12:34 pm

Re: Adafruit BME280 StemmaQT not work w/ESP8266mod

Post by johnzbesko »

Thank you for your reply! The suggestion to use the pull-down resister enabled me to compile, load and run the BME280 test sketch on the ESP8266mod. The reference to the Random Nerd page was then helpful in assigning GPIO pins for a more complicated sketch that serves a web page, runs a TFT display and mounts a microSD card. Along the way, I also discovered, with a volt/ohm meter, I had some bad patch wires. Possibly from constantly pulling and pushing the wires into different breakout board connectors? ;-)

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”