

The Wemos Li-ion Battery Shield for D1 Mini is a compact and efficient battery management module designed specifically for the Wemos D1 Mini development board. This shield allows users to connect a Li-ion or LiPo battery to power the D1 Mini, making it ideal for portable and low-power IoT applications. It features integrated charging circuitry, battery level indicators, and seamless integration with the D1 Mini ecosystem.








Below are the key technical details of the Wemos Li-ion Battery Shield:
| Parameter | Value |
|---|---|
| Input Voltage (USB) | 5V (via Micro-USB port) |
| Battery Type | Li-ion or LiPo (3.7V nominal voltage) |
| Charging Current | 500mA (default, adjustable via resistor) |
| Output Voltage | 5V (regulated) or 3.3V (via D1 Mini pins) |
| Charging Indicator LEDs | Red (charging), Blue (fully charged) |
| Dimensions | 34.2mm x 25.6mm |
The shield connects directly to the Wemos D1 Mini via its pin headers. Below is the pin configuration:
| Pin | Description |
|---|---|
| 5V | Regulated 5V output from the battery or USB input |
| 3V3 | Regulated 3.3V output (useful for powering low-voltage peripherals) |
| GND | Ground connection |
| D+ / D- | USB data lines (not typically used for battery management) |
| BAT | Direct connection to the battery's positive terminal (unregulated voltage) |
BAT pin to monitor the battery voltage in your circuit. Ensure your code accounts for the unregulated nature of this pin.If you are using the Wemos D1 Mini with the battery shield, you can monitor the battery voltage using the BAT pin. Below is an example sketch:
// Example code to monitor battery voltage using the BAT pin
// Connect the BAT pin to an analog input (e.g., A0) on the D1 Mini
const int BATTERY_PIN = A0; // Analog pin connected to BAT
const float VOLTAGE_DIVIDER_RATIO = 2.0; // Adjust if a voltage divider is used
const float ADC_RESOLUTION = 1023.0; // 10-bit ADC resolution
const float REFERENCE_VOLTAGE = 3.3; // Reference voltage of the D1 Mini
void setup() {
Serial.begin(9600); // Initialize serial communication
Serial.println("Battery Voltage Monitoring");
}
void loop() {
int rawValue = analogRead(BATTERY_PIN); // Read the analog value from BAT pin
float batteryVoltage = (rawValue / ADC_RESOLUTION) * REFERENCE_VOLTAGE * VOLTAGE_DIVIDER_RATIO;
// Print the battery voltage to the Serial Monitor
Serial.print("Battery Voltage: ");
Serial.print(batteryVoltage);
Serial.println(" V");
delay(1000); // Wait for 1 second before the next reading
}
Note: If you use a voltage divider to scale down the battery voltage, adjust the
VOLTAGE_DIVIDER_RATIOaccordingly.
Battery Not Charging
Shield Overheating
No Output Voltage
LEDs Not Working
Can I use a different type of battery? No, the shield is designed specifically for 3.7V Li-ion or LiPo batteries. Using other types may damage the shield or the battery.
What happens if I connect both USB and battery? The shield will prioritize USB power for charging the battery and powering the D1 Mini.
Can I adjust the charging current? Yes, replace the R3 resistor with a value corresponding to your desired charging current. Refer to the TP4056 datasheet for details.
Is the shield compatible with other boards? The shield is designed for the Wemos D1 Mini but may work with other boards that share the same pinout. Verify compatibility before use.