both boards want to connect to the same pins SDA (A4), SCL (A5)
Dear All,I am asking your help and guidance because after searching the internet I was not satisfied with what I found. (Probably my searching skills are not good enough)I would like to connect both a gyroscope sensor and a magnetometer to an arduino(uno, nano, micro, mega, I have at hand). Final goal is to get out two data: azimuth and elevation. Azimuth from the magnetometer and elevation from the gyroscope one of the axis. Rest of the data I am not interested.I already have these boards at home - now of course I see that there are single boards that can do that like MPU-9255 but I don't have that.Problem is when I started reading about how to connect them to the arduino both boards want to connect to the same pins SDA (A4), SCL (A5) and I don't have the experience how to solve this. I found two different wirings (one is incomplete) but they are different.https://forum.arduino.cc/index.php?topic=457129.15andhttps://camo.githubusercontent.com/708e8d3eb17afe97128fadb9d66590aa7b605678/687474703a2f2f64656c706869722e636f6d2f61726475696e6f2f494d475f343336322e6a7067Can you help me with the wirings and how to access the values?I found a lot of information on how to connect and access data from a gyroscope or a magnetometer but when they are both present I didn't find much information.Thank youRobert
If you have followed this connection diagram (Fig-1), then the I2C addresses of:MPU6050 is: 0x69HMC8883L is: 0x68You need to edit the MPU6050.h Library to set the address of the device at 0x69.Fig-1:This is the Library I use for MPU6050.
4.14 Register 55 - INT Pin / Bypass Enable Configuration INT_PIN_CFG I2C_BYPASS_EN When this bit is equal to 1 and I2C_MST_EN (Register 106 bit) is equal to 0, the host application processor will be able to directly access the auxiliary I 2C bus of the MPU-60X0. When this bit is equal to 0, the host application processor will not be able to directly access the auxiliary I2C bus of th
4.8 Registers 37 to 39 - I 2C Slave 0 Control I2C_SLV0_ADDR, I2C_SLV0_REG, and I2C_SLV0_CTRLI2C_SLV0,1,2,3 and I2C_SLV4 are used to send and receive data from the Secondary i2c bus. and store it in the 4.20 Registers 73 to 96 - External Sensor Data EXT_SENS_DATA_00 through EXT_SENS_DATA_23 Description: These registers store data read from external sensors by the Slave 0, 1, 2, and 3 on the auxiliary I2C interface. Data read by Slave 4 is stored in I2C_SLV4_DI (Register 53). External sensor data is written to these registers at the Sample Rate as defined in Register 25. This access rate can be reduced by using the Slave Delay Enable registers (Register 103). External sensor data registers, along with the gyroscope measurement registers, accelerometer measurement registers, and temperature measurement registers, are composed of two sets of registers: an internal register set and a user-facing read register set. The data within the external sensors' internal register set is always updated at the Sample Rate (or the reduced access rate) whenever the serial interface is idle. This guarantees that a burst read of sensor registers will read measurements from the same sampling instant. Note that if burst reads are not used, the user is responsible for ensuring a set of single byte reads correspond to a single sampling instant by checking the Data Ready interrupt. Data is placed in these external sensor data registers according to I2C_SLV0_CTRL, I2C_SLV1_CTRL, I2C_SLV2_CTRL, and I2C_SLV3_CTRL (Registers 39, 42, 45, and 48). When more than zero bytes are read (I2C_SLVx_LEN > 0) from an enabled slave (I2C_SLVx_EN = 1), the slave is read at the Sample Rate (as defined in Register 25) or delayed rate (if specified in Register 52 and 103). During each Sample cycle, slave reads are performed in order of Slave number. If all slaves are enabled with more than zero bytes to be read, the order will be Slave 0, followed by Slave 1, Slave 2, and Slave 3.