interface Arduino I2C with multiple sensors

Hi 

I am trying to building a flight controller with Arduino

for that, I need a magnetometer and barometric altimeter

http://www.sparkfun.com/products/9694.....................Altimeter

http://store.diydrones.com/HMC5843_Triple_Axis_Magnetometer_p/br-hmc5843-01.htm...Magnetometer

 

The problem is communication to both sensors are via I2C, is this possible with the ArduinoMega, which only has pin 20 and 21 assigned for I2C

 

i got this from another tutorial forum: "I2C is a bus, with multiple slave devices on a single pair of wires. You can chain a number of devices off the same pair of wires, up until you exceed the 400 pF total capacitance of the combined inputs on your devices as well as the total length of cables."

Does this mean I should make Arduino the master and the two sensors slaves?

 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • so how will the master distinguish between which slave device it wishes to read from?

    I saw a fn from the Arduino Wire library calle Wire.begin(address)

    i'm guessing address should contain the address of my magnetometer and altimeter?

    if so how do I find this address

  • Developer

    Yes, I think it will work.  I2C is a bus and each slave as an address and it should ignore messages sent to other addresses.

     

    As you say, the arduino would be the master and the two sensors the slaves.

     

    If you want to hitch them up using those you can use the i2c splitter from the diydrones store.  Note that this is only useful if you want to use gps connectors to attach the sensors.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…