RTC Running in System ON Mode Current Consumption?

hi,

i am using nrf connect extension in vs code with Zephyr os version v3.2.99-ncs2 , 

when device in system on sleep how much current consume by nrf52833 development kit ? when only RTC Being on.

1. during sleep, RTC  current consumption?

2. what is complete current consumption flow(rtc,idle thread and LFRC) during system on sleep? 

pm_state_force(0u, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0}); //nrfonly switch 

Parents Reply Children
  • hi,

    We do unfortunately not have any examples that match this description already, but it should not take you so long to set this up yourself. I would suggest that you start out with one of the minimal BLE example, such as the Multiple Advertising Sets sample, trim away the extra advertising sets, and implement the go-to-sleep and wake-from-sleep procedures (turning off/on peripherals and RAM, etc.).

    i have some experience with nrf connect vscode sdk. i need only some guidance on API to put device in sleep to minimize sleep current near to 1.6uA or less.

    below code i used to advertise-sleep-periodically.

    //advertiser sleep
    
    #include <zephyr/types.h>
    #include <stddef.h>
    #include <zephyr/sys/util.h>
    #include <zephyr/bluetooth/bluetooth.h>
    #include <zephyr/bluetooth/hci.h>
    //---power management lib--
    #include <zephyr/pm/pm.h>
    #include <zephyr/pm/device.h>
    /////////////////////////////
    
    #define DEVICE_NAME CONFIG_BT_DEVICE_NAME
    #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
    
    uint8_t vol_Per = 0; //voltage in % but hex converter it
    
    static uint8_t adv_data[] = {
    0x0f,0x18, //uuid battery service uuid[1],uuid[0] //0x180f: battery services
    0x10 //data: battery percentage hex to % 0x10 = 16%
    };
    
    static const struct bt_data ad[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
    BT_DATA(BT_DATA_SVC_DATA16,adv_data,3),   
    };
    
    /* Set Name adv data */
    static const struct bt_data sd[] = {
    BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
    };
    
    static void bt_ready(int err) {
    	char addr_s[BT_ADDR_LE_STR_LEN];
    	bt_addr_le_t addr = {0};
    	size_t count = 1;
    	/* Start advertising */
    	bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
    
    	bt_id_get(&addr, &count);
    	bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
    	// printk("Beacon started, advertising as %s\n", addr_s);
    }
    
    void main(void) {
    /* Initialize the Bluetooth Subsystem */
    bt_enable(NULL);
    while(1) {
    bt_ready(0); //advertising
    /* Update advertising */
    //// -------simulating voltage increasing gradually-----------
    // vol_Per++;
    // adv_data[2] = vol_Per;
    // if (vol_Per > 64) {
    // vol_Per = 0;
    // }
    // k_sleep(K_SECONDS(1)); //1 second
    // //////////////////////////////////////////////////////
    // bt_le_adv_update_data(ad, ARRAY_SIZE(ad),sd, ARRAY_SIZE(sd));
    
    k_sleep(K_SECONDS(1)); //WAIT time
    bt_le_adv_stop();
    pm_state_force(0u, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0}); //nrfonly switch: 2.2 uA 
    k_sleep(K_SECONDS(3)); //update time
    } //end of while
    }//end of main
    

    thanks for sharing , i already have seen it. 

  • Hello,

    starkAbhi said:
    thanks for sharing , i already have seen it. 

    I am glad to hear that! :) 

    Looking at the code you have shared you really should check the returned error codes from your SDK function calls - if you do not then you will have no way to know whether the call completed successfully or failed for whatever reason.

    You will also need to explicitly disable your RAM before going to sleep, which will require your to re-configure and initialize your application when you wake from sleep (because the contents of the RAM will be wiped).

    Best regards,
    Karl

  • Hi,

    My apologies for late reply, could you please suggest me code snippet or example to disable RAM. and enable it again. what is the most power efficient techniques to increase the battery life?

  • Hello,

    starkAbhi said:
    My apologies for late reply

    No problem at all - we continue this whenever you get the chance :) 

    starkAbhi said:
    could you please suggest me code snippet or example to disable RAM. and enable it again.

    You can set which RAM blocks will be retained and which will not as described in the documentation I referenced below, please give this a try and let me know if you run into any issues - then you can share the code snippets from what you attempted and what you were trying to achieve, then we can take a look and guide you to how you could achieve it.

    starkAbhi said:
    what is the most power efficient techniques to increase the battery life?

    Shutting down everything that you do not need during sleep is a good start, but there are other things you can do as well. You should also take a look at this blogpost for a introduction to power optimization of nRF52 series SoCs.
    Have you started work on the hardware design, with regards to your power circuitry and configuration?

    Best regards,
    Karl

  • Hi,

    You can set which RAM blocks will be retained and which will not as described in the documentation I referenced below, please give this a try and let me know if you run into any issues - then you can share the code snippets from what you attempted and what you were trying to achieve, then we can take a look and guide you to how you could achieve it.

    i used this way to get System on sleep. which API /Function need to call to put device in RAM OFF Sleep?

    //advertiser sleep
    
    #include <zephyr/types.h>
    #include <stddef.h>
    #include <zephyr/sys/util.h>
    #include <zephyr/bluetooth/bluetooth.h>
    #include <zephyr/bluetooth/hci.h>
    //---power management lib--
    #include <zephyr/pm/pm.h>
    #include <zephyr/pm/device.h>
    /////////////////////////////
    
    #define DEVICE_NAME CONFIG_BT_DEVICE_NAME
    #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
    
    uint8_t vol_Per = 0; //voltage in % but hex converter it
    
    static uint8_t adv_data[] = {
    0x0f,0x18, //uuid battery service uuid[1],uuid[0] //0x180f: battery services
    0x10 //data: battery percentage hex to % 0x10 = 16%
    };
    
    static const struct bt_data ad[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
    BT_DATA(BT_DATA_SVC_DATA16,adv_data,3),   
    };
    
    /* Set Name adv data */
    static const struct bt_data sd[] = {
    BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
    };
    
    static void bt_ready(int err) {
    	char addr_s[BT_ADDR_LE_STR_LEN];
    	bt_addr_le_t addr = {0};
    	size_t count = 1;
    	/* Start advertising */
    	bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
    
    	bt_id_get(&addr, &count);
    	bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
    	// printk("Beacon started, advertising as %s\n", addr_s);
    }
    
    void main(void) {
    /* Initialize the Bluetooth Subsystem */
    bt_enable(NULL);
    while(1) {
    bt_ready(0); //advertising
    k_sleep(K_SECONDS(1)); //WAIT time
    bt_le_adv_stop();
    pm_state_force(0u, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0}); //nrfonly switch: 2.2 uA 
    k_sleep(K_SECONDS(3)); //update time
    } //end of while
    }//end of main

    Shutting down everything that you do not need during sleep is a good start, but there are other things you can do as well. You should also take a look at this blogpost for a introduction to power optimization of nRF52 series SoCs.

    yes, I followed the Given instructions. are there any power management Example Code on nrf connect for vscode zephyr ncs to clear Concepts? 

    Have you started work on the hardware design, with regards to your power circuitry and configuration?

    currently, our hardware contain nRF52833 standalone which is directly connected to 3v button cell. our goal to achieve minimum current consumption tracker device nearly ~ 1 uA. Current  consumption is majorly depend upon Application Software Flow. could you please suggest us any external hardware configuration?  

Related