Skip to content

Power consumption #51

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
lpercifield opened this issue May 15, 2017 · 18 comments
Open

Power consumption #51

lpercifield opened this issue May 15, 2017 · 18 comments
Milestone

Comments

@lpercifield
Copy link

First of all, awesome work on this hardware and core!

Secondly, Power consumption:
I've been testing with this core, and it seems that there is significant quiescent power consumption, regardless of actual hardware.
On the Feather nRF52 board using the beacon example I'm seeing 13mA average, and thats with the connection LED disabled.
Using a Red Bear Nano 2 (with their bootloader) but the same compiled hex, and powering off the VDD pin (3.3v) I'm still seeing ~6mA.

Using the Red Bear Nano 2 and their beacon code, I can get average power consumption below 20uA!

I'm hoping to dive in and do some deep level debugging with this core, but need to get the power under control relatively quickly for a prototype.

Any thoughts or suggestions would be helpful!

Thanks and keep up the great work

@microbuilder
Copy link
Contributor

Getting proper low power numbers is high on our ToDo list, but we've made a conscious choice to focus on critical BLE features and helper classes first since that's what 95% of people 'need' out of the gate.

Low power is unfortunately a very time consuming thing to get right since everything has to be done in just the right fashion to get the best case scenario power numbers, and it's 90% a firmware problem.

Feel free to open a PR or issue if you have something specific to contribute or point out.

@lpercifield
Copy link
Author

Great, I'll be putting in some hours on it this week, so I'll see what I can find.

@microbuilder
Copy link
Contributor

You mind find this a useful purchase if you're serious about low power measurements but don't have access to a higher end DMM or dedicated low power equipment: http://www.nordicsemi.com/Products/Power-Profiler-Kit

There is an alternate cross-platform UI for it as well if you aren't on Windows: https://qoitech.com/#/nordic?_k=1xkxah

@hathach hathach added this to the 1.0.0 milestone Oct 10, 2017
@ghost
Copy link

ghost commented Jan 18, 2018

I am interested in this as well. Hopefully this will be sorted out soon

@chaffneue
Copy link

Think it's something to do with Arduino timer interrupts not letting the MCU enter low power mode? Any idea where to start looking into this? I'm seeing about the same, a consistent 13mA draw no matter if I'm using waitforevent() or not. Definitely seems like the power consumption hikes up in the loop section. Here's a video from my startup sequence - It goes from about 7mA to 13mA. https://www.flickr.com/gp/chaffneue/mUp94h

@chaffneue
Copy link

Oh. It's a hardware issue with this board https://www.adafruit.com/product/3406 (It's out of stock now).. damn what a waste. For anyone stuck on this, you can remove the USB bridge chip on this model pretty easily with hot air, but programming would need an external serial board connected to the rxd/txd pins :/ I guess I'll just wait for the new hardware and just use this as a dev board in the meantime. I was kind of wondering if that would happen looking at the schematics. I was assuming the 2104 would be bus powered only and out of the circuit when powered by the lipoly, but no.

https://forums.adafruit.com/viewtopic.php?f=24&t=128823&p=641636#p641352

https://devzone.nordicsemi.com/f/nordic-q-a/28911/can-t-put-adafruit-nrf52-feather-board-into-low-power

@ladyada
Copy link
Member

ladyada commented Feb 8, 2018

yep that was our mistaken assumption too. the next time we have the nrf52 feather in stock will be the new version, please sign up and you'll be notified (no ETA, so please sign up! :)

@chaffneue
Copy link

Signed up! :)

@ladyada
Copy link
Member

ladyada commented Feb 8, 2018

OK we might have a few stragglers go into stock, if you get a notification in the next day - its just the last of the stock (we do a final count and often there's a couple extra kicking around)

@chaffneue
Copy link

I've removed the CP2104 from the board and there's still about a 1mA constant current draw from somewhere. I'm guessing it's the quiescent current from the regulator. Will the new design have tweaks to the power supply as well?

@ladyada
Copy link
Member

ladyada commented Feb 10, 2018 via email

@pbecchi
Copy link

pbecchi commented Feb 25, 2018

Hi, as for hathach suggestion I bring my comments on power consumption here!
First of all the hardware: I use the nRF52 dk evaluation board , your Arduino core works quite well there!
I measure current with a multimeter waiting to get the power profiler kit.
Second the SW: on my initial measurement I have found a constant 7 mA consumption of my code and this was more than 10 times what I was expecting.
Then I have started to do some test on very simple code to try to understand what it is causing this.
Simple example like the blink.ino draw a correct amount of current from 5 to 30 uA( 30 when the led light up).Now if you add Serial.begin the current jump to 500 uA basically constant indipendent from print operations.To come back to previous behaviour it is not enough not executing those statement you have to fisically take all serial statements out of compilation.
I have tested then dual Uart demo : current was as expected (commenting out all print statements and serial.begin) about 1.5 mA during advertising that go to about. 50 to 200 uA after 30 seconds.
Then I have tested ReadWrite.ino. Here initially I got the 6 7 mA. Then I took out all serial. Statements still 6 mA. Then I took out all Nffs statements and finally the current went to less then 10uA!
Now the big surprise: I restored the Nffs statements and currents continued to be very low about 30uA!
Bringing back the Serial.. statements I went to 500uA as expected!
This behaviour is very strange....it look like there is some code linked to at compilation time and not necessary that create this overconsumption .Arduino IDE keep this code in the compilation even if you don't use any more the features that caused this behaviour.Then if you go to a very minimal code this go away and don't come back when you recreate your code. This is very strange......any idea......any test to perform!

Regarding hybernation I have tested waitForEvent without getting any effect! The code never stop at the statement .It should be very nice to be able to enter hybernation up to next Ble operation or for a certain amount of time but I cannot find any way for doing that!

@pbecchi
Copy link

pbecchi commented Feb 27, 2018

I have found that the 7mA are pin related.
I guess there is some pin setting, may be coming from bootloader or from the libraries(Nffs?) ,that may not be compatible with my board hw! I have not found yet the actual pins that may draw this current or the way to take it out, but it doesn't come from my code.

@coltonottley
Copy link

There's definitely some problem with the arduino libraries, it's not the hardware. Using the Nordic SDK I can get the power consumption down to 16 uA while advertising. Doing the same thing with the Arduino IDE I'm seeing a constant 7mA power consumption once BLE has been connected or once the code is allowed to enter loop.

@jpconstantineau
Copy link
Contributor

Adding "Delays" in the loop does lower power consumption significantly. I had 6-12mA before I changed a few things in my code but the biggest drop happened when I added "delay(25);" to my loop to reduce the number of times it cycles though the loop per second. I now have around 500uA consumption. Nowhere close to the 10-20uA while advertising but an improvement.

@coltonottley
Copy link

Yeah that's a good find. That works for me as well. Thanks for sharing. It looks like delay is using the freeRTOS vTaskDelay function then? And loop is a scheduled task.

@pbecchi
Copy link

pbecchi commented Jul 19, 2018

I agree!
The only way I have found to lower power consumption is to insert a delay(Ms) in the loop().
Increasing Ms lower the power drain.....
From 6mA with Ms=0
To 100uA with Ms=200.

@Ironman-007
Copy link

@pbecchi : what are Nffs statements? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants