RTC and BMP280 over I2C problem


I have problem that drives me crazy for many hours already.

I have the connection as on the image below. It consists of Arduino MEGA 2560 Rev3 with MicroSD card breakout over SPI, OLED display and BMP280 breakout (connected through logic level shifter) over I2C. All worked just fine until I have connected another I2C breakout - the RTC DS3231M (DFR0641).

After connecting RTC breakout the BMP280 stopped working. I tried the following to investigate the problem:

It seems that use of the DFR0641 RTC breakout somehow disrupted I2C communication with BMP280.

Any ideas what this could cause?

Thanks a lot!!!


Could You please post a wiring diagram? In Fritzings too many details are missing or unredable.
Attaching code is usually very helpful. Please read the first topic for instructions telling how to post code.

SD module DFR0229: https://www.dfrobot.com/product-875.html, with schematic.
I'm not happy with that module. A (micro)SD card works at 3.3V and every good module has level shifters. The DFR0229 has a voltage regulator, but only resistors for the signals.

RTC DFR0641: https://www.dfrobot.com/product-1991.html, with schematic.
That seems okay. You can use it with 5V (and a 5V I2C bus) or with 3.3V (and a 3.3V I2C bus). It has 10k pullup resistors.

GY-BMP280: https://www.amazon.com/KOOBOOK-GY-BMP280-3-3-Precision-Atmospheric-Barometric/dp/B07S98QBTQ/.
That seems okay, it is only for 3.3V. Those modules sometimes have other sensors on it. It could be a BMP280 or not. You have to find out which sensor it is.
The BMP280 and BME280 modules are know to really not like 5V signals and they don't have strong SDA and SCL signals. If you have more pullup resistors somewhere, then the BMP280 is the first who has trouble with it.

OLED display: Did you know that a OLED display disturbs the I2C bus for others ?
The SDA and SCL signals of a OLED are 3.3V signals, regardless if it is powered with 5V or 3.3V. Can you put the OLED on the 3.3V I2C bus ? You can try to power it with 3.3V, but that might be too dim.

Logic Level Converter: Okay. It is connected correctly.

Pullup resistors: Are the resistors on the GY-BMP280 labelled "103" ? Then they are 10k pullup resistors. I don't know if the OLED has pullup resistors, I don't use them in the calculation.
Your sink current for SDA and SCL is: ( 5V / (30k//10k//10k//10k) ) + ( 3.3V / (10k//10k) ) = 2.3 mA. That is okay, it should be below 3mA.

Length of wires ?
How long are your wires ? Are SDA and SCL next in a flat ribbon cable ? Is somethine else connected to the GND that belongs to the I2C bus ?

See my tutorial on Reliable Startup for I2C Battery Backed RTC for how to clear the I2C bus on startup

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.