cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to put the MCU to sleep mode after taking one shot measurement with VL53L1X?

alitastan
Associate II

Hello everyone,

I have designed a custom PCB with STM32WB15CC. I am using two sensors (VL53L1X and MPU6050). I am using CR2032 coin cell as a supply and I have big problems with the battery management. The project example is using sequencer and what I want to do is to take a single shot measurement with the VL53L1X sensor and then put the device to sleep until a wakeup command is received via bluetooth characteristics. What is the best way to implement this behavior when using sequencer? 

The program behaves as expected when testing on NUCLEO-WB15CC. I first initialize the sensors and then use timer to trigger a function which returns accelerometer values. Then I check if I receive desired threshold values to call VL53L1X measurement. This is implemented in p2p_server_app.c. I would like to call the most convenient function to save power while keeping bluetooth connection alive since I want to wake up the device and do the same steps again when I send a command. 

Please see attached files for more information about the design and codes.

Thank you for your time, best regards.

 

Example Project: STM32_WPAN / BLE_P2PServer

IDE version: STM32CubeIDE.1.12.0

Firmware Wireless binaries: stm32wb1x_BLE_Stack_full_fw from STM32Cube_FW_WB_V1.13.0

VL53L1X API: VL53L1X_API(STSW-IMG007)

1 ACCEPTED SOLUTION

Accepted Solutions
Zhiyuan.Han
ST Employee

Hi 

With your email information, I can suggest, when you receive BT command, you can start L1X ranging one shoot and then stop sensor ranging, let sensor go to SW standby mode. 

Attached my STM32 test code for your reference. 

 

 

br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Zhiyuan.Han
ST Employee

Hi 

With your email information, I can suggest, when you receive BT command, you can start L1X ranging one shoot and then stop sensor ranging, let sensor go to SW standby mode. 

Attached my STM32 test code for your reference. 

 

 

br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.