Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMI160 Sensor turning off and not recovering

    BMI160 Sensor turning off and not recovering

    New Poster

    Hi all

    I am using BMI160 in my application to sense motion. It's in a PCB where the main Micro controller is a Nordic nRF52833. I am using the BMI160 to wake the MCU up through interrups such as double tap. I am experiencing a strange behaviour. See below the flow of events in a continous loop:

    1. MCU in sleep mode, BMI160 accelerometer in Low power mode and Gyro in Suspend mode (I only need the accelormeter to use the interrupts). The setting of the accelerometer are: BMI160_ACCEL_ODR_100HZ, BMI160_ACCEL_RANGE_2G and BMI160_ACCEL_BW_NORMAL_AVG4. 
    2. Double tap the PCB -> MCU wakes up -> set the BMI 160 in Normal mode (both acceleormeter and gyro) in order to recorder the motion and process the data. 
    3. When data processing is finished, MCU goes back to sleep mode and so the BMI160 back in Low power mode (accelerometer in low power and gyro in suspend mode)

    The issue I am facing is after running this loop a few times (about 8 times), the BMI160 seems to stop operating - ie I don't get any interrupts from the sensor. To prove this, I set the BMI160 accelerometer in Normal mode all the time (even when MCU is in sleep mode). In this case, I don't see the described issue. 

    Is this a known issue? Is there any explanation to this behaviour? Am I doing something wrong? 

    PS: The reason I am switching the BMI160 into low power mode when the MCU is in sleep mode is to save the energy usage. My PCB is powered by a battery that I need to make sure it doesn't drain quickly.

    Many thanks for you support in advance

    Kind regards

    4 REPLIES 4

    Community Moderator
    Community Moderator

    Hello Katie2020,

    In another ticket, there was discussion of BMI160 TAP:
    ODR should be equal and more than 200 Hz, otherwise TAP will be not triggered.

    Many thanks for your feedback. 

    I am using 2 interrupts from the BMI160: double tap and flat detect. What would be the best configuration for 2 interrupts? Do they need to be on 2 different channels? Could this be a problem?

    I noticed that flat detect is not triggered either when the BMI160 is in Low power mode. It's behaving like double tap. Could this be a setting problem? Using the sensor at 200Hz didn't help.

    I also would like to clear and re-configure the interrupts before switching to sleep mode. How can I do that? Can you please share the code for re-configuration and clearning of interrupts? 

    Thank you very much for your support. 



    Could you please provide a feedback to my last questions?

    Many thanks


    Community Moderator
    Community Moderator

    Hello Katie2020,

    TAP and flas interrupt could be mapped to one INT pin.

    All features could be supported under low power mode. But for sleep mode(suspend with ACC) it has lowest power consumption, but features were not supported.
    If you want to swith to sleep mode, you could write register value to archieve it.
    #define BMI160_ACCEL_NORMAL_MODE UINT8_C(0x11)
    #define BMI160_ACCEL_LOWPOWER_MODE UINT8_C(0x12)
    #define BMI160_ACCEL_SUSPEND_MODE UINT8_C(0x10)

    /* Gyro power mode */
    #define BMI160_GYRO_SUSPEND_MODE UINT8_C(0x14)
    #define BMI160_GYRO_NORMAL_MODE UINT8_C(0x15)
    #define BMI160_GYRO_FASTSTARTUP_MODE UINT8_C(0x17)

    /* Set the sensor configuration */
    rslt = bmi160_set_sens_conf(dev);