1
\$\begingroup\$

I have a quadcopter flight controller (RTFQ Flip MWC) that supports I2C sensors for adding thing like a barometer, magnetometer, and GPS system. The officially supported sensor block (BMP180, HMC5883L on one board) is discontinued, as far as I can tell.

I have found other I2C barometer and magnetometer sensors, (BMP280, LSM303) but I am not even sure if all I2C devices of the same type are interoperable. Do they all look the same (at least interface-wise) to the flight controller?

I'm also new to I2C in general; the sensors I need come on two separate boards. Do I just stack the boards, directly connecting the I2C bus between each?

Thanks in advance, Neil

EDIT: I was able to find the datasheets for the discontinued and proposed sensors:

All are compatible with the 3.3v output of the Flip MWC, which is good.

I was quickly able to find what I believe to be the register map for the BMP180 and HMC5883L, but the table I found for the LSM303 was very confusing and I wasn't able to find one in the BMP280 datasheet.

\$\endgroup\$
5
  • \$\begingroup\$ I wouldn't assume they are. Surely you can compare datasheets to find out? \$\endgroup\$
    – user16324
    Jan 25, 2018 at 17:02
  • \$\begingroup\$ @BrianDrummond What specs would I be looking to compare between datasheets? Pinout? \$\endgroup\$
    – ifconfig
    Jan 25, 2018 at 17:19
  • 2
    \$\begingroup\$ Register maps and data formats. If they contain different data, or different I2C addresses, or the registers are at different internal addresses, etc, you can't use them without rewriting the flight controller software. \$\endgroup\$
    – user16324
    Jan 25, 2018 at 17:21
  • 2
    \$\begingroup\$ Or if they operate on a different voltage. For example, you probably can't connect an I2C sensor powered by 5 V to a controller powered by 3.3 V, without adding a voltage translator circuit. \$\endgroup\$
    – The Photon
    Jan 25, 2018 at 17:30
  • 1
    \$\begingroup\$ Pinout is the one thing the doesn't matter for compatibility on the bus. Pinout only matters if you are looking for a direct drop-in replacement that has to fit on existing pads. \$\endgroup\$ Jan 25, 2018 at 20:40

1 Answer 1

3
\$\begingroup\$

The only way to know if two IIC devices are compatible in this context is to compare their IIC interface in the two datasheets very carefully. IIC may be largely standard, but it says nothing about the payload data carried over IIC.

If a particular product becomes popular, competitors will often make theirs compatible. However, there is no guarantee that any two devices are compatible. Each could use a different format for sending the data, require different settings in different registers that are accessed differently to select features, etc.

Unless you know they are compatible, assume they are not.

\$\endgroup\$

Your Answer

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

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