I tried to connect two modules that require I2C connection and they won't work at the same time.

I used the Arduino Sensor Kit - Base. This kit does not need any connection, you just have to code to get your desired output. I wanted to display the Air Pressure (BMP280) module values to the 0.96" OLED Display, however, it is refusing to run both the air pressire and the OLED display at the same time. Only running one module (either Air pressure or OLED) at a time makes it work. Does it have something to do with how the I2C connection is wired on the board?

#include "Arduino_SensorKit.h"

void setup() {
  // put your setup code here, to run once:


void loop() {
  // put your main code here, to run repeatedly:
  Oled.setCursor(0, 10);
  Oled.print("Temp: ");
  Oled.print(" C");
  Oled.setCursor(0, 20);
  Oled.print("Pres: ");
  Oled.print(" Pa");
  Oled.setCursor(0, 30);
  Oled.print("Alti: ");
  Oled.print(" m");


What I did:

  1. Test to see if Air Pressure will still work while both Air Pressure and OLED is connected by using Serial.begin(). Now I know that only the OLED does not work when both modules are connected.
  2. Changed order of initialization. Same result: Air Pressure works but not OLED
  • "it is refusing to do so" means what? It's printing nothing to the OLED? It's printing things but getting the values wrong? Please be more specific.
    – Majenko
    Jan 20, 2021 at 15:21
  • it has nothing to do with how the I2C connection is wired on the Base shield. run the I2C scanner sketch to see the devices I2C addresses
    – Juraj
    Jan 20, 2021 at 15:45
  • 1
    @Juraj Still the same output. OLED won't work :( Jan 21, 2021 at 1:40
  • 2
    @RowanP Thank you for clearifying and for reminding me of what I what to do last evening. I completely forgott :-(. The BMP280 and Oled speed capabilities can be the same but as the Pressure lib and the Oled lib both use the Wire lib when they initialize, there may be a side effect if both specify different speeds. It is just a guess. Perhaps the Wire lib gets confused. Jan 24, 2021 at 13:41
  • 2
    I opend an issue on github. I think there is a problem with the Oled constructor. github.com/arduino-libraries/Arduino_SensorKit/issues/15 If i'm right, the clock of the 'I2C bus resets the OLED. If Pressure is active the I2C clock is active. -> reset the Oled. Tada. ;-) Jan 25, 2021 at 19:04

1 Answer 1


About two weeks ago there was a change in the Arduino_SensorKit Library that introduced an error with the instanciation of the Oled object.

I found the error in the release (v1.0.6) of the library. The previous release (v1.0.5) could cause another issue, as it uses a software I2C. I doubt the hardwired sensores are connected with the correct pins. But I have no hardware, so I can not check this.

I propose a workaround to see, if the identified issue caused your observations.

#include "Arduino_SensorKit.h"

U8X8_SSD1306_128X64_NONAME_HW_I2C Oled2;
// if the line above does not work
// comment it and uncomment the following line.
// U8X8_SSD1306_128X64_NONAME_HW_I2C Oled2(U8X8_PIN_NONE);

void setup() 


void loop() 
  Oled2.setCursor(0, 10);
  Oled2.print("Temp: ");
  Oled2.print(" C");


Could you please try out and report your experience. If it would work, I can support the fixing of the issue.

  • It works! OLED just keeps blinking but it shows the output now! The blinking could be fixed by changing Oled2.clear() to Oled2.refreshDisplay(). Thank you so much! Jan 28, 2021 at 13:19
  • 1
    You're welcome. Meanwhile I got feedback from marqdevx. He is about to release a new version of the lib. I think as soon as it is available, this workaround is not necessary furthermore (<- don'T know if this is an english word. But it sounds good ;-) ). As soon as the new revision is available I'll edit my answer and add your "blinking" solution too. Cheers! Jan 28, 2021 at 13:30
  • FWIW, I had the same issue with the latest version at the time - 1.0.10, and this fixed it. I have no idea what this does but it fixed it. Oct 4, 2023 at 14:08
  • @davetron5000 Thank you for this comment. I completely forgot about this topic. I just remember that I waited for the new release and it had last longer then I expected. And then the topic get's out of my view ;-). I simply forgott it. In the very Moment I have not the time to look after it. Perhaps if I find some time in November I check what happend with the fix. It's in my calender. Oct 7, 2023 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.