Nano 33 BLE power consumption on delay function

Hi,
I am trying to reach low power consumption on Nano 33 BLE board.
I noticed a huge power consumption gap in the delay() function for the same code between version of board manager.
If I choose Arduino Mbed OS Nano Board V4.1.3, I have a bigger power consumption than with [DEPRECATED - Please install standalone package] Arduino Mbed OS Boards V1.1.3

How could I find the difference between both board manager version and correct the lastest one ?

Thank you!

Maybe you should consider not using the delay() function. How do the alternatives compare when it comes to power consumption ?

I tried only to go in deepsleep mode (with NRF_POWER->SYSTEMOFF=1) but I need external wakeup signal and RAM is OFF.

What are the other alternatives to delay() function?

I look deeper into version of board manager and the power consumption gap is between [DEPRECATED - Please install standalone package] Arduino Mbed OS Boards V1.3.2 and V2.0.0.

As you have not provided any details or the circumstances in which you are using it I cannot say for certain, but it might be worth looking at the use of the millis() function as demonstrated in the BlinkWithoutDelay example

I didn't test the function millis() but it will.
Update : millis() function is used for another purpose : be able to do something during the waiting time. I looking to do nothing during a given period of time with the less power consumption but with the RAM still ON.

I understood that delay() function manage to put the MCU in sleep mode but obviously something change between version of board manager.

The processor will never be "doing nothing"

I am very doubtful whether the delay() function ever put the processor into sleep mode

The millis() function simply returns the number of milliseconds elapsed since the processor was last powered up or reset. What you do with that value, including creating you own "delay" function is up to you

As a matter of interest, how long are the delays that you are using ?

I am trying to monitor sensor value every 20s and try to keep the power consumption as low as possible during those 20s.

Without delay() function my current consumption is around 3mA (so MCU still running)
With delay() function my current consumption is between 200 and 400µA depending of the version of board manager (MCU is in sleep mode and I have some current consumption from other parts).

I still suggest that you try the millis() function instead of delay(). I don't think that it will do you any good but it is worth a try

Have you considered explicitly putting the processor to sleep ? From what you say, nothing else is going on for 20 seconds in any case

With millis() function, the MCU still ON and the current consumption is around 3mA (instead of 200/400µA with delay() function).

Putting processor to sleep ? That what I'm trying to. According to How to reduce power consumption on the Nano 33 BLE – Arduino Help Center, delay() function is the way to go but is there another solution ?

It is frustrating when full details are not given of a problem. For instance, if you had said in your first post that you were following the advice in the page linked to then the problem would have been in context

I assume that you have followed all of the advice on that page

Sorry for that and thank you for your time.

Off course, I have followed all the advice on that page and lot of other found on this forum to optimize the power consumption :

That why my question was focus of the power consumption delta of the delay() function according to the version of board manager. I am happy with the power consumption of the delay() function with the old deprecated version of board manager but some functionnalities I am looking to use are not supported.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.