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

NRF52840-DK current consumption measurement

Hello, I just started to understand the NRF52840-DK. I want to measure the power consumption of NRF52 with broadcasting some data to air. How I will do it? Is there any example in SDK to put the device in sleep mode and I can broadcast the data.

I want to calculate how many days/months or years my device will work with cell operated.

I am new to this concept to measure the current consumption of the device. So, give some proper steps to do it.

Parents Reply Children
  • Hi Amanda...!!!

    Can you give some example to put nrf52840 into sleep with some configurable time. For example, at every 1 min the board goes into the sleep mode and wake-up when the 1 mins time is over and do some task and going back to sleep for 1min.

  • Is this API (sd_app_evt_wait()) is valid for sleep mode?

    I have created one app timer for sending advertising packet when the timer event is triggered.

    I want system will on at that stage when it is before going to sleep mode. Do not want to restart it.

    Is it valid? Advertising packet not working as I accepted. 

    static void nrf_data_mgmt_timeout_handler(void * p_context)
    {
          NRF_LOG_INFO("#");
    }
    ret_code_t data_mgmt_timer_create(void)
    {
        ret_code_t ret_code = app_timer_create(&m_data_mgmt_timer,
                                               APP_TIMER_MODE_REPEATED,
                                               nrf_data_mgmt_timeout_handler);
        if (ret_code != NRF_SUCCESS)
        {
            return ret_code;
        }
    
        return app_timer_start(m_data_mgmt_timer, APP_TIMER_TICKS(5000), NULL);
    }
    
    /**@brief Function for application main entry.
     */
    int main(void)
    {
        // Initialize.
        log_init();
        leds_init();
        timers_init();
        buttons_init();
        power_management_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
    
        // Start execution.
        NRF_LOG_INFO("Blinky example started.");
        advertising_start();
        data_mgmt_timer_create();
        // Enter main loop.
        for (;;)
        {
            idle_state_handle();
            sd_app_evt_wait();
        }
    }

  • Hi, 

    The purpose of sd_app_evt_wait() is to do some extra housekeeping for the Softdevice before going to sleep. The function also makes sure that the code does not exit sd_app_evt_wait() unless an application event occurs, such as e.g. UART or ADC interrupt. All the Softdevice examples that use sd_app_evt_wait() in our SDKs should be able to enter sleep mode.

    According to your code, it will execute the nrf_data_mgmt_timeout_handler function when the timer event is triggered.

    Please take a look at this tutorial.

    -Amanda H.

Related