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

Why is my PSM floor current 600 µA? (Asset Tracker, Thingy 91)

I modified the asset tracker application as follows (to reduce power consumption):

1) Added lte_lc_psm_req(true); at the end of main-function. In prj_thingy91_nrf9160ns.conf I set CONFIG_LTE_PSM_REQ_RPTAU="00100001" (1 hour) and CONFIG_LTE_PSM_REQ_RAT="00000000" (0 sec).

2) Deleted src/ui folder and commented out every #include "ui.h"ui_led_set_color and ui_led_set_pattern in main.c and gps_controller.c.

In prj_thingy91_nrf9160ns.conf, I commented out #CONFIG_USE_UI_MODULE=n, #CONFIG_NRF_CLOUD_LOG_LEVEL_DBG=n#CONFIG_NRF9160_GPS_LOG_LEVEL_DBG=n#CONFIG_CONSOLE_GETCHAR=n#CONFIG_AWS_FOTA_LOG_LEVEL_DBG=n#CONFIG_AWS_JOBS_LOG_LEVEL_DBG=n.

In Kconfig, I commented out #rsource "src/ui/Kconfig".

In CmakeLists.txt I commented out #src/ui and #add_subdirectory(src/ui).

3) Added BSEC Library to ncs/v1.4.0/nrf/ext, in prj_thingy91_nrf9160ns.conf I set CONFIG_BME680=n and CONFIG_USE_BME680_BSEC=y, in bsec.c I set #define BSEC_SAMPLE_RATE BSEC_SAMPLE_RATE_ULP.

4) Set environment data send interval  and mqtt keepalive to 300 sec: CONFIG_ENVIRONMENT_DATA_SEND_INTERVAL=300 and CONFIG_MQTT_KEEPALIVE=300.

5) Disabled Light sensor and color sensor: CONFIG_LIGHT_SENSOR=n and CONFIG_BH1749=n.

6) Commented out every RSRP related code in main.c, because I don't need RSRP Info messages.

8) Disabled logging:

in prj_thingy91_nrf9160ns.conf I set CONFIG_LOG=n, CONFIG_LOG_IMMEDIATE=n, CONFIG_SERIAL=n, CONFIG_USE_AT_HOST=n,  CONFIG_UART_CONSOLE=n, CONFIG_CONSOLE_HANDLER=n, CONFIG_CONSOLE_SUBSYS=n

and commented out #CONFIG_NRF_CLOUD_LOG_LEVEL_DBG=n#CONFIG_NRF9160_GPS_LOG_LEVEL_DBG=n, #CONFIG_CONSOLE_GETCHAR=n, #CONFIG_AWS_FOTA_LOG_LEVEL_DBG=n, #CONFIG_AWS_JOBS_LOG_LEVEL_DBG=n.

After these modifications, everything works perfectly: the Thingy 91 connects to NRF cloud and sends environment data every 5 minutes (300 sec). It enters PSM, when it is not sending data.

I measured the power consumption with a digital multimeter. During PSM, the current is about 600 µA. Why? (I expect a floor current below 50 µA. According to nrf9160 specification, PSM floor current should be 2.7 µA.) 

Parents
  • Hi, I'm thinking that maybe the UART1 is still running. This is default behavior in many NCS applications. Can you try to add this to your overlay file:

    &uart1 {
    status = "disabled";
    };
  • I edited the thingy91_nrf9160_common.dts file in ncs/v1.4.0/nrf/boards/arm/thingy91_nrf9160 as you suggested, but still got the same current. I tried to disable uart0, too, but I got errors while opening the project. In my configuration UART is disabled anyway:

    I am suspecting the cpu and clock don't go to sleep during PSM. In the Asset Tracker code I didn't discover any CPU idling calls. What do you think about adding k_cpu_idle() at the end of each work_fn function? What is the correct way to let the CPU / clock sleep during the PSM interval in the Asset Tracker code?

  • Hi, sorry for the late reply. If you are using the asset tracker application from NCS 1.4.0 there are two things needed to be done in order to get the power consumption down. You need to disable logging and disable UART1. This can be done through the application during run-time.

    Add the following to main.c:

    #include <device.h>
    #include "power/power.h"
    
    const struct device *console, *uart1;
    
    void main(void)
    {
      // Turn off logging (which is using UART0):
      console = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_console)));
      device_set_power_state(console, DEVICE_PM_OFF_STATE, NULL, NULL);
      
      // Turn off UART1:
      uart1 = device_get_binding(DT_LABEL(DT_NODELABEL(uart1)));
      device_set_power_state(uart1, DEVICE_PM_OFF_STATE, NULL, NULL);
      
      .......
    
    }

    And in prj.conf

    CONFIG_DEVICE_POWER_MANAGEMENT=y

    Now the current should drop down from 600uA.

    There's no need to remove the UI module or do any other changes to the application.

     

    andrew926 said:
    What do you think about adding k_cpu_idle() at the end of each work_fn function? What is the correct way to let the CPU / clock sleep during the PSM interval in the Asset Tracker code?

     This is automatically handled by zephyr. When the thread is finished the CPU goes to sleep. The CPU current is about 3mA, while 600uA indicates that the HF clock is running (because of UART0 RX (logging and AT commands) and UART1 RX)

Reply
  • Hi, sorry for the late reply. If you are using the asset tracker application from NCS 1.4.0 there are two things needed to be done in order to get the power consumption down. You need to disable logging and disable UART1. This can be done through the application during run-time.

    Add the following to main.c:

    #include <device.h>
    #include "power/power.h"
    
    const struct device *console, *uart1;
    
    void main(void)
    {
      // Turn off logging (which is using UART0):
      console = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_console)));
      device_set_power_state(console, DEVICE_PM_OFF_STATE, NULL, NULL);
      
      // Turn off UART1:
      uart1 = device_get_binding(DT_LABEL(DT_NODELABEL(uart1)));
      device_set_power_state(uart1, DEVICE_PM_OFF_STATE, NULL, NULL);
      
      .......
    
    }

    And in prj.conf

    CONFIG_DEVICE_POWER_MANAGEMENT=y

    Now the current should drop down from 600uA.

    There's no need to remove the UI module or do any other changes to the application.

     

    andrew926 said:
    What do you think about adding k_cpu_idle() at the end of each work_fn function? What is the correct way to let the CPU / clock sleep during the PSM interval in the Asset Tracker code?

     This is automatically handled by zephyr. When the thread is finished the CPU goes to sleep. The CPU current is about 3mA, while 600uA indicates that the HF clock is running (because of UART0 RX (logging and AT commands) and UART1 RX)

Children
No Data
Related