Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Quick-Start

D1 mini Battery Shield


Table of Contents

Introduction 3
Specifications 4
Ports 5
How to use Jumper J1 6
How to use Jumper J2 7
Battery polarity 8
Test Example : Measuring battery voltage 9
Introduction

The D1 Mini Battery shield offers a convenient solution for powering the D1
Mini module using Li-ion/Li-Po battery. It incorporates an integrated DC-DC
boost (step-up) converter that efficiently raises the battery voltage from 3.7V
to 5V, providing a reliable power source for both the D1 Mini module and its
associated shields with a robust current supply of up to 1A. Furthermore, this
shield simplifies the battery replenishment process by allowing you to recharge
it effortlessly. When your battery is low, a simple connection to a USB power
source through a microUSB cable initiates automatic recharging. Additionally,
the shield features two LEDs that act as visual indicators, signaling the ongoing
battery charging status and marking the moment when the charging process
has been successfully completed.

On the following pages, we will introduce you to how to use and how to set-up
this handy device.
Specifications

Charging Voltage 10V MAX 5V Recommended

Charging Current max 1A

Battery voltage 3.3-4.2V

Boost Power Supply 5V(max: 1A)

Battery connector type JST PH2-2mm

Connectors USB, 10 pin

Dimension 28 x 25 x 8 mm
Overview

Components
Name Description

Battery connector Connect to lithium Battery (normal 3.3-4.2V)

Micro Usb Charging port ( Normal 5V)

Green Led lights when charging is completed

Red Led lights when charging

Jumper J1 setting max charging current, 0.5A or 1A.

Jumper J2 Connect battery to A0


How to use Jumper J1

J1 is a jumper that controls the maximum charging current for your shield
battery when it's being charged. It has two settings:

● 0.5A : This is the default setting. When J1 is not soldered, the maximum
charging current is set to 0.5 amperes. This means that when you're
charging the battery, it will charge at a rate of up to 0.5A.

● 1A : If you solder the J1 jumper, it increases the maximum charging


current to 1 ampere. This means that when the jumper is soldered, the
battery will charge at a faster rate, up to 1A.

Generally the max charging current is about 0.5 C or 1C


C is the capacity of the battery mah

Ultimately the best charging current depends on your specific needs and how
you prioritize factors like charging speed, battery longevity, and safety. It's
advisable to refer to the manufacturer's recommendations and consult the
datasheets or user manuals of the battery and charging components for the
most accurate guidance.
How to use Jumper J2

In order to measure the battery voltage, we need to connect A0 to the battery


by soldering the jumper j2.

The D1 mini already has an internal voltage divider that connects the A0 pin to
the ADC of the ESP8266 chip. This is a 220 k resistor over a 100 k resistor.
By adding 130K of the shield we will get the divider factor equal to :

100 / 130 + 220 + 100 = 0. 22

So If battery fully charged, voltage would be 4.2 V


1023 ⇒ 4.2V
and d1 mini will read 1023 analogic value which refer to 0.932V = 0.22 * 4.2.
Battery polarity

You should be mindful of the correct orientation when connecting the battery to the
shield. Align the connector JST PH2-2mm direction to the shield in the right
direction.

Also you can solder the battery directly to the shields, there are markings or labels to
indicate the positive (+) and negative (-) terminals. Ensure that you align the battery's
positive terminal with the positive marking on the shield and the negative terminal
with the negative marking.

Connecting the battery in reverse polarity can damage the shield and the D1 Mini, so
it's essential to get it right.
Test Example : Measuring battery voltage

It is very convenient to know the remaining voltage level of the battery in order
to predict the recharge (or replacement). The D1 Mini module has an analog
input that can be used to monitor the charge level of the battery.
First Step connects A0 to the battery, through soldering Jumper J2.

Code :
#define sensivity (4.2 / 1023.0)
#define maxVoltage 4.2

void setup() {
Serial.begin(9600);
}

void loop() {
float sensorValue = analogRead(A0);
Serial.print("Raw adc: ");
Serial.println(int(sensorValue));

sensorValue = sensorValue * sensivity;


Serial.print("Voltage: ");
Serial.print(sensorValue);
Serial.println("V");

// Calculate the percentage level


float percentage = (sensorValue / maxVoltage) * 100.0;
Serial.print("Percentage: ");
Serial.print(percentage);
Serial.println("%");

delay(1000);
}
This code reads an analog voltage from a sensor connected to pin A0, then
converts and prints the raw analog-to-digital conversion value, the voltage in
volts, and the percentage of the maximum voltage (4.2V) that the battery
reading represents. It continually loops and prints these values to the serial
monitor every second. The sensitivity is used to convert the raw ADC value to
voltage.

You've done it, you can now use your module for your projects :)
Now it is time to learn and make the Projects on your own. You can
do that with the help of many example scripts and other tutorials,
which you can find on the internet.
If you are looking for the high quality microelectronics and
accessories, AZ-Delivery Vertriebs GmbH is the right company to get
them from. You will be provided with numerous application
examples, full installation guides, eBooks, libraries and assistance
from our technical experts.

https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us

You might also like