RAK 11720 - Can't get below ~80uA

Problem:
We are developing a new revision of our custom sensor using the RAK 11720 and RUI3. Previously we had used a RAK 4630 with WisBlock API GitHub - beegee-tokyo/WisBlock-API: WisBlock API takes care of all the LoRaWAN, BLE, AT command functionality. It makes development of event driven power savings applications easy..

On our old revision we were able to get down to ~40uA of sleep current. On this new revision we are only able to get to ~83uA.

What have we done?
When quickly putting together some test firmware to ensure all our peripherals were working as expected we found the current consumption to be quite high when calling api.system.sleep.all().

We figured this is likely the state of some of the GPIO when sleeping. After configuring all the the GPIO as INPUT_PULL UP / INPUT_PULLDOWN / TRISTATE etc we were able to finally get it to ~83uA.

My suspicions
We have two devices that we communicate with over SPI and three over I2C. I found even after calling SPI.end() or Wire.end() I was not getting low sleep current. To achieve ~83uA I had to pull all the I2C and SPI GPIOs high.

I feel like this shouldn’t be the default and maybe I am missing something?

I have also noticed periodic spikes in the power profile when using the NRF power analyzer despite calling api.ble.stop(), api.ble.adversite.stop() and api.ble.uart.stop(). Is there maybe something else still on which could be contributing to the additional ~40uA.



We were really hoping this update would be quite easy and I have gone through the hardware bit by bit trying to find a fault in the design but it feels like it is something to do with RUI3. Am I missing something here? Some help would be very much appreciated as we are trying to finalise a large order of these units and want to ensure we can get this power consumption down.

Regards,

Hi @tom-b

The peaks that you see are the FreeRTOS scheduler that is running the RUI3 and waking up ~every 1 second, so that is normal behaviour.

I can only test on a WisBlock based system, so the power consumption is higher compared to custom PCB with the RAK11720 on it.

Without any other devices (No I2C, no SPI initialization), I am getting an average of 25.57uA on a WisBlock RAK19003 Base Board.

With Wire.begin()/Wire.end() and SPI.begin()/SPI.end(), I am still getting down to the same, with no I2C or SPI devices attached. I am not de-initializing the I2C SPI pins here.

Do you use api.system.lpm.set(1); in your code? That will force a better sleep mode (lower power consumption)?

Above measurements are made with RUI3 V4.0.6 which was released last weekend.

Hi @beegee!

Thanks for running these tests. I assume this is how it is supposed to work. We are using api.system.lpm.set(1); in our code.

We will test with the latest version of RUI3 and see if we have any difference there.

Hi @tom-b

Here is the code I used to test. It is a simple, low power example code for RUI3 devices.
RUI3-LowPower-Example.zip (5.1 KB)

This version of the code toggles SPI and I2C .begin() and .end() between each LoRaWAN transmission.
Send interval can be set with ATC+SENDINT=xxx with xxx in seconds between transmissions.

@beegee we have updated to V4.0.6 and have actually seen an increase in current consumption. Now sitting around 119uA.

If I remove my code which pulls the I2C pins and SPI high it jumps up to 180uA.

I have looked at your code and don’t see anything that jumps out that isn’t being done in my code.

Before calling api.system.sleep.all() I am setting all the GPIOs to the state that “should” be lowest power. Does calling the sleep function change the state of any of the GPIOs? Are there any I shouldn’t be using?

api.system.sleep.all() is part of the RUI3 that is not open source and I have to check with the team if there are any GPIO de-initializations done.

May I ask you what I2C and SPI devices you are using? Are you controlling the power supply of these devices?
If this is confidential, we can switch this issue to our Help Desk. Just send me an inquiry to [email protected] or [email protected] and we can discuss it there in private.

EDIT

Corrected email address.
For GPIO’s you should de-initialize only exposed GPIO’s. Some GPIO’s are used internally to control the SX1262 LoRa transceiver and can cause problems if floating. (e.g. floating RESET to the SX1262)

I would prefer to give those details privately at this stage but will post our findings in this thread for others to reference if we resolve it.

I’ll send an email through to [email protected] now.

Cheers,

Hello @beegee ! Adding onto this, I’ve noticed that api.sleep.all does not appear to be sleeping the device correctly

Using the stock example LoRaWan_OTAA with the device credentials changed so I can connect to my nearby network, I am seeing that the device is actually on for long periods of time after a successful send. It does go to sleep eventually, but only for a few seconds before waking up again. While asleep (and powering via 3V3 header on the core module) I’m seeing ~168uA minimum

serial output for the captured is below:

Data Packet:

0x74 0x65 0x73 0x74

Sending is requested

WAKE_UP

Successfully sent

+EVT:SEND_CONFIRMED_OK

SLEEP

WAKE_UP

SLEEP

Data Packet:

0x74 0x65 0x73 0x74

Sending is requested

WAKE_UP

Successfully sent

+EVT:SEND_CONFIRMED_OK

SLEEP

WAKE_UP

SLEEP

Data Packet:

0x74 0x65 0x73 0x74

Sending is requested

WAKE_UP

Successfully sent

+EVT:SEND_CONFIRMED_OK

SLEEP

WAKE_UP

The serial output confirms this strange behavior, with SLEEP message being printed out long after the send action, rather than immediately after as is expected.

Any recommendations here would be appreciated, thanks. Perhaps I should shift to the rtos implementation instead of this delay() replacement, if you think that would be more robust?

Hi Charles,
The LoRaWan_OTAA example is not really made to give lowest power consumption, but to show the principles of using RUI3.

For a low power example, have a look into the RUI3-LowPower-Example

Here is my measurement with that code. Sending every 60 seconds, sleep current is 28uA, sleep starts immediately after TX/RX cycle is finished:

Hi Bernd!

Thank you very much for that information, very good to know. I’ll have a play around with that sketch instead and let you know if there are any issues.