Ultrasonic I2C problems



  • I have a problem with the I2C version of the Ultrasonic distance measuring unit. If I connect it together with the MLX90640 Thermal Camera Unit the Camera data is corrupted. If I load and run the Demo and only connect the Ultrasonic distance measuring unit every other sample has the distance 4500mm. If I use this code it works fine in the demo but still corrupts the Thermal camera

    uint32_t data;
    Wire.beginTransmission(0x57); // Transfer data to 0x57.
    Wire.write(0x01);
    Wire.endTransmission(); // Stop data transmission with the Ultrasonic Unit.
    delay(120);
    Wire.requestFrom(0x57,3); // Request 3 bytes from Ultrasonic Unit.
    data = Wire.read();data <<= 8;
    data |= Wire.read();data <<= 8;
    data |= Wire.read();



  • It seems if I set the i2c rate to 100Khz this works.