Skip to content

BLE Power consumption after BLE.end() #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
oRMMo opened this issue Dec 11, 2020 · 4 comments
Open

BLE Power consumption after BLE.end() #149

oRMMo opened this issue Dec 11, 2020 · 4 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@oRMMo
Copy link

oRMMo commented Dec 11, 2020

Hi,

Related to #65 and the fix #92, BLE.end() still draw around ~0.5 mA on NANO 33 BLE Sense.

@facchinm mentioned that the CordioHCIHook doesn't shut down the radio (#65 (comment)).
So I tried inserting NRF_RADIO->TASKS_STOP = 1; or/and NRF_RADIO->TASKS_DISABLE = 1; after BLE.end() with no success (wishful thinking I believe :)).

This sketch is around ~ 1.562 mA


#include <ArduinoBLE.h>

BLEService serv("19B10010-E8F2-537E-4F6C-D104768A1214");
BLEByteCharacteristic charac("747ce3a8-3588-11eb-adc1-0242ac120002", BLERead | BLENotify);


void setup() {
  
  digitalWrite(LED_PWR, LOW);
  
  Serial.begin(9600);
  while(!Serial);
  
  if (!BLE.begin()){
    Serial.print("NO BLE");
    while(1);                                                                        
  } else {
    Serial.println("BLE Started");  
  }
  
  BLE.setLocalName("TEST_BLE_Power");
  BLE.setAdvertisedService(serv);
  serv.addCharacteristic(charac);
  BLE.addService(serv);
  BLE.setAdvertisingInterval(1600);
  BLE.advertise();
  BLE.end();
}

void loop() {
  delay(1000);
}

The same sketch without the BLE.begin() (without starting then stopping back BLE) is around ~1.067 mA

#include <ArduinoBLE.h>

BLEService serv("19B10010-E8F2-537E-4F6C-D104768A1214");
BLEByteCharacteristic charac("747ce3a8-3588-11eb-adc1-0242ac120002", BLERead | BLENotify);


void setup() {
 
 digitalWrite(LED_PWR, LOW);
 
 Serial.begin(9600);
 while(!Serial);
 
 /*if (!BLE.begin()){
   Serial.print("NO BLE");
   while(1);                                                                        
 } else {
   Serial.println("BLE Started");  
 }*/
 
 BLE.setLocalName("TEST_BLE_Power");
 BLE.setAdvertisedService(serv);
 serv.addCharacteristic(charac);
 BLE.addService(serv);
 BLE.setAdvertisingInterval(1600);
 BLE.advertise();
 BLE.end();
}

void loop() {
 delay(1000);
}

If I run the same sketches without Serial.begin() & no USB cable connected the consumption goes down of course but the BLE.end() "cost" stays the same.

I am trying to get as much low power consumption as possible for my project and I am actually down to around ~205uA without radio. With radio on only for TX when needed, everything would be set for months on battery. Still need to find a solution for the BLE Off power draw.
I tried digging in the Arduino BLE library but it is way beyond my knowledge & skill.

Any ideas how to go about this? Any help is welcome.

@facchinm
Copy link
Contributor

Hi @oRMMo ,
we are working closely with arm to bring the low power performance on nRF52 on par with softdevice's. Next version of the nordic core will contain some important fixes. I'll keep you posted as soon as we have some pre-release core if you want to take a look 🙂

@oRMMo
Copy link
Author

oRMMo commented Dec 14, 2020

Hi @facchinm ,
Thanks for the heads up! I will be more than happy to take a look 👍

@tangtangdn
Copy link

Hi @oRMMo ,
we are working closely with arm to bring the low power performance on nRF52 on par with softdevice's. Next version of the nordic core will contain some important fixes. I'll keep you posted as soon as we have some pre-release core if you want to take a look 🙂

Hi Facchinm, thank you very much for your information. I have the same problem. Using both BLE.begin() and BLE.end() leads to the power consumption increase of about 300uA. However, it should be very close to without BLE.begin after using BLE.end() (I turn on the BLE, then turn off it, I think it should not cost more power after BLE turned off). Could you kindly tell me what caused the power consumption increase after BLE.end? i.e. what is enabled after BLE.begin but not disabled after BLE.end(). Thank you very much.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 9, 2021
@CaptainFalcon92
Copy link

Good day. I'm joining the nRF52840 party with the Xiao Seeed BLE today, and i wonder if this consumption issue is still a thing to this day ?

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants