My Heltec LoRa32 V3.1 does not work with my BME280 sensor

Hello,

I would like to operate a BME280 sensor on a Heltec LoRa32 V3.1. Unfortunately, I don’t know which pins I can use on the Heltec controller. I don’t want to use pins 17 and 18, which are only soldered on the back.

Thank you very much for your help.

I suggest these 9 pins GPIO(19, 20, 21, 26, 33, 34, 45, 47, 48).

Note that the WiFi LoRa 32 V3 modules use the first I2C bus to drive the onboard OLED display and, as a consequence, you will need to define and use a second I2C bus (TwoWire(1) or Wire1) for any other I2C device, like your BME280 sensor.

The only way that should work is via the rear pins 17 and 18. These are not brought out, so you have to solder. But I don’t dare to do that.

So I thought there must be alternative pins.

Unfortunately, I don’t know much about the second I2C bus yet.

Would suggest you read and digest this article which uses the BME sensor in the examples, https://randomnerdtutorials.com/esp32-i2c-communication-arduino-ide/. The pins that you can define for your specific needs are shown on the Heltec pinout diagram which is available on the heltec product page and have been listed above

With this code (from user machepro) it now works for me:

TwoWire Wire2(1);

In the setup:

Wire2.begin(41,42); /* (GPIO SDA and SCL) */
status = bme.begin(0x76, &Wire2);

Thank you for your help.