Insane power consumption

We using a Wemos S2 mini for our little LiPo Battery driven Arduino project, but we have serious issues with the running time until the battery gets empty.

Our Arduino is most time in deep sleep mode and just use around 0,5 mA, on paper 0,5mA should be fine, just every minute we wake it up using a wakeup time delay, and directly go to sleep again, that takes maybe a second, in that time it uses around 40-50mA.

Theoretically a 1000mAh 3,7V LiPo Battery which has fully charged 4,2 volt should last for around around 30 days. Average power consumption around 1,33mA.
But in all test builds the battery goes empty after just 4-5 days.
We have no idea why.

A test with power consuming LED´s drawing 20mA permanently with the same battery is running for a duration of over 2 days/50 hours before voltage drops to low, so the battery looks like it delivers 1000mAh...

We tried different chargers, and different LiPos without finding the issue... :frowning:

Any suggestions or ideas?
I just come up with the idea to set the wakeup to any 2 minutes to save some energy,
and thinking about if the ampere draw of the Wemos increases dramatically if the voltage goes under 4V? If it draws somehow double ampere if its just 3,8V that would be an explanation...
Those two things we will test next.

Probably the charger we added for the LiPo generates some issues as well but as we measured it does not draw power out of the system, but we do not watched power consumption over the entire day by the lack of some kind of the ability of a better measuring device. We will now run longtime tests without charger as well.

I hope somebody has an idea.

Best wishes
Markus

Either your measurements are misleading, or the battery capacity is not what you think it is.

It is easy to measure the latter, and while you are at it, carefully redo the active current measurements using fast sampling, paying special attention to the peak current.

"in that time it uses around 40-50mA" is not particularly useful or helpful. For example, while WiFi is in use, expect current draw over 300 mA.

WiFi or BT is not active and used. Only a I2C oled is connected and set to power sleep as well during the sleep times,and its power current is also measured together with the entire Wemos, results in that 0,5mA during sleep.
The Battery capacity is also tested with the 50hours 20mA LED draw test device...

How to "fast sampling" measure the power draw? Maybe a advice for some kind of hardware we should use to watch and measure it? Some USB multimeter, etc.?

Best wishes and thank you,
Markus

How is the battery connected to the Wemos ?

For informed help, please post the code, using code tags, and a complete circuit diagram (not Fritzing), with parts and pins clearly labeled. Explain how you made the previous current measurements.

As it now stands, you don't seem to have enough information to determine why the battery life is so much shorter than you expect. So either the measurements or the expectation needs to be revised.

2 Likes

We used a AZDelivery TP4056 Micro USB 5V as charger.
About the circuit, its quite simple:

Micro usb charger gets power via micro USB to charge the battery, after that we disconect the usb and see how long it run on battery. IN connections of charger are not connected because we use the micro USB on it. OUT + and ground are connected with LiPo Battery and the WEMOS + and GND.

At the Wemos we have also connected a AZDelivery 5 x 1,3 Zoll OLED Display via I2C.
And we used digital GPIO of the Wemos for up, left, right, top and A and B botton for our software.

The code itself is quite massive but only because of what we doing with our programm, but the sleep function works, and our tests states it only draws around 0,5mA if in DeepSleep for the estimated time of 1/2 minutes(now 2 minutes, first test with 1 minute).
WiFi or BT are not used. I show you here the code without the unrelevant and menue we programmed for the device :wink: Oh and by the way, I forgot we also use a gpio for wakeup on botton. So you not need to wait 2 minutes if you want to wakeup the device and use it.
But the wakeup all 2 minutes is also required but we measure something with the device in that period of time even if the user dont press a key.

#include <U8g2lib.h>
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0); //https://github.com/olikraus/u8g2/wiki
#include <SPI.h>
#include <Wire.h>
#include <iostream>
#define uS_TO_S_FACTOR 1000000  /* Conversion factor for micro seconds to seconds */
#include <FS.h> // Für FLASH Speicherfunktion
#include "SPIFFS.h" // Für FLASH Speicherfunktion

RTC_DATA_ATTR int bootphase = 0; 
RTC_DATA_ATTR int flashMemoryState=0; 
int i1, i2, i3, i4, i5, i6, i7, i8, i9;
int L1, L2, L3, L4, L5, L6; // Loop variables
int up = 0, down = 0, left = 0, right = 0, buta = 0, butb = 0;
int uphold = 0, downhold = 0, righthold = 0, lefthold = 0;
int sleepTimeMilliSeconds;
int phase = 0;

void setup(void)
{
  u8g2.begin();
  Serial.begin(9600);// Für SerialComAusgabe
  randomSeed(1567);
  btStop(); // Bluetooth Stop

    pinMode(40, INPUT_PULLUP); // up
    pinMode(38, INPUT_PULLUP); // right
    pinMode(37, INPUT_PULLUP); // down
    pinMode(39, INPUT_PULLUP); // left
    pinMode(12, INPUT_PULLUP); // A
    pinMode(11, INPUT_PULLUP); // B
    // Some wires which interruption will be tested:
    pinMode(2, OUTPUT);
    pinMode(3, INPUT_PULLUP); // wire 1
    pinMode(4, OUTPUT);
    pinMode(5, INPUT_PULLUP); // wire 2
    pinMode(6, OUTPUT);
    pinMode(7, INPUT_PULLUP); // wire 3
  
  u8g2.setFont(u8g2_font_mozart_nbp_tf );
  phase =50; 

   bool success = SPIFFS.begin(); // For flash data access
  if (flashMemoryState==0) // at first start format memory
  {
    flashMemoryState=1;
    SPIFFS.format(); // For flash data access
  }
}


void loop(void)
{
  
  u8g2.clearBuffer();          // clear the internal memory
  
  ////////////////////// READ INPUTS 
    i1=40; // Pin nummer UP
    if (digitalRead(i1) == 1) up = 0;
    if (digitalRead(i1) == 0) // if pressed
    {
      //Serial.println("UP"); 
      if (up == 1) up = 2;
      if (up == 0) up = 1;
    }
    
    i1=38; // Pin nummer RIGHT
    if (digitalRead(i1) == 1) right = 0;
    if (digitalRead(i1) == 0) // if pressed
     {
      //Serial.println("RIGHT"); 
      if (right == 1) right = 2;
      if (right == 0) right = 1;
     }
     
    i1=39; // Pin nummer LEFT
    if (digitalRead(i1) == 1) left = 0;
    if (digitalRead(i1) == 0) // if pressed
    {
      //Serial.println("LEFT"); 
      if (left == 1) left = 2;
      if (left == 0) left = 1;
    }
    
    i1=37; // Pin nummer DOWN
    if (digitalRead(i1) == 1) down = 0;
    if (digitalRead(i1) == 0) // if pressed
    {
      //Serial.println("DOWN"); 
      if (down == 1) down = 2;
      if (down == 0) down = 1;
    }
    
    i1=12; // Pin nummer BUT A
    if (digitalRead(i1) == 1) buta = 0;
    if (digitalRead(i1) == 0) // if pressed
    {
      //Serial.println("A"); 
      if (buta == 1) buta = 2;
      if (buta == 0) buta = 1;
    }
    
    i1=11; // Pin nummer BUT B
    if (digitalRead(i1) == 1) butb = 0;
    if (digitalRead(i1) == 0) // if pressed
    {
      //Serial.println("B"); 
      if (butb == 1) butb = 2;
      if (butb == 0) butb = 1;
    }
  


  if ( phase == 50 ) // Deep Sleep Mode - Waiting for wakeup
  {
    // Do something / testing and save results
    /*
    ...
    */

    if ( butb >= 1 ) // Enter menue by user
    {
      phase = 100;
    }
    else
    {
      // Deep-Sleep for a while ( after that time the Wemos will reboot
      u8g2.setPowerSave(1); // Display save power
      esp_sleep_enable_ext0_wakeup(GPIO_NUM_11, 0);
      esp_sleep_enable_timer_wakeup(120 * uS_TO_S_FACTOR);  // wakeup any 2 minutes 
      esp_deep_sleep_start();
    }

  }


  if  (phase == 1000 )
  {
    // USER INTERFACE... using the buttons and the oled as display, until go to STANDYB again
    /*
    ...
    */
    
  }


  u8g2.sendBuffer();  // transfer internal memory to the display

  
} // End main loop



You really really really need to understand where the power is going, so remove the 'maybes' and be sure.

For instance if the sleep current really is 0.5mA for 59 seconds and the device is 'maybe' powered @ 40 - 50mA (?) for one second, thats a bit more than an average of 1mA.

So a 1000mAhr battery should last say at least 750 hours.

Sounds like it lasts about 1/10th of that.

You need to work out why, forget about the code you need to be sure of the basics first.

1 Like

What is the voltage of OUT+ and what is WEMOS+ ?

Think about it, if you won't spend 5 minutes drawing and posting a schematic, why should all of us each spend 5-10 minutes drawing a schematic from your inexact wording, only to take this conversation in 5 different directions based on misunderstandings?

I´m sure its not about the code. I posted it because people asked for. And the shematics was so simple I thought words do the same. You can forget about the input and output buttons they dont draw power and are not used meanwhile deep sleep.

Shematic is notig more then:
Imagine LIPO Battery 1000mA 3.3V connected to the output + and GND of
AZDelivery TP4056 Micro USB 5V as charger.
and same wires connected with 3.3V pin and GND of WEMOS S2 Mini,
Further a AZDelivery 5 x 1,3 Zoll OLED connected to the I2C pins of the WEMOS.

And I just do not uploaded a shematic because I don´t know how or with what software to draw, or should I just sketch that on paper and scan?

That´s simple and nothing more is connected.

And what do you mean I need to be sure if t draws 0,5mA in deep sleep. I measured
that as I said, I disconnected one cable of the battery, placed a standard multimeter
between, and checked for ampere draw. 0,5mA was the result, which is OK and as
estimated for Wemos+Display in Deep sleep.
And every 60 seconds for around a second, the multimeter doesnt react that fast,
probably its 0,5 second or less, maybe its 1,5seconds, thats why I asked for maybe a better tool to mesure that, it turns into deep sleep again. But I do not watched the multimeter for
ours all the time, we checked it multiple times and got the same result.
Which doesn´t light up the issue.

Best wishes and thank you all even if we still have no new ideas,
Markus

Scan of a hand sketch schematic is fine - no software, just pencil, paper and your cell cam! LOL

Some of those "schematic" drawing programs are more trouble than they're worth.

Also, good clear pics of you project & wiring can be a big help.

I post a photo with the wire clean visible, later, need to ask my friend to do the photo.

If it is similar to that, it probably should not be connected directly to the 3.3V pin.

charger

Its close like that, see image above. And we directly wired the lipo + to BAT + on charger and to 3.3V on Wemos, and Bat- with charger Bat- to Wemos GND

And sorry I got the photo of the device from my friend but its so crazy wired you cant see clear what is connected with what pin at the wemos, so my explanation is more accurate.

Guess anyway we need to concentrate on the charger and/or how to connect it right.
You said we should not connect it direclty with the 3.3V pin. what else should we do?
and why, for understanding reasons.

Thank you!
Markus

Here is my hand sketch. The connections at the wemos are not at the real positions at
the board, don´t wonder. But I named the pins.

Look here page 35
https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf

What is the battery voltage ? (fully charged)

1 Like

Your right, that's bad after that info.
Fully charged the 3,7 battery goes up to around 4,2V.
That´s more then the ESP32 can take.

Don´t thought about that this is a problem. the wemos run on 5V usb power
as well... And we connected it always like that and the wemos run without issues,
OLED as well.

Then we need to connect it somehow differently, right? where?
I don´t see a 5V pin at the gpio overview of the Wemos S2 mini.

Or do we need to connect it with the VBUS?

sorry for asking stupid questions but we are just beginners.

https://randomnerdtutorials.com/power-esp32-esp8266-solar-panels-battery-level-monitoring/

You could try VBUS (when not connected to the computer)
(or should it be VUSB ?)

To be clear I do not connect the ESP32 directly, it´s the onbuild processor of the Wemos S2 mini I connect with power.

and yes, its "VBUS" , to be clear:
vubs

Yes, VBUS is where you should connect your battery.
This is taken from the wemos S2 schematic:

It is possible that by connecting the battery directly to the 3.3V pin you may already have damaged the board. But it sounds like you have already tested this for several battery cycles, and it doesn't seem to have failed yet. That doesn't mean it's ok to carry on doing it!

It's also possible that applying a voltage exceeding the safe limit like that will result in significantly higher current consumption. So re-test connecting the battery to the VBUS pin.

I have another warning for you. The battery charger module you are using protects the battery from over-charging. But it does not protect from over-discharging, which can be equally damaging for li-ion batteries.

If you are using a li-po pack, these often have over-discharge protection circuit built in. Does your battery have this?