BLE advertising beacon eddystone data over air then go to sleep in system ON mode periodically need example of this?

i am using nrf connect extension in vs code with Zephyr os version v3.2.99-ncs2 . i use BLE beacon sample on NRF52833 development Kit. i want to build Application in which device send specific string of data over ble without making Connection to scanner then goes to sleep and repeat. during sleep device should consume 1.6uA  or less than 1.6 uA current. i have read the datasheet it specifies system on sleep no ram retention:  1.6uA. page number 53, table: 5.2.1 Electrical specification 5.2.1.1 Sleep.

i already checked the system off sample but it can only wake up the nrf52833 by external interrupt. which is not suitable for my application. by system off example . i read 0.3 uA current.

1. system ON example: how put nrf52833 in sleep with/without no ram retention wake up on rtc. or other System ON examples.

2. as per my requirement: advertise data-sleep-repeat with minimum current consumption in micro amperes.

link: system off: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/boards/nrf/system_off/README.html

datasheet: infocenter.nordicsemi.com/.../nRF52833_OPS_v0.7.pdf

Parents
  • Hi,

    Is 1.6 uA sleep current a hard requierment?

    Based on what you write, the most sensible sleep mode is ION_RAMON_RTC which is full RAM retention and wake on RTC. This will typically give you a idle cunsumption of 2.6 uA.You need wake on RTC as you don't have an external wakeup source, and you also probably want RAM rentention so that you will not have do re-initialization on every wake-up. If you  don't retain the RAM you will need to do re-initialization which takes time and CPU resources, and the average current consumption may be higher in the end.

    PS: You should not use the 0.7 OPS which was a preliminary specification. Use the latest official product specification.

  • hi, i hope you are doing well. 

    yes, my requirement of project is to consume minimal amount of current from small lipo battery.

    1. sleep current is should be less than 2uA .

    2. during advertisement  peak current is  should be minimum as much possible.

    currently i use this method to put nRf52833 Dk in sleep to consume 2.1uA with ble ON and  advertisement off.

    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(10)); //WAIT time
    // k_sleep( K_MSEC(100)); //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
      

    during advertisement  i use DMM to measure Current: 

    advertisement window- min = 1 second , max= 1.2 second

    peak current advertisement = 99.4 uA

    sleep current = 2.1 uA

    //--------another parameter------------------------------------------  

    advertisement window- min = 100 millisecond , max= 150 millisecond

    peak current advertisement = 158.4uA 

    sleep current = 2.1 uA

    1. how i can implement event base wakeup call during sleep ? event like software based timer interrupt?

    2. how minimize the current consumption during advertisement? or which parameters are affecting the current and performance?

    as mentioned in product specification , ION_RAMON_EVENT System ON, full 128 kB RAM retention, wake on any event : 1.8uA. 

  • Hi,

    starkAbhi said:

    yes, my requirement of project is to consume minimal amount of current from small lipo battery.

    1. sleep current is should be less than 2uA .

    I understand. But please keep in mind that the lowest possible sleep current might not give you the lowest possible average current consumption, which in the end is what determines the battery life. (Like in the case I described in my previous post, if you don't retain RAM etc, you will need to do more processing when the device wakes up, and the resulting average power consumption may be higher).

    What is your requierment for average current consumption? You can use the online power profiler to see estimates on what it can be so that you will see what you can realistically achieve (this does not have the nRF52833, but you can select nRF52840 to get comparable numbers).

    starkAbhi said:
    1. how i can implement event base wakeup call during sleep ? event like software based timer interrupt?

    In the nRF Connect SDK, one RTC is always used by the OS (Zephyr) to keep track of time. This is used to wake up as needed, and you can use the normal zephyr clock API's (see Kernel Timing). With this, the kernel handles the detail, and you get low power timers exposed to the application. This is generally what all nRF Connect SDK and Zephyr applications use.

    starkAbhi said:
    2. how minimize the current consumption during advertisement? or which parameters are affecting the current and performance?

    Tx power is important (particularily if you use a high Tx power), and the advertising interval. You can experiment with the effect of this using the online power profiler.

    starkAbhi said:
    as mentioned in product specification , ION_RAMON_EVENT System ON, full 128 kB RAM retention, wake on any event : 1.8uA. 

    You also need an RTC running.

  •  

    hi,

    Einar Thorsrud said:
    I understand. But please keep in mind that the lowest possible sleep current might not give you the lowest possible average current consumption, which in the end is what determines the battery life. (Like in the case I described in my previous post, if you don't retain RAM etc, you will need to do more processing when the device wakes up, and the resulting average power consumption may be higher).What is your requierment for average current consumption? You can use the online power profiler to see estimates on what it can be so that you will see what you can realistically achieve (this does not have the nRF52833, but you can select nRF52840 to get comparable numbers).

    starkAbhi:

    i got your point. now i am constraint to use "ram retention rtc wakeup" sleep mode to decrease current consumption. thanks to share. i will definitely use online power profiler tool.

    1. my requirement of project to use 3v/3.3v button cell with nrf52833 soc. to advertise for 1 second and goes to sleep for 3 second periodically. minimum total average current should be in range 3uA - 20uA.  

    Einar Thorsrud said:

    In the nRF Connect SDK, one RTC is always used by the OS (Zephyr) to keep track of time. This is used to wake up as needed, and you can use the normal zephyr clock API's (see Kernel Timing). With this, the kernel handles the detail, and you get low power timers exposed to the application. This is generally what all nRF Connect SDK and Zephyr applications use.

    starkAbhi:

    2. timer interrupt alarm,  i have been use this timer. to toggle led. does below code will wakeup the nrf52833 dk from event based sleep? or please suggest code sample and advice regarding sleep?

    counter_start(counter_dev_o);
    	gpio_pin_set_dt(&led,1);
    	alarm_cfg.flags = 0;
    	alarm_cfg.ticks = counter_us_to_ticks(counter_dev_o, DELAY);
    	alarm_cfg.callback = test_counter_interrupt_fn;
    	alarm_cfg.user_data = &alarm_cfg;
    
    	err = counter_set_channel_alarm(counter_dev_o, ALARM_CHANNEL_ID,&alarm_cfg);

    starkAbhi:

    3. in online power profiler, it shows total average current. how many samples of measurement does it take to conclude its total average current.

Reply
  •  

    hi,

    Einar Thorsrud said:
    I understand. But please keep in mind that the lowest possible sleep current might not give you the lowest possible average current consumption, which in the end is what determines the battery life. (Like in the case I described in my previous post, if you don't retain RAM etc, you will need to do more processing when the device wakes up, and the resulting average power consumption may be higher).What is your requierment for average current consumption? You can use the online power profiler to see estimates on what it can be so that you will see what you can realistically achieve (this does not have the nRF52833, but you can select nRF52840 to get comparable numbers).

    starkAbhi:

    i got your point. now i am constraint to use "ram retention rtc wakeup" sleep mode to decrease current consumption. thanks to share. i will definitely use online power profiler tool.

    1. my requirement of project to use 3v/3.3v button cell with nrf52833 soc. to advertise for 1 second and goes to sleep for 3 second periodically. minimum total average current should be in range 3uA - 20uA.  

    Einar Thorsrud said:

    In the nRF Connect SDK, one RTC is always used by the OS (Zephyr) to keep track of time. This is used to wake up as needed, and you can use the normal zephyr clock API's (see Kernel Timing). With this, the kernel handles the detail, and you get low power timers exposed to the application. This is generally what all nRF Connect SDK and Zephyr applications use.

    starkAbhi:

    2. timer interrupt alarm,  i have been use this timer. to toggle led. does below code will wakeup the nrf52833 dk from event based sleep? or please suggest code sample and advice regarding sleep?

    counter_start(counter_dev_o);
    	gpio_pin_set_dt(&led,1);
    	alarm_cfg.flags = 0;
    	alarm_cfg.ticks = counter_us_to_ticks(counter_dev_o, DELAY);
    	alarm_cfg.callback = test_counter_interrupt_fn;
    	alarm_cfg.user_data = &alarm_cfg;
    
    	err = counter_set_channel_alarm(counter_dev_o, ALARM_CHANNEL_ID,&alarm_cfg);

    starkAbhi:

    3. in online power profiler, it shows total average current. how many samples of measurement does it take to conclude its total average current.

Children
  • Hi,

    starkAbhi said:
    1. my requirement of project to use 3v/3.3v button cell with nrf52833 soc. to advertise for 1 second and goes to sleep for 3 second periodically. minimum total average current should be in range 3uA - 20uA.  

    Do you mean to send several advertising pckets during this one second, and then no for the next 3 seconds, and then some for 1 second again, etc? If so, you can still use the online power profiler to estimate the current consumption but you need to do some simple calculations your self in addition to take into account that you are only actively advertising for 25% of the time, and for the rest of the you have the idle current consumption.

    starkAbhi said:
    2. timer interrupt alarm,  i have been use this timer. to toggle led. does below code will wakeup the nrf52833 dk from event based sleep? or please suggest code sample and advice regarding sleep?

    The counter_set_channel_alarm API can use both an RTC and TIMER as backend, and if it use an RTC it will be low-power. If use a TIMER, it will not (I do not know what your counter_dev_o is though). I would suggest using other Zephyr time API instead. For LED blinking for instance, I would just use k_msleep() as you can see  in the blinky example. This will pause the thread for the specified amount of time, and the kernel handles the timing using an RTC.

    starkAbhi said:
    3. in online power profiler, it shows total average current. how many samples of measurement does it take to conclude its total average current.

    This doe snot sample anything, but it is based on models that we have feed a lot of measurement data into. You can see in the plot which current consumption levels calculate for which duration of time with the given configuration.

Related