Skip to main content
Visitor II
February 23, 2021
Solved

LIS2DW12 activity/inactivity power consumption too high when inactive

  • February 23, 2021
  • 4 replies
  • 3708 views

Hello,

I am using the LIS2DW12 accelerometer using Zephyr OS.

Driver code is https://github.com/zephyrproject-rtos/zephyr/tree/master/drivers/sensor/lis2dw12

I configured the chip as follow: ODR is 12_5Hz

lis2dw12_reset_set(ctx, PROPERTY_ENABLE);
lis2dw12_reset_get(ctx, &rst);
lis2dw12_block_data_update_set(ctx, PROPERTY_ENABLE);
lis2dw12_full_scale_set(ctx, LIS2DW12_2g);
lis2dw12_power_mode_set(ctx, LIS2DW12_CONT_LOW_PWR_12bit);
lis2dw12_data_rate_set(ctx, LIS2DW12_XL_ODR_12Hz5);
lis2dw12_all_on_int1_set(ctx, 1);
 
 
lis2dw12_act_mode_set(pLis2dw12->ctx, LIS2DW12_DETECT_ACT_INACT);

Where the act_mode_set is

lis2dw12_read_reg(ctx, LIS2DW12_WAKE_UP_THS,(uint8_t*) &wake_up_ths, 1);
lis2dw12_read_reg(ctx, LIS2DW12_WAKE_UP_DUR,(uint8_t*) &wake_up_dur, 1);
wake_up_ths.sleep_on = (uint8_t) val & 0x01U;
lis2dw12_write_reg(ctx, LIS2DW12_WAKE_UP_THS,(uint8_t*) &wake_up_ths, 1);
wake_up_dur.stationary = ((uint8_t)val & 0x02U) >> 1;
lis2dw12_write_reg(ctx, LIS2DW12_WAKE_UP_DUR,(uint8_t*) &wake_up_dur, 1);

I can successfully detect ACTIVITY and INACTIVITY with the following configuration

lis2dw12_filter_path_set(ctx, LIS2DW12_LPF_ON_OUT);
 lis2dw12_filter_bandwidth_set(ctx, LIS2DW12_ODR_DIV_4);
 
lis2dw12_wkup_dur_set(ctx, duration);
lis2dw12_act_sleep_dur_set(ctx, sleep);
lis2dw12_wkup_threshold_set(ctx, wakeup);
lis2dw12_wkup_feed_data_set(ctx, LIS2DW12_HP_FEED);
 
lis2dw12_registerCb(handler, trigger);

However, when the device enters in the INACTIVITY mode, I see power consumption rising from 600uA to 800uA, giving an increase of ~200uA. It should take the It looks like the LP_MODE and MODE of the CTRL1 register are not taken into account. However, when the device is moving (ACTIVITY), the power consumption is going down again.

0693W000007ZGcTQAW.pngI guess something is wrong in the configuration but I cannot find what. Documentation says that if the STATIONARY field is set, the Inactivity and Activity timer are using the values configured by default, but I don't think it is the case, the device seems to be consuming like it is in High Performance.

Thanks

    This topic has been closed for replies.
    Best answer by FDepr.1

    Hello Eleon,

    I now use lis2dw12_int_notification_set(ctx, LIS2DW12_INT_PULSED);

    To make sure the interrupt is not latched by setting LIR of CTRL3 to 0.

    It did not help the power consumption increase when we are in activity to inactivity state. I do not understand why the pin is always set to 1 in motion (activity). In any case, as the device will be mostly inactive, I prefer to overconsume when it is in motion :)

    I now use the HP as it seems better :)

    I just checked and STATUS indicates the correct ODR.

    Florian

    4 replies

    ST Employee
    February 24, 2021

    Hi @FDepr.1​ ,

    in the Stationary/Motion recognition case you don't change the ODR and the function mode, so the device will have a similar consumption before and after the interrupt.

    It should be different in the case of the Activity/Inactivity recognition... Did you referred to the standard C drivers for ST sensors on Github for your code (for example lis2dw12_activity.c), or to the application note AN5038 p.31?

    Since however the consumption is a little high, I would also check the correctness of the board schematic. In particular, how is the SA0 pin connected? By default it is an input with internal pull-up, so if you tied it to GND there could be over-consumption coming from this configuration. As stated in the same app note p.2, unfortunately internal pull-up on SDO/SA0 pin cannot be disabled: do not connect this pin to GND in low-power applications

    Can you please check if this is your case?

    -Eleon

    FDepr.1Author
    Visitor II
    February 24, 2021

    Hello Eleon,

    Thanks for your prompt reply!

    I used the references you gave for the code but mostly had a look at the Github.

    I just checked and the SDO/SA0 and it is unconnected on the board. I missed that in the documentation. Would it be the root cause of this 200uA difference?

    0693W000007ZOF3QAO.pngWhy does this generates only an increase when the accelerometer is not moving (Inactive state)?

    Florian

    ST Employee
    February 25, 2021

    Hi Florian @FDepr.1​ ,

    it should not be the case, since if it is left unconnected it should be pulled high by internal pull-ups.

    Which current consumption are you experiencing just after the power on of the LIS2DW12, just to check whether it is a matter of hardware connection or device configuration? Just after the boot the device is in power down and should consume less than 1uA.

    Consider also that the CS pin is internally pulled up (datasheet, p.6), so if you are lowering it for the SPI communication you could experience an over-current consumption.

    -Eleon

    FDepr.1Author
    Visitor II
    February 25, 2021

    Hello @Eleon BORLINI​ ,

    I forgot to add that we are using the I2C mode, not the SPI. The CS is connected to VCC_3V0 so it should always be on.

    When we boot the device, consumption is low for 41 seconds (600uA), then the accelerometer enters in INACTIVITY mode and we see this power raise. When I move the device, the power goes back to the expected value.

    Florian

    ST Employee
    February 25, 2021

    Hi Florian,

    then you might experience an extra consumption from the pull-up resistors on the I2C lines (that I cannot see in your schematic but that they are mandatory if you use the I2C interface). These resistors have to be connected to the VddIO line (a common value is 10kOhm).

    In particular, if your Vdd and VddIO are tied together and you measure the current consumption on the Vdd node, during the I2C commutations you'll see also the current flowing from the VddIO through the pull-up resistors.

    Do you experience the overconsumption just after the device startup?

    -Eleon

    FDepr.1Author
    Visitor II
    February 25, 2021

    Hello Eleon,

    We have 2 pullup resistors of 10kOhm, one on both lines of the I2C which are connected to the VCC_3V0.

    When we start, we do not have overconsumption, it seems that the accelerometer is in the ACTIVITY state and after the 41 seconds of INACTIVITY we go back into the INACTIVITY mode and we overconsume.

    Florian