• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

3.1 – Web Server: Display Sensor Readings (SSE) My BME280 has SPI pins.

Q&A Forum › 3.1 – Web Server: Display Sensor Readings (SSE) My BME280 has SPI pins.
0 Vote Up Vote Down
Keith asked 5 years ago

My BME sensor does not show I2C pins such as SCL or SDA. The one I have looks to work with SPI protocols((SDO, SDI, SCK).  I have tested a variety of permutations of wiring between the ESP 32 and the BME. I cant get the BME to say hello. Does this project and the libraries support BME 280 with SPI? I went through the forum. Sorry If i missed the answer, Thanks and Great Course!

Question Tags: BME280 SPI vs I2C
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
Yes, the libraries support SPI.
Wire the sensor as follows:

  • SCK: GPIO 18
  • MISO(SDO): GPIO 19
  • MOSI (SDI): GPIO 23
  • CS: GPIO 5

Add this to your code before the setup():

#include <SPI.h>
#define BME_SCK 18
#define BME_MISO 19
#define BME_MOSI 23
#define BME_CS 5
Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

Delete this line:

Adafruit_BME280 bme; // I2C

And it should work.
Let me know if it works.
Regards,
Sara
 

0 Vote Up Vote Down
Keith answered 5 years ago

Thanks Sara. I’ll try it and update the forum. Thanks for the help.

0 Vote Up Vote Down
Keith answered 5 years ago

Sara – Works great. Thanks for the fix. Kind Regards…Keith

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Great!
I’ll mark this issue as resolved. 
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.