Rechargeable Li-Polymer
Rechargeable Li-Polymer
150mAh
Micro-USB
5V
500mA
-20C to 70C
25mm x 25mm x 7mm
10g
Applications
| The M5 Stack Battery Module is ideal for use in a variety of IoT applications, including |
Wearable devices
Wireless sensors
Robotics
Automation systems
Smart home devices
By providing a reliable and efficient power management solution, the M5 Stack Battery Module enables developers to focus on building innovative IoT applications with the ESP32 Core Development Kit.
M5 Stack Battery Module for ESP32 Core Development Kit DocumentationOverviewThe M5 Stack Battery Module is a rechargeable lithium-ion polymer battery designed for use with the ESP32 Core Development Kit. It provides a convenient and compact power solution for IoT projects, enabling developers to create portable and battery-powered devices.Technical SpecificationsBattery Type: Lithium-ion Polymer
Capacity: 390mAh
Voltage: 3.7V
Charging Current: 500mA
Dimensions: 35.5 x 25.5 x 4.5 mm
Weight: 15gConnecting the Battery ModuleTo use the M5 Stack Battery Module with the ESP32 Core Development Kit, connect the module to the Kit's battery pins as follows:Vbat pin on the Kit to the Vbat pin on the Battery Module
GND pin on the Kit to the GND pin on the Battery ModuleCode Examples### Example 1: Battery Voltage MonitoringThis example demonstrates how to use the M5 Stack Battery Module to monitor the battery voltage level using the ESP32's analog-to-digital converter (ADC).```c
#include <M5Stack.h>void setup() {
Serial.begin(115200);
}void loop() {
int batteryVoltage = analogRead(BATTERY_PIN);
float voltage = (batteryVoltage 2 3.3) / 4095;
Serial.print("Battery Voltage: ");
Serial.print(voltage);
Serial.println(" V");
delay(1000);
}
```In this example, the `analogRead()` function is used to read the voltage level from the BATTERY_PIN on the ESP32. The voltage value is then calculated using the ADC conversion formula and printed to the serial console.### Example 2: Low Battery WarningThis example demonstrates how to use the M5 Stack Battery Module to trigger a low battery warning when the voltage level falls below a certain threshold.```c
#include <M5Stack.h>#define LOW_BATTERY_THRESHOLD 3.5void setup() {
Serial.begin(115200);
}void loop() {
int batteryVoltage = analogRead(BATTERY_PIN);
float voltage = (batteryVoltage 2 3.3) / 4095;
if (voltage < LOW_BATTERY_THRESHOLD) {
Serial.println("Low Battery Warning!");
// Add additional code here to trigger an alarm or notification
}
delay(1000);
}
```In this example, the voltage level is continuously monitored and compared to the `LOW_BATTERY_THRESHOLD` value. When the voltage level falls below the threshold, a low battery warning message is printed to the serial console. You can add additional code to trigger an alarm or notification based on your specific requirements.Note: These examples assume you have the M5Stack library installed and configured for your ESP32 Core Development Kit.