BMP280 and MS5611 Barometric sensors wont initialise after a while

Hi,

I've got a project that uses Barometric sensors BMP280 and MS5611 (separately) running on Arduino Nano and, to begin with, they initalise perfectly well, but after some use they refuse to start. (eg.ms5611.begin(); fails and hangs)

I thought it was just the BMP280 at first but I tried MS5611 and the same happened.

Is it possible I've fried them? and if so should I be using a resistor somewhere?

Any help appreciated.

Everything is possible.
Maybe you fried them (did you connect them both to 3.3V and used level shifters on the I2C lines? Or 5V but your breakout boards have level shifters and regulators on board?).
Maybe you don't have pull-ups on your I2C lines (usually included on breakout boards).
As you see I'm assuming you use breakout boards, but I may be wrong there. With you not providing all info needed (as you can read in the sticky) that's all I can say about it.

Thanks for responding.

Well, I'm a relative newbie so anything IS possible. :slight_smile:

First off, I didnt use any resistors before the MS5611, or Level shifters. (do I always need a level shifter??)

By Breakout board I assume you mean the board with the actual sensor on it plus other components? Like a GY63?
But I thought all the resistors necessary for the board to function would be included on it?

The only other thing I've found on the manual is the need for a 100nf capacitor, which I also didnt use!

any input gratefully received.

You will normally have a breakout board, as the sensors themselves are very hard to deal with otherwise. Such breakout boards almost certainly contain pull-up resistors for I2C and filtering/decoupling caps as required.

Both sensors are designed to work at 3.3V and are likely to be destroyed if connected to 5V directly, either through the power supply or the I2C lines.

The GY63 as I found with a quick Google search has level shifters and regulator on board, so that one would be OK to connect to 5V supply.

So if I have pullup resistors and Level shifters on the breakout board, it would appear that all I was missing is the 100nf capacitor?

Could this be the reason I've fried the sensor?

skyboyflyboy:
First off, I didnt use any resistors before the MS5611, or Level shifters. (do I always need a level shifter??)

only in case you are using just sensor. in case if you are using sensor module then the most of the module have on board pull up resistor
and use the same supply to both the sensors and controller eg incase you are using ardduino nano then use 5V and in case of ESP8266 use 3.3 volts.

  1. You may have a problem with the code also first of all check that your requesting the same address or not for this scan the available I2C for eg for BMP it is 0x76. for this you can perform following I2C scan.
#include <Wire.h>
 
 
void setup()
{
  Wire.begin();
 
  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}
 
 
void loop()
{
  byte error, address;
  int nDevices;
 
  Serial.println("Scanning...");
 
  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
 
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
 
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
 
  delay(5000);           // wait 5 seconds for next scan
}

if you are not getting the address then you might have burnt your sensor module. in case you are getting right address values then You are good to go. Go to this github link BMP280/Arduino/BMP280.ino at master · ControlEverythingCommunity/BMP280 · GitHub to get the code for BMP280 I2C interface. Even for MS5611 you can get it in the same repohttps://github.com/ControlEverythingCommunity.

Thanks vbshightime.

I am using I2C but my code currently does not specify an actual address. And , like I said, it worked for a few days then stopped.

so you're saying, if I get the address wrong it will burn the sensor?

What about the decoupling capacitor? Should I still add the 100nf Capacitor?

That capacitor is most likely on your board already, together with the other capacitors the regulator needs.

Are all the pins soldered in properly?

The solder looks fairly robust.

I just feel that I'm missing something fundementally important, since this has happened twice with the BMP280 and MS5611 on two separate projects on Arduino Nano.

Looking at the code, it's failing at ms5611.begin();

Or is there some kind of reset I could do on the sensor?

basically it just hangs there forever...

Also, in the code examples here:

there is no mention of I2C addresses? (as in BMP280 code)

It just works.... for a while... then fails....

skyboyflyboy:
so you're saying, if I get the address wrong it will burn the sensor?

What about the decoupling capacitor? Should I still add the 100nf Capacitor?

No, It will not and never. but giving a wrong pull up can like a strong pull up, using small resistor values for pull up or giving high voltages.

  1. decoupling capacitor is kind of your local energy reservoir. we connect it just in parallel to a power supply
    to prevent any kind of unnecessary voltage spikes and noises.

skyboyflyboy:
Should I still add the 100nf Capacitor?

  1. Yeah, You may add a small value 100nF will be good.

Thanks vbshightime,

Just want to keep this thread going so I fully understand.

If I am adding a 100nf capacitor, should i connect it "across" the GND and 5V pins?

The only other thing that I have done in both these cases of failed sensors is that I initially soldered the pins on the sensors and then "unsoldered" them and then resoldered them on to a veroboard.
Could the excess heat from the soldering iron have burnt the sensor if I spent too long unsoldering them?

thanks

Instead of going with a sensor just use a sensor module, They have internal pullup resistors, better voltage regulation etc. You can find it here

still, you want to get it done by old ways then connect your capacitor just parallel to your 5v supply