🛠 Energy-Aware Automation with M5Stamp Timer Power 2

M5Stamp Timer Power 2 (PY32L020) · avance · Implémentez une logique de réveil programmé et de gestion dynamique des sorties pour optimiser l'autonomie d'un nœud IoT.

Objectives

This tutorial aims to configure the M5Stamp Timer Power 2 for a deep sleep cycle with scheduled wake-up, sequentially activating power rails to minimize average consumption below 15 µA.

Required Hardware

Steps

  1. I2C Initialization: Configure the I2C bus to 400 kHz. The device address is 0x6E. Verify communication by reading the ID register.
  2. Output Configuration: Enable the LDO regulator (3V3_LDO_OUT) for the host and the DC-DC converter (3V3_DCDC_OUT) for peripheral sensors. Adjust the charge current to 180mA for maximum autonomy.
  3. Wake-up Programming: Configure the internal timer for a wake-up every 60 seconds. Set the Sleep Mode to achieve a consumption of 6.72 µA.
  4. Interrupt Management: Map a GPIO pin to an external interrupt (IRQ) for critical events (e.g., button press), allowing asynchronous wake-up.
  5. Main Loop: In the host code, after task execution, send the sleep command via I2C. Wait for the wake-up interrupt.

Verification

Measure the supply line current with a multimeter in µA mode. In sleep, the value should be close to 6.72 µA. During wake-up, observe the activation of the 3V3 outputs. Check the stability of the EXT_5V_INOUT voltage under load.

Further Reading

Integrate internal ADC readings to monitor battery voltage. Implement deep-discharge protection logic by cutting outputs if voltage drops below 3.3V.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials