Go Down

Topic: Using MS5611 pressure sensor with SPI protocol (Read 97 times) previous topic - next topic

adwait_bhope

Hello,

I have an MS5611 sensor with GY-63 breakout board. On many websites it is listed that it can be operated with an SPI as well as an I2C interface.

Here for example.

I can find many tutorials and sample codes to use it with I2C, but I need to use it with SPI, as I've read that SPI is faster, and can provide a higher sampling rate.

Is there anyone who has had experience with MS5611 with SPI? How do I use it?

pylon

As you didn't specify otherwise I expect you to use an Arduino UNO. The UNO works at 5V so to work with this 3.3V device you have to use a level converter (at least for the SPI interface, the I2C interface may work without it).

Provide schematics for your module! It looks like it includes a voltage regulator, decoupling capacitor and the I2C pull-ups. If this guess is correct you have to modify the board to use SPI (remove the pull-ups). The PS line has to be pulled low, SDI is MOSI, SDO is MISO and SCKL is SCKL.CSB is the chip select line, choose an appropriate GPIO on the Arduino.

Quote
but I need to use it with SPI, as I've read that SPI is faster, and can provide a higher sampling rate.
No, it cannot provide a higher sampling rate, just a higher read out rate. The sampling rate is limited to 2kHz by the chip internals (at the lowest accuracy) and you should be able to read at about that rate with I2C. What kind of pressure are you trying to read that needs such a high sampling rate?

adwait_bhope

Thanks for your reply @pylon.

Yes, sorry, I'm using an Arduino UNO.

I'm using the chip for a quadcopter we're working on, and it needs an Altitude Hold mode. Anyway, I didn't know the sampling rate is as high as 2kHz. Wouldn't need that much so I think I2C will do fine and I'll go with it.

Since you mentioned lowest accuracy, how do I increase accuracy? If the sampling rate isn't very low at high accuracies, the trade off will be definitely worth it.

Also, can you mention the source for your information?

Thanks.

pylon

Quote
Also, can you mention the source for your information?
The datasheet of the chip.

There you also can find the information of how to change the oversampling rate but with the highest accuracy the sampling rate decreases to about 100Hz. I guess this is more than enough for a quadrocopter altitude hold mode.


Go Up