

The WeMos D1 Mini Battery Shield is an add-on module designed to provide a portable power supply for the WeMos D1 Mini, a popular ESP8266-based development board. This shield features a battery connector, charging circuitry, and voltage regulation, making it ideal for powering IoT projects, wearables, and other portable applications. It simplifies the integration of a rechargeable lithium-ion or lithium-polymer battery into your project, ensuring reliable and efficient power management.








The WeMos D1 Mini Battery Shield has the following pin layout:
| Pin Name | Description |
|---|---|
| 5V | Regulated 5V output from the battery or USB input. |
| G | Ground pin, common ground for the shield and connected devices. |
| D+ | USB data positive (used for USB communication, typically not connected). |
| D- | USB data negative (used for USB communication, typically not connected). |
| BAT | Direct connection to the battery's positive terminal (unregulated voltage). |
Connect a Battery:
Stack the Shield:
Power the Circuit:
Monitor Charging Status:
Connect Additional Components:
Although the WeMos D1 Mini Battery Shield is not directly connected to an Arduino UNO, you can use the following example code to monitor the battery voltage when connected to the WeMos D1 Mini:
// Example code to read battery voltage on the WeMos D1 Mini
// Connect the BAT pin to an analog input pin (e.g., A0)
// Define the analog pin connected to the BAT pin
const int batteryPin = A0;
// Define the voltage divider ratio (if using a voltage divider circuit)
const float voltageDividerRatio = 2.0;
// Define the ADC reference voltage (3.3V for ESP8266)
const float adcReferenceVoltage = 3.3;
void setup() {
Serial.begin(115200); // Initialize serial communication
Serial.println("Battery Voltage Monitoring");
}
void loop() {
// Read the raw ADC value
int rawValue = analogRead(batteryPin);
// Convert the raw ADC value to voltage
float batteryVoltage = (rawValue / 1023.0) * adcReferenceVoltage * voltageDividerRatio;
// 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 the BAT pin is directly connected to the analog input, ensure the voltage does not exceed the ADC's maximum input voltage (typically 3.3V for the ESP8266). Use a voltage divider if necessary.
Battery Not Charging:
No Output Voltage:
Overheating During Charging:
Incorrect Voltage Readings:
Q: Can I use a different type of battery with this shield?
A: No, the shield is specifically designed for lithium-ion or lithium-polymer batteries with a nominal voltage of 3.7V.
Q: Can I power the WeMos D1 Mini directly from the BAT pin?
A: No, the BAT pin provides the unregulated battery voltage. Use the 5V pin for regulated output.
Q: How do I adjust the charging current?
A: The charging current can be adjusted by replacing the onboard resistor. Refer to the shield's datasheet for the resistor value corresponding to your desired current.
Q: Can I use the shield without a battery?
A: Yes, the shield can be powered via USB without a battery, but the charging functionality will be inactive.