I'm trying to get data from two MS5611 pressure sensor using I2C & SPI communication protocols combined with GPS data. At first, the data fluctuates normally without connecting GPS. But the data of SPI fluctuates unusual(pressure change up to 30 pa).I use ublox neo 7m GPS modulus.
Does that mean that one sensor is on the I2C bus and the other on the SPI bus? Why not both on the same bus?
What is powering your circuit? Which Arduino are you using?
Please post a picture of your wiring or (preferably) a schematic and your code. Please read the "How to use the forum-Please read" stickies to see how to format and post code.
Yes, one sensor is on I2C bus, and the other is on SPI bus. I use mega 2560. Since there is only one pair of I2C communication pins, I use SPI to get data from the second sensor. The power is supplied by computer. The sketch, datasheet, and library(the link) I used is posted below. I connect pin 53 to CSB of sensor and use pin 10 and 11 as RX and TX connectes to GPS respectively.
I think that you don't understand the concept of the bus. The SPI and I2C busses are made to take multiple devices, on their respective bus, in parallel. The I2C bus distinguishes individual devices by their address. The SPI bus distinguishes individual devices by their chip select pin. So both of the pressure transducer modules can be on the same pins (with the exception of the CS pins for SPI). SPI has SCLK, MOSI, MISO in to each part plus a CS pin for each. I2C has SDA and SCL in parallel to each device (don't forget the pullups). The data sheet, on pages 6 and 7, tell how to set the device to use which bus (PS pin) and how to address 2 modules using I2C.
Thanks for your response. I'll modify the sketch and try to communicate with both the sensors using I2C. So the problem is that I shall use the same protocol?