cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DW12 activity/inactivity power consumption too high when inactive

FDepr.1
Associate II

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

13 REPLIES 13

Hi Florian,

glad to hear you made some progression!

Ok so you are now basically setting the INT pin polarity high when you are in inactivity state, as in the default interrupt configuration, right?

Can you please check if your interrupt is latched? The latched signal might cause an overconsumption during the time it is in the opposite condition of the default. The LIR bit of CTRL3 (22h) should be set to 0.

Let me please answer to your previous questions for completeness:

>> The HP filter is not enabled. Should it be enabled?

It should work also with the HP disabled, which is the default condition. Usually the HP filters unwanted DC signals, improving the accuracy of the event detection, but should indeed not impact the current consumption.

>> How can I check that? Should I read the registers in the inactivity state?

You can poll the DRDY bit of STATUS (27h) register and check the frequency with which it changes. This determines the ODR and, if it is about 12.5Hz, you'll be sure to be in low power.

-Eleon

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

I just checked, and it seems that the MCU had some pullup on the pins used for the irq. Now the consumption is fine 🙂

Thanks for your support.

That's great Florian!

We can now close the case, if it's ok 😊

-Eleon