Test of the LiPo Battery Shield for Wemos D1 Mini (measure voltage and charge level) [Exclusive Guide]

11:11 am April 10, 20179689

we continue our series of articles of the Shields (expansion card) presentation for the ESP8266 Wemos D1 Mini . A Shield that is essential to the achievement of connected objects, models or skitter, is the Shield Battery . Sold less than € 3 live from China, it allows to feed the Wemos D1 Mini using a rechargeable battery to handle reloading it.

The Shield Battery LiPo comes in an anti-static bag with a set of connectors (3 different types). The charging circuit is built around the charger TP5410 adapted to the recharge LiPo batteries . The card for two connectors. The first connector is type micro-USB (OTG). It allows to recharge the battery from a 5 volt power supply. We can use a charger or the USB of a computer. The other connector is of type JST XH2 – 2.54 mm . It allows you to connect a LiPo battery (3, 3V to 4, 2V) the card is also equipped with a converter that allows to increase the voltage of 3, 7V issued by battery life up to 5 Volts.

Technical data:

  • load voltage: nominal 5V (maximum 10V)
  • charge current: 0.5 A default. Weld the jumper J1 to increase 1 for (beware, check compatibility with the battery before making any changes)
  • battery Lithium supported: 3.3 to 4, 2V
  • voltage up to 5V converter (1 max.)
  • Battery as JST Connector XH2 – 2.54 mm
  • connector micro-USB (OTG) for charging (5V, 10V max)
  • Green Led: illuminated when the charge is complete
  • red Led: lit during charging
  • Jumper J1: allows to increase the charge current of 0.5 A to 1 A

specifications given as an indication. They can vary from one manufacturer to another. Check compatibility with your battery and your charger before using Battery Shield. Never exceed the permissible maximum voltage by the battery. Non respect of the instructions may cause the explosion of the battery.

wemos battery shield circuit

attention. The connector is different from JST – PH usually used for charging LiPo batteries modules

if the LiPo battery you bought is not equipped with the right connector, it must be replaced. We find it quite easily on Aliexpress or Amazon lots of cables with the JST XH2 – 2.54 mm connector.

Free everyone to optimise the stacking of the shields on the Wemos D1 Mini. Here I soldered a long connector to add other Shields on top of the Shield Battery.

before you solder connectors, be sure to follow the continuity of the pins (in front of TX… TX) Otherwise, the Wemos will not work.

To solder connectors properly, I recommend positioning the connectors on a breadboard the welding time.

shield battery wemos d1 mini positionnement connecteur

Depending on the manufacturer (seller), connectors can really be too long. Before the shields are not too far apart (which would be a shame), the best thing to do is to cut the legs of the connectors. For precise cutting, you can make a small guide with a sheet of paper. Mark with an indelible pen the part to be cut before cutting each pin with pliers. Here, the pins measure 8mm .

shield wemos d1 mini decoupe pattes broches trop longues

The result is a clean and compact stacking.

shield battery empile sur wemos d1 mini

When developing objects connected battery operated, it is convenient to know the level remaining in order to predict the reload (or replacement) of the latter. The Wemos D1 Mini is based on an ESP8266 (model ESP – 12 x), it for so an analog input that can be used to track the level of battery charge. In the tutorial previous , we saw how to theoretically calculate the battery voltage using a bridge divisor. Here, we use a simpler method.

We’ll just have to decrease the voltage delivered by the battery not exceed 3, 3V eligible by the A/D converter. For this you can for example use a resistance of 1, 5MΩ. Solder resistance between the positive battery connector pin and PIN A0 of the Shield Battery.

shield battery lipo wemos d1 mini resistor measure tension shield battery lipo wemos d1 mini resistor measure tension top

careful not to overheat the component or make fuser Tin on the slopes of the Shield. This operation will void any warranty

make then several readings of voltage with a multimeter in recovering the level of the A/D converter. Here is for example the statement that I made for a LiPo battery 3.7V 1100 mAh capacity .

shield battery wemos d1 mini batterie lipo tension niveau convertisseur analogique a0

In general, a battery will discharge linearly under normal conditions of temperature and usage. The easiest is to use the function map that allows to link the level of the A/D converter to the associated physical quantity. Small point of detail, the map function does not support decimal numbers. We’re going to work around the problem very easily by multiplying tensions by 100 and then dividing by 100 voltage returned by the map function.

It is just as easy to determine the level of battery charge. You can easily determine the battery threshold which corresponds to a 100% load depending on the used battery. You will certainly notice an increase in tension during recharging recharging. So to do a little cleaning if the level exceeds 100%.

This method will give you a pretty good idea of the level of battery charge. Beware, it is more an indicator that accurate a measurement.