🛠 Low-power : veille profonde et réveil

Adafruit Feather nRF52840 Express · avance · Schéma : IMG-nrf52840-feather-avance-1-nrf52840-low-power-system-off.svg — Feather nRF52840 sur batterie LiPo, pin ENABLE coupant le régulateur, ampèremètre en série, bouton RST et broche de réveil annotés.

Objectives

Minimize the Feather nRF52840's power consumption on LiPo: turn off the NeoPixel (notable permanent consumption), cut the regulator via the Enable pin, then put the SoC into SYSTEM OFF — wake-up is done by pressing RST (the reset pad re-powers the circuit). The nRF52840 manages internal LDO + DC/DC from 1.7 to 3.3 V; it is the board's regulator and the NeoPixel, not the core, that kill battery life.

Hardware

Full code

// nrf52840-low-power-system-off.ino
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel neo(1, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);

void setup {
  // 1) Eteindre le NeoPixel : alimente en permanence tant qu'on ne le force pas a 0
  neo.begin;
  neo.setPixelColor(0, 0);
  neo.show;
  // 2) Desactiver la charge USB inutilement, couper les broches inutilisees
  // (les laisser en entrees pour eviter les courants de fuite).
  Serial.begin(115200);
  delay(2000);                       // fenetre pour lire la derniere mesure
  Serial.println("Entree SYSTEM OFF : reveil par RST");
  Serial.flush;
  delay(100);
  // 3) Sommeil profond : SYSTEM OFF coupe presque tout ; seul le pad RESET
  // (bouton RST ou broche reset) relance l'alimentation du module.
  NVIC_SystemOff;                  // equivalent: NRF_POWER->SYSTEMOFF = 1;
  while (1) { /* jamais atteint */ }
}

void loop {}

Expected verification

After the console message, the ammeter drops sharply to the lowest measurable value; pressing RST restarts the program (message seen again in the console). Compare three levels: active code / NeoPixel off + EN cut / SYSTEM OFF — the difference lies mainly in the regulator and the NeoPixel.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials