June 21, 2024, 08:54:29 PM

I2C device not found

Started by champ8242, July 23, 2023, 01:19:15 PM

Previous topic - Next topic

champ8242

Hi,
Just received a ESP32-GATEWAY and need to use other than standard I2C pins.
As a simple test to change pins and an I2C device (BME280) I have I have used the simple
Arduino INO sample from Random Nerd Tutorials. Click here for code

I have changed the sample pins
#define I2C_SDA 33
#define I2C_SCL 32
To
#define I2C_SDA 16
#define I2C_SCL 32

When I run it on the ESP32-GATEWAY, I get: "Could not find a valid BME280 sensor, check wiring!"

When I move the code and device to a ESP32 Dev Kit it runs perfectly.

Looked over and over that I used the right pins but all looks OK

Anybody with a suggestion?
 

LubOlimex

16 and 32 seem free to use. Probably something in the software or the wiring. You usually don't need to redefine SDA and SCL if you have selected Olimex ESP32-GATEWAY from the board selection menu, they are already set here:

https://github.com/espressif/arduino-esp32/blob/master/variants/esp32-gateway/pins_arduino.h

static const uint8_t SCL = 16; // This is extention pin 11
static const uint8_t SDA = 32; // This is extention pin 13

Double check the wiring if the proper pins are identified.

Consider if you need to add pull ups on the I2C lines.
Technical support and documentation manager at Olimex

champ8242

Totally my mistake!. I used the BME280 on the ESP32-GATEWAY 5V where I should have used it on the 3.3v. Sorry!