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
  • Hello,

    For information about the power consumption in these different scenarios please take a look at the Electrical Specification in the Product Specification.

    Best regards,
    Karl

  • hi,

    i have read the electrical specification. i want to know during system in sleep. in which nrf52833 dk consume only 2.2 uA. so which peripheral are on in the sleep. rtc+lfrtc+ram retention = 2.2uA?? or how can i lower the current consumption in sleep. less than 2uA like 1.6uA something?

  • Hello,

    starkAbhi said:
    yes , i measure the current consumption by flipping the switch on Nrf Only.

    Thank you for clarifying.

    starkAbhi said:
    yes, my requirement of project is to advertise data and sleep periodically so that device consume less amount of current from small battery.

    Is there an option for the device to be in SYSTEM_OFF sleep for any of this duration? Will the device be receiving an external interrupt at any point that could have been used to wake the device from SYSTEM_OFF sleep, for instance?

    starkAbhi said:
    that would be nice to have example code on how to put nrf52833 on sleep system on /no-ram retention.

    This will depend on what other peripherals and processes you have got going in your application - you will need to disable all peripherals(except the RTC) and radio activity, and then lastly turn off the ram as well.
    You can read about how to configure the RAM retention during SYSTEM_ON and SYSTEM_OFF here.

    Best regards,
    Karl

  • hi,

    Is there an option for the device to be in SYSTEM_OFF sleep for any of this duration? Will the device be receiving an external interrupt at any point that could have been used to wake the device from SYSTEM_OFF sleep, for instance?

    System off sleep is not possible because device is independent . only software based interrupt can be feasible.

    This will depend on what other peripherals and processes you have got going in your application - you will need to disable all peripherals(except the RTC) and radio activity, and then lastly turn off the ram as well.
    You can read about how to configure the RAM retention during SYSTEM_ON and SYSTEM_OFF here.

    system on + rtc+ lfrc + no ram retention only. ble gets on advertise-sleep-repeat. now could you provide any example code to achieve this?

  • Hello again,

    starkAbhi said:
    System off sleep is not possible because device is independent . only software based interrupt can be feasible.

    Thank you for clarifying.

    starkAbhi said:
    system on + rtc+ lfrc + no ram retention only. ble gets on advertise-sleep-repeat. now could you provide any example code to achieve this?

    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.).

    Give this a try, and let me know if you encounter any issues or questions along the way :) 

    If you are not yet familiar with the nRF Connect SDK then I would highly recommend taking a look through the DevAcademy Fundementals course to quickly familiarize with the SDK.

    Best regards,
    Karl

  • 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

Reply
  • 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

Children
  • 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?  

  • Hello,

    Karl is out of office, so I am sorry for the late reply. 

    I don't know what current consumption you currently are looking at, but you can check what my colleague answered in a similar question yesterday, regarding how to control the RAM retention.

    It also holds the table containing current consumption in different states.

    Best regards,

    Edvin

  • Hi Edvin,

    I don't know what current consumption you currently are looking at, but you can check what my colleague answered in a similar question yesterday, regarding how to control the RAM retention.

    My application requirement is to advertise data then go to  sleep periodically . it has to consume  ~1.2uA current in sleep. due to less power consumption connected battery has long life. we able to achieve 2.2 uA  in sleep by using given code above. how to decrease the current consumption more to close 1uA.

    previously "Karl' asked about hardware design. in response we are open to suggestions. could you please us in hardware design?

    Regards Abhishek

Related