TroubleshootingArduino

BMX160+BMP388 Address Problem

userHead Max-Luca.Steinkamp 2024-02-16 21:35:52 498 Views3 Replies

Hi,

 

im using the BMX160+BMP388 to get some data about wavemovements. 

I also use an RTC DS3231 (0x68). The default address of the BMX160 ist 0x68 and I physically changed it to 0x69.

With the RTC connected, the sensor getting bad data. If i disconnect the RTC, the BMX160 is not initialising.

I think its initialising on the address 0x68. I tried to change the i2C address in the headerfile but the problem is still there.

How can I solve this problem?

 

Many thanks for your answers.

 

Best regards

Max Steinkamp

2024-02-18 19:19:19

Hello,

thank you for your answer. I scanned it and this is the output (not welded):

Scanning...

I2C device found at address 0x68  !

I2C device found at address 0x76  !

done


 

If i weld it to change the address its:

Scanning...

I2C device found at address 0x69  !

I2C device found at address 0x76  !

done


 

So its changing but while initialising its only working for 0x68. I need to make it work with 0x69.

Much thanks

userHeadPic Max-Luca.Steinkamp
xingzhao.zhu wrote:

You can try to change this address in the DFRobot_BMX160.h file to 0x69 

 

2024-02-19 13:32:28
1 Replies
2024-02-18 16:35:19

Hello,

 

Have you tried to use an I2C scanning program to check the changed I2C address? If you are using Arduino IDE, you can try the following code. 

 

 

#include <Wire.h> // Include the Wire library for I2C communication

// Setup function initializes the serial communication and I2C
void setup() {
 Serial.begin(9600); // Initialize serial communication with a baud rate of 9600
 Wire.begin(); // Initialize the I2C communication
 
 Serial.println("Start I2C address scan"); // Print a message to indicate the scan is starting
}

// Loop function continuously scans for I2C devices
void loop() {
 byte device_address; // Variable to store the I2C device address
 int nDevices; // Variable to store the number of devices found

 // Search for devices on the I2C bus
 nDevices = Wire.scan(); // Perform the scan and store the number of devices found

 // Print the number of devices found
 Serial.print("Number of devices found: ");
 Serial.println(nDevices);

 // Loop through all the devices found
 for (int i = 0; i < nDevices; i++) {
   // Get the address of the current device
   device_address = Wire.getDeviceList();

   // Print the device address
   Serial.print("Device address: ");
   Serial.print(device_address, HEX); // Print the address in hexadecimal format
   Serial.println(" (0x"); // Print a prefix to indicate hexadecimal format
 }

 // Wait for a few seconds before scanning again
 delay(5000);
}
 

userHeadPic xingzhao.zhu