🛠 Sommeil bas courant du module et réveil

Arduino MKR GSM 1400 · avance · Schéma : IMG-mkr-gsm-1400-avance-2-mkrgsm-sommeil-bas-courant.svg — MKR GSM 1400 sur batterie LiPo endormie (LED éteinte, croissant de lune), une ligne de courant chutant de quelques milliampères vers quelques microampères, bouton de réveil sur D2.

Objectives

Extend battery autonomy for a field station: put the SARA-U201 module into reset (the SAMD core already keeps the modem in reset at startup to save energy), put the SAMD21 to sleep, and wake the board on an event — button press or periodic alarm — for a quick measurement and transmission. The Arduino design documents a drop from "several mA to a few µA" when the modem and crypto chip are powered off.

Hardware

Complete code

#include <ArduinoLowPower.h>

const uint8_t BTN_REVEIL = 2;
volatile bool reveille = false;

void onReveil { reveille = true; }

void setup {
  // 1) Maintenir le modem GSM en reset pendant le sommeil.
  //    GSM_RESETN (broche 31 de la variante) est actif a l'etat BAS.
  pinMode(GSM_RESETN, OUTPUT);
  digitalWrite(GSM_RESETN, LOW);

  // 2) USB inutile en sommeil profond : couper la CDC libere de l'energie.
  Serial.begin(9600);
  delay(3000);                      // laisser le temps d'ouvrir la console
  Serial.println("Entree en sommeil, appuyer sur D2");

  LowPower.attachInterruptWakeup(BTN_REVEIL, onReveil, FALLING);
}

void loop {
  reveille = false;
  LowPower.sleep;                 // SAMD en mode attente, reveil par IT

  // --- Reveil : phase active courte ---
  digitalWrite(GSM_RESETN, HIGH);   // relancer le modem
  delay(1000);
  Serial.begin(9600);
  Serial.println("Reveille ! Mesure + transmission ici.");
  // ... mesure capteur, gsmAccess.begin, envoi GPRS/SMS, shutdown ...;
  delay(3000);
  Serial.end;
  digitalWrite(GSM_RESETN, LOW);    // remettre le modem en reset
}

Expected verification

On the multimeter, the average current drops significantly when LowPower.sleep is reached and the modem is held in reset; pressing D2 wakes the board and the console displays the wake-up message. Measure the average over several minutes: a registered module transmits in bursts (paging), and the BQ24195L charging PMIC can mask microamperes if the charger is powered via USB.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials