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

How optimize high current consumption in sleep mode using nRF52840?

Hello to all,

We have developed our application & the following platform we are using:

  • SDK 15.0, Segger IDE on windows PC
  • Softdevice version is 6.0.0
  • Hardware version nRF52840 SoC.
  • Our product is battery operated, so high power consumption is serious an issue for us.

In our application we have used ble_app_uart example with SAADC because our sensor is analog. We also made custom PCB using nRF52840 and it working well not an issue. But our problem is very too much high current consumption is sleep mode means system OFF mode.

Here is below measured analysis with the help of Nordic Power Profile kit:

  1. The average current consumption while advertising is 962uA - 1.62mA I think this is OK.
  2. The average current consumption when sensor device enter into sleep mode is 562uA (Which is very high)

We have disabled all used peripheral before enter device into sleep mode as like below:

void sleep_mode_enter() {
  uint32_t err_code;
  NRF_LOG_INFO("Sleep mode Enter");
  flash_data_sending = false;
  start_measurement = false;
  nrf_gpio_pin_clear(SENSOR_PIN);  // OFF Sensor
  nrf_gpio_pin_set(GREEN_LED_PIN); // OFF Green LED
  nrf_gpio_pin_set(BLUE_LED_PIN);  // OFF BLUE LED
  stop_adc();
  err_code = app_uart_close();
  APP_ERROR_CHECK(err_code);
  NRF_LOG_INFO("UART close: %d", err_code);
}

void stop_adc() {
  nrf_drv_timer_disable(&m_timer);
  nrf_drv_timer_uninit(&m_timer);
  nrf_drv_ppi_channel_disable(m_ppi_channel);
  nrf_drv_ppi_uninit();
  NRF_SAADC->TASKS_STOP = 1;
  nrf_drv_saadc_uninit();
}

We have tested our hardware and sure this not hardware problem because when our device enter into deep sleep mode system OFF that time the current consumption near about 0.7uA to 1uA. Even when our designed firmware upload into nRF52840 DK and measured consumption using PPK that time got same results.

Questions:

  1. Why this too much very high power consumption getting in sleep mode?
  2. Is any wrong in our sleep mode enter function and disabled module functions?

Will you please suggest any solution, We should need to optimize this consumption to increase battery life because our sensor devices is battery operated.

Looking forward your response..!!

Thanks in advanced..!! 

Parents
  • Do the timers you have initialized keep running when you go to sleep mode, or do you stop them before going to sleep and restart them once you wake up?

    The RAM is by default set to go off and restart when you wake up from sleep, but you can retain data in RAM while sleeping, at the cost of some current consumption. If you don't know what this is I assume you are not using it.

    Yes, but the system supports 3 different low-frequency clock sources:

    • 32.768 kHz RC oscillator (LFRC)
    • 32.768 kHz external crystal oscillator (LFXO, also the most power efficient)
    • 32.768 kHz synthesized from HFCLK (LFSYNT, the least power efficient, as it requires the HFCLK to be on).

    Page 94 in the product specification shows you how to set your clock source.

    Best regards,

    Simon

  • Hi Simonr,

    We are facing one problem for enable and disable UARTE module if I do below flow:

    1. Is it necessary to uart_init() before start saadc because when I enable as below saadc not working:

      memset(&adc_buff, 0, sizeof(adc_buff));
    //  nrf_gpio_pin_set(WIFI_PIN);   // ON WIFI Module
      nrf_gpio_pin_set(SENSOR_PIN); // ON Sensor
    //  uart_init();
      saadc_sampling_event_init();
      saadc_sampling_event_enable();
      nrf_delay_ms(3000);
      uart_init();
      adc_configure_battery();

    If I remove comment of nrf_gpio_pin_set(WIFI_PIN);   then every thing working fine.

    But I want ON WiFi module after completion of saadc task.

    I am little bit confused why this happening?

    Thanks.....

  • vishal said:
    Is it necessary to uart_init() before start saadc

     What do you mean here? You say that it works if you set the WIFI_PIN and nothing about initializing UART. So I don't see why you would think UART is required. What exactly fails if you don't set the WIFI_PIN? I'm guessing you're using the WIFI_PIN somewhere in your code before you set it.

    Best regards,

    Simon

Reply
  • vishal said:
    Is it necessary to uart_init() before start saadc

     What do you mean here? You say that it works if you set the WIFI_PIN and nothing about initializing UART. So I don't see why you would think UART is required. What exactly fails if you don't set the WIFI_PIN? I'm guessing you're using the WIFI_PIN somewhere in your code before you set it.

    Best regards,

    Simon

Children
  • Hi Simonr,

    I have resolved this issue by calling sleep mode enter in main function by proper way as below:

      for (;;) {
        if (sleep_mode_enable == true) {
          sleep_mode_enter();
          sleep_mode_enable = false;
        }
        idle_state_handle();
      }

    Now our program is working and also optimized sleep mode consumption 38uA to 6uA.

    Just one question for you Is it necessary to ON NRF_LOG_ENABLED and RTT Log in sdk_config.h

    Currently I have enabled this with release build.

    Thank you so much for your great and quick response support..!!!

Related