GithubHelp home page GithubHelp logo

arduino_nrf5x_lowpower's Introduction

Arduino_nRF5x_lowPower

Arduino Power Management Library for nRF5x

Usage

  • PowerMode

    • nRF5x_lowPower.powerMode(POWER_MODE_OFF); to completely shutdown the nRF5x
    • nRF5x_lowPower.powerMode(POWER_MODE_LOW_POWER); to switch to low power mode (default mode)
    • nRF5x_lowPower.powerMode(POWER_MODE_CONSTANT_LATENCY); to switch to constant latency mode
  • DCDC

    • nRF5x_lowPower.enableDCDC(); to enable the DC/DC converter
    • nRF5x_lowPower.disableDCDC(); to disable the DC/DC converter
  • Interrupt for WakeUp from PowerOff

    • nRF5x_lowPower.enableWakeupByInterrupt(uint32_t pin, uint32_t mode); to enable the Sense Interrupt
      • pin is the nRF5x Pin
      • mode can be any of the following (HIGH, RISING, LOW, FALLING)
    • nRF5x_lowPower.disableWakeupByInterrupt(uint32_t pin); to disable the Sense Interrupt

Documentation

SYSTEM ON

Constant latency

In constant latency mode the CPU wakeup latency and the PPI task response will be constant and kept at a minimum. This is secured by forcing a set of base resources on while in sleep. The advantage of having a constant and predictable latency will be at the cost of having increased power consumption. The constant latency mode is selected by triggering the CONSTLAT task.

Low power

In low power mode the automatic power management system, described in System ON mode, ensures the most efficient supply option is chosen to save the most power. The advantage of having the lowest power possible will be at the cost of having varying CPU wakeup latency and PPI task response. The low power mode is selected by triggering the LOWPWR task.

http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_2#unique_1349410009

SYSTEM OFF

When the device is in POWER_MODE_OFF, it can be woken up by following signals:

  • The DETECT signal, optionally generated by the GPIO peripheral
  • The ANADETECT signal, optionally generated by the LPCOMP module
  • The SENSE signal, optionally generated by the NFC module to “wake-on-field”
  • A reset

http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_1#unique_1707892264

Current consumption

http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pmu.html?cp=2_1_0_16_0#unique_1291325043

Dependencies

This library depends on the Arduino nRF5 package (https://github.com/sandeepmistry/arduino-nRF5)

Compatibility

This library should be compatible with all boards supported by the Arduino-nRF5

arduino_nrf5x_lowpower's People

Contributors

mristau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arduino_nrf5x_lowpower's Issues

Does this library support the nRF52840?

I can put the Adafruit nRF52840 feather board into power off mode just fine, but I'm not able to wake from an interrupt. In my case it's a button pulled low, and I'm trying to detect a RISING interrupt to wake. This code worked just fine on the Adafruit nRF52832 but I think something has changed and I'm having trouble finding any other way to do this in Arduino IDE.

nRF5x_lowPower.enableWakeupByInterrupt(11, RISING);  // not working, doesn't wake
nRF5x_lowPower.powerMode(POWER_MODE_OFF);  // working

Any help or hints is appreciated.

Example sketches

Thanks for creating this library, highly appreciated. Can you please add two example sketches, e.g.,

  • One that measures something based on a timer; e.g., reports the temperature from the sensor embedded inside the nRF 5 via BLE, and then goes to sleep for x minutes, then have it repeat

  • One that sleeps until it is triggered by an interrupt; e.g., a PIR motion sensor attached to the nRF5, and then sends the information "motion detected" via BLE

Also, maybe you can add some documentation on the power modes and what is possible in which power mode. What is the most power efficient way to send the temperature every x minutes?

Keep up the great work!

Sense input pin does not work in POWER_MODE_OFF

I just installed it last night and took the example as is. When I press the button (as in giving it an interrupt), it does not wake up the system at all. But the interrupt seems to work just fine in POWER_MODE_LOW_POWER and POWER_MODE_CONSTANT_LATENCY.

I got the latest nRF5 Core 0.6.0, what version do you think I should install to make POWER_MODE_OFF to work? Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.