cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DW12 high current consumption

APaan.1
Associate II

Hi,

We have STMicroelectonics LIS2DW12 accelerometer on our custom board which has nRF9160 SiP from Nordic Semiconductor and we are using the nRF Connect SDK which runs on Zephyr OS. Here are the LIS2DW12 driver codes of the nRF Connect SDK / Zephyr: https://github.com/nrfconnect/sdk-zephyr/tree/v2.4.99-ncs1/drivers/sensor/lis2dw12

The configuration of the LIS2DW12:

Interrupt pin: INT2

Accel range / full scale: 2G

ODR: 1.6Hz

Power mode: Low Power Mode 1

Low noise: Disabled

Stationary/motion: Enabled

VDD & VDD_IO: 3.0V

0693W00000AMew4QAD.png 

Our problem is that our board is consuming a lot of power when we are using the LIS2DW12. If we fully disable LIS2DW12, the consumption is about 20µA and when it's enabled the consumption is around 200uA.

We read all the registers after the trigger is set and they seem to be fine:

reg: d 		dataDEC: 128 	dataBIN: 1000 0000
reg: e 		dataDEC: 253 	dataBIN: 1111 1101
reg: f 		dataDEC: 68 	dataBIN: 0100 0100
reg: 20 	dataDEC: 16 	dataBIN: 0001 0000
reg: 21 	dataDEC: 12 	dataBIN: 0000 1100
reg: 22 	dataDEC: 0 	dataBIN: 0000 0000
reg: 23 	dataDEC: 0 	dataBIN: 0000 0000
reg: 24 	dataDEC: 64 	dataBIN: 0100 0000
reg: 25 	dataDEC: 0 	dataBIN: 0000 0000
reg: 26 	dataDEC: 253 	dataBIN: 1111 1101
reg: 27 	dataDEC: 33 	dataBIN: 0010 0001
reg: 28 	dataDEC: 32 	dataBIN: 0010 0000
reg: 29 	dataDEC: 34 	dataBIN: 0010 0010
reg: 2a 	dataDEC: 32 	dataBIN: 0010 0000
reg: 2b 	dataDEC: 8 	dataBIN: 0000 1000
reg: 2c 	dataDEC: 96 	dataBIN: 0110 0000
reg: 2d 	dataDEC: 53 	dataBIN: 0011 0101
reg: 2e 	dataDEC: 0 	dataBIN: 0000 0000
reg: 2f 	dataDEC: 0 	dataBIN: 0000 0000
reg: 30 	dataDEC: 0 	dataBIN: 0000 0000
reg: 31 	dataDEC: 0 	dataBIN: 0000 0000
reg: 32 	dataDEC: 0 	dataBIN: 0000 0000
reg: 33 	dataDEC: 0 	dataBIN: 0000 0000
reg: 34 	dataDEC: 65 	dataBIN: 0100 0001
reg: 35 	dataDEC: 59 	dataBIN: 0011 1011
reg: 36 	dataDEC: 0 	dataBIN: 0000 0000
reg: 37 	dataDEC: 97 	dataBIN: 0110 0001
reg: 38 	dataDEC: 16 	dataBIN: 0001 0000
reg: 39 	dataDEC: 0 	dataBIN: 0000 0000
reg: 3a 	dataDEC: 0 	dataBIN: 0000 0000
reg: 3b 	dataDEC: 0 	dataBIN: 0000 0000
reg: 3c 	dataDEC: 0 	dataBIN: 0000 0000
reg: 3d 	dataDEC: 0 	dataBIN: 0000 0000
reg: 3e 	dataDEC: 0 	dataBIN: 0000 0000
reg: 3f 	dataDEC: 32 	dataBIN: 0010 0000

We checked the GPIO configurations of all of the pins connected between LIS2DW12 and nRF9160. On nRF9160 side, SDA and SCL pins have internal pull-ups and also INT1 and INT2 pins have no pull-ups. We tried to change the pull configuration for all of those pins and found that the defaults are the correct ones.

Also, CS pull-up on LIS2DW12 side is connected by default. We tried to disconnect that pull-up and didn't notice any big change there on power consumption.

We tried to find help from the forum and found a quite similar thread: https://community.st.com/s/question/0D53W00000aqbhi/lis2dw12-activityinactivity-power-consumption-too-high-when-inactive but that didn't help us.

Do you have any ideas how to get the power consumption down? Is the schematics and all of the configurations okay or have we missed something?

Thank you!

12 REPLIES 12
niccolò
ST Employee

Hi @APaan.1​ ,

the schematic seems ok to me, except for the 10 uF capacitor between Vdd and GND that you do not have (but it should not give a problem like this).

let me try to better understand the problem here:

can you try to pinpoint the action that make the sensor consume 200uA? I understand, from what you wrote that "enabling" it is setting the ODR, is that correct?

can you try to set the power mode to high performance mode and check if there is a difference in power consumption (it should be around 90 uA)

moreover, can I ask you what Vdd level are you using?

Niccolò

APaan.1
Associate II

Hi and thanks for replying so fast,

"the schematic seems ok to me, except for the 10 uF capacitor between Vdd and GND that you do not have (but it should not give a problem like this)."

What should we achieve by adding this capacitor?

"can you try to pinpoint the action that make the sensor consume 200uA? I understand, from what you wrote that "enabling" it is setting the ODR, is that correct?"

There are some configurations on the SDK/Zephyr which enable the drivers. Without these configurations we can exclude the LIS2DW12 and its drivers so it is not enabled.

"can you try to set the power mode to high performance mode and check if there is a difference in power consumption (it should be around 90 uA)"

With high performance mode and ODR of 400/800/1600 Hz the power consumption rises to 380-420µA.

"moreover, can I ask you what Vdd level are you using?"

Vdd level is 3.0V as well as the GPIO voltage on the nRF9160.

Do you have a power consumption table for 3.0V similar to the 1.8V one?

TNiku.1
Associate

Hi, I'm collaborating with @APaan.1​ with this case.

The datasheet of nRF9160 says that the internal pull-up/pull-down resistor values are 11-16kOhms. So do we need to do something to these pins on nRF9160 side?

"We checked the GPIO configurations of all of the pins connected between LIS2DW12 and nRF9160. On nRF9160 side, SDA and SCL pins have internal pull-ups and also INT1 and INT2 pins have no pull-ups. We tried to change the pull configuration for all of those pins and found that the defaults are the correct ones."

Are the default pull configurations correct?

"Also, CS pull-up on LIS2DW12 side is connected by default. We tried to disconnect that pull-up and didn't notice any big change there on power consumption."

Should we disconnect this when using I2C or just leave it as connected as default?

APaan.1
Associate II

We tried changing the internal pull-ups of the GPIOs on nRF9160. Here you can see the results of the changes:

0693W00000AMlnTQAT.png

niccolò
ST Employee

Hi, I'll try to answer to all your messages in one shot:

@APaan.1​ 

you're welcome, I hope I can help you solve the situation =)

let's tackle your questions/answers in order:

  • the capacitor should add noise filtering capability on Vdd, it is good practice to use the ones shown in the application hints
  • I'll try to rephrase my question: how much is current consumption when the sensor is off (ODR bits of register CTRL_1 = 0000) and you try to set some registers? feel free to post the instructions you use (even if I'm not used to nRF Connect SDK, I can try to understand them)
  • this is a strange behaviour, but it does not explain the actual behaviour
  • the power consumption for Vdd at 3V is not available for full disclosure, but the characterization team told me that values are under 1 uA, even for that voltage

@TNiku.1​

  •  on nRF9160 side these pull-ups can delay a little the signal but they should not be able to draw a lot of current
  • the default are the correct ones if you do not add some external hw that changes the situation. the fact that you tried different configuration in your latest message seems to be proof that they are right
  • when using I2C you should always keep CS pin high. an internal pull-up is the reason why disconnecting it does not break I2C communication immediately, but it is not correct to leave it disconnected

some considerations on my part:

I didn't ask you what does your fw (except talking with the sensor). can the high current consumption derive from other instructions?

I would say that a proper way of tackling the situation is to understand what is the source of the current, so, please, try to see if the current consumption is high when the sensor is in powerdown and you communicate with it.

bye,

Niccolò

APaan.1
Associate II

Hi,

"how much is current consumption when the sensor is off (ODR bits of register CTRL_1 = 0000) and you try to set some registers?"

This is how we set the data rate / ODR for LIS2DW12 and read the register CTRL1 and it set it correctly to 0000 0000.

if (lis2dw12_data_rate_set(lis2dw12->ctx, 0U) < 0) {
		return -EIO;
}

The power consumption decreased from about 200µA to 150µA and if the LIS2DW12 trigger is disabled (by disabling its thread) the consumption is decreased from 20µA to 14µA when the sensor is turned off.

"try to see if the current consumption is high when the sensor is in powerdown and you communicate with it."

Powering down the LIS2DW12 by setting the ODR to 0, drops the consumption but it also removes the ability to track the stationary/motion detection.

Also with another test variant of FW which is only polling acceleration (trigger disabled), the power consumption is about 125µA. With ODR=0, the consumption is about 110µA and the values are not changing but we are able to f.ex. read LIS2DW12 registers.

"I didn't ask you what does your fw (except talking with the sensor). can the high current consumption derive from other instructions?"

  • When using CONFIG_LIS2DW12_TRIGGER_GLOBAL_THREAD (as we do currently on devices on the field), the consumption is about 200µA.
  • When using CONFIG_LIS2DW12_TRIGGER_OWN_THREAD, the consumption is about 170µA.
  • When none of those are used, it also disables the whole trigger of the LIS2DW12, the consumption is about 20µA.

So the problem could be on there but I have no idea what we should try there. We tried to add f.ex. k_sleep(K_SECONDS(2)) for lis2dw12_work_cb() and the consumption dropped to 20µA there for two seconds.

TNiku.1
Associate

Hi,

I don't know if this helps but I send it anyway. This is how we are defined the LIS2DW12 on our board:

&i2c2 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	sda-pin = <26>;
	scl-pin = <27>;
	zephyr,concat-buf-size = <512>;
	clock-frequency = <I2C_BITRATE_STANDARD>;
 
	lis2dw12@19 {
		compatible = "st,lis2dw12";
		label = "LIS2DW12";
		reg = <0x19>;
		irq-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
	};
};

Here are the links for the Zephyr devicetree bindings:

https://github.com/nrfconnect/sdk-zephyr/tree/v2.4.99-ncs1/dts/bindings/sensor/st%2Clis2dw12-i2c.yaml

https://github.com/nrfconnect/sdk-zephyr/tree/v2.4.99-ncs1/dts/bindings/i2c/nordic%2Cnrf-twim.yaml

niccolò
ST Employee

Hi @APaan.1​ and @TNiku.1​ ,

the fact that power consumption remains high (150uA while the device is off), is symptom of problems on the I2C lines.

in particular, the problem could lie in the fact that the nRF9160 keeps the line down as a default, when no communication is ongoing.

this would leads to static power consumption through the I2C pull-ups.

usually the STM32 microcontrollers sets the default of I2C lines to high, to avoid having this problem.

you can confirm if the problem is this one by inspecting the I2C line in the nRF9160 fw.

I'm not sure where you can find it exactly, but when you set up I2C communication you could have some bits to set to change this behaviour.

Niccolò

APaan.1
Associate II

Hi,

We confirmed that the I2C lines are set high as default and setting them to high didn't affect the consumption. We also tried completely disabling TWIM/I2C on the nRF9160 which had no impact on the consumption either. We measured the voltage on I2C lines and it was 3.0V.