This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

About energy-saving point of view, and the most optimal way to proceed in

Hello Nordic Team,

I have a question about energy conservation that we want to implement and how we want to make it as optimal as possible.

For our application and its use, we would like our Bluetooth module to be activated only for 1 minutes (Period during which, our object is connectable from the smartphone and once connected the interaction is possible). After our connected object detects a Shake, Bluetooth is broadcasted and at the end of this minute the connected device is disconnected and the Bluetooth will be muted and the object enters standby.

To do so I saw the existence of the primitives given by the SoftDevice: sd_ble_gap_disconnect, sd_ble_gap_adv_stop, sd_power_system_off, …

In order to detect this Shake we have implemented a MEMS Accelerometers and our choice is stopped for our PCB on a LIS2DH12.

Now with acceleration library we are able to detect a shake event, by what, able to call a method movementDetected() for example. And put in this function the primitives that will wake up the BT and the escape the power_manage()

So my question is from an energy-saving point of view, is this the most optimal way to proceed?

Because with what is described above, the Nordic will have to continuously scrutinize values extracted from the MEMS and I imagine, it expensive in resources per cycle. Would not there be a better way to do since the MEMS is directly connected with the Interrupts, INT1, INT2 on the NRF52?

Can MEMS not be programmed, alone, to detect the Shake and wake the Nordic in the most optimal way?

Thank you for your best advice,

  • As you suggested, the best way is to connect INT1 output of LIS2DH12 to nRF52 input. Program LIS2DH12 so that signal will be generated on INT1 as soon as shake event recognised by LIS2DH12. Program nRF52 input to wake CPU from deep sleep on level change on that input. We did the same on our product. Works fine. To save you time here is data we program to LIS2DH12 addr<-value: 0x20<-0x4F,0x21<-0x01,0x22<-0x40,0x23<-0x00,0x24<-0x0A,0x25<-0x20,0x30<-0xAA,0x32<-0x02,0x33<-0x01

  • Hi all,

    Indeed from what it emerges, thank you for your good preconization ! I will do that.

    Thanks David and Alex for your sample extract of code regarding your configuration of LIS2DH.

    I tried to apply it strictly, but in order to really have a relevant result with regard to a shake (for example a flick in the desk).

    I have to mix with a post example that I find on the forums of ST: community.st.com/.../37167-lis2dh-accelerometer-interrupts

    To be concise here is the result of what I program on my LIS2:

    extern LIS2DH12_Ret LIS2DH12_setToGeneratedSignalOnINT1asSoonAsShakeEventRecognisedMode() {
    
        LIS2DH12_Ret retVal = LIS2DH12_RET_OK;
    
        retVal |= writeRegister(LIS2DH_CTRL_REG1,       0x4F    /*_0x7F*/     );      // 79
        retVal |= writeRegister(LIS2DH_CTRL_REG2,       0x01    /*_0x00*/     );      // 1
        retVal |= writeRegister(LIS2DH_CTRL_REG3,       0x40    /*0x40*/      );      // 64
        retVal |= writeRegister(LIS2DH_CTRL_REG4,       0x00    /*_0x80*/     );      // 0
        retVal |= writeRegister(LIS2DH_CTRL_REG5,       0x00    /*_0x00*/     );      // 10
        retVal |= writeRegister(LIS2DH_CTRL_REG6,       0x00    /*_0x00*/     );      // 32
    
        retVal |= writeRegister(LIS2DH_INT1_CFG,        0xAA    /*_0x04*/     );      // 170
        retVal |= writeRegister(LIS2DH_INT1_THS,        0x02    /*_0x0F*/     );      // 2
        retVal |= writeRegister(LIS2DH_INT1_DURATION,   0x01    /*0x01*/      );      // 1
    
        return retVal;
    }
    
Related