Power Consumption RAK4631+RAK19007+RAK5860

I’m using RAK4631(only) for BLE and RAK5860 with RAK19007 base board.
I have developed RTOS application with 4-5 tasks using Arduino BSP.

while BLE+Cellular it is consuming 25 to 30mA current and BLE alone consuming 5-6mA
Now want to know that any ways to reduce current consumption. I don’t know how to put into sleep mode.

@beegee help me out here

1 Like

What exactly do you mean with “RTOS application”?

What BSP are you using?

I’m using Arduino BSP. In that I’m using RTOS scheduler to run multiple tasks.

How do you put your tasks into sleep? Are you using semaphores or queues?

No I’m using delay function

If you are using FreeRTOS, you should not need to use delay().

Create timers that release semaphores and queues that wake up your tasks when they have something to do.

The typical FreeRTOS stuff.

Can you share any examples…? so it will be easy for me.

I have no simple examples, one use is in my SX126x-Arduino library where I use interrupts to release a semaphore to wake up a task to handle the interrupt.
And I use it a lot in my WisBlock API framework.

Just check the FreeRTOS documentation.

Can you share here the link for SX126x-Arduino library example?

The semaphore is release in the interrupt routine here:
SX126x-Arduino/src/radio/sx126x/radio.cpp at ade94370373052f584818f81f63081ad72ef4d72 · beegee-tokyo/SX126x-Arduino · GitHub

And the task is defined here:

As I said, I have no “simple” examples. This code is actually very complex because it serves for the ESP32 MCU’s nRF52 MCU’s and the RP2040 MCU’s.
All of them have differences in the handling.

Thank you. I’ll check.

I have to create individual timers for each task, then each timer callback should release the semaphore.
Is my understanding right?

You need a semaphore for each task.

The release of the semaphores for each task can be triggered by a timer or by an external event. I don’t know what your code is doing and why you need so many tasks.

With FreeRTOS and tasks, be careful with resources you use in your tasks.
E.g. if two tasks are reading sensors that are connected over I2C, you cannot run both tasks at the same time. You will get problems, because if both tasks try to use I2C at the same time, they will collide.

I have an application where I have to read sensor data, adc, gnss and scan and connect ble device. All these will have different time interval. So I have created task for each. It is working fine but current consumption is more. So just wanted to check for the optimisation.

Make sure you power down the sensors you have or at least put them into low power mode.
How to do this depends on the different sensors.

Okay. Is there any API available to put the device into sleep mode or deep sleep mode?

No, there is no API. You have to study the datasheets of your sensors. It is different for each sensor device.

No, I’m not asking about sensor. Asking about for RAK.

I can’t answer that. I don’t know how your code and tasks are setup.

If I want to build a new low power device, I usually start from Low-Power-PIO (if based on Arduino BSP’s) or from RUI3-LowPower-Example (if based on RUI3) and just add my timers, interrupts and sensor readings to it.

Okay. I’ll try to implement.