h2zero / n-able-Arduino

An arduino core for ARM based BLE devices supported by the NimBLE stack.
GNU Lesser General Public License v2.1
34 stars 12 forks source link

Need help with deep sleep NRF51822 board #22

Open MegaSegaDrive8 opened 1 year ago

MegaSegaDrive8 commented 1 year ago

Hello. Thank you for this library.

I need help with deep sleep with board nrf51822. Now for example "delay(5000);" get me about 0.8-0.9 mA.

Is this maximum mA for sleep mode?

h2zero commented 1 year ago

You're welcome 😄 , is there anything else on the board drawing current? On my nrf51822 boards the current draw is much less in sleep mode. What peripherals are you using?

MegaSegaDrive8 commented 1 year ago

No, just 2 contacts like switch, between GND and P16

Maybe I have a problem with the code. Do you have any example, for example, just advertising for 1 second when the contact is closed between P16 and GND?

h2zero commented 1 year ago

I don't have any examples of that at the moment but I am wondering if you are calling Serial.begin() in your code? the UART will consume power at that level.

beckmx commented 9 months ago

hello guys; @MegaSegaDrive8, i was wondering if you can share your example code, I wanted to do exactly the same thing, i want to advertise a custom payload and then send it to sleep, would be able to share at least the nuts and bolts. @h2zero i did also check your other repos but i was not able to find the deep sleep for nrf51822, great work!

h2zero commented 7 months ago

@beckmx systemPowerOff() will put the device into deep sleep while just calling delay() will put the device into "system on" sleep mode.