Cannot measure current consumption with LiFePo4 battery

I made various circuits with ESP32 S3 Wroom modules. Some are powered by USB, some by LiPo and some by LiFePo4 batterys. All running without a problem so far.
Since I want to make them energy efficient, it is quite impotant to measure the current consumption while they are running and while they are in deep sleep.
This measurment is easily possible when powered by USB and LiPo, but there is a weird problem with LiFePo4 batterys: The controller starts, it executes a LITTLE BIT of code (for example the blinking of an LED at the beginning of a code) but then instantly crashes and reboots. It never makes very far in the code.

  • The LiFePo4 is charged up to 3.5V it is directly connected to the ESP, which functions perfectly fine when there is no multimeter inbetween
  • The ESP32 S3 module needs a voltage of 3.0 to 3.6V
  • The multimeter was a cheap noname brand, then I upgraded to a PeakTech 3350, since it didnt work I upgraded to a UNI-T UT61E, since it also didnt work I upgraded to Brymen BM867s

What is going on, why can't I measure the current consumption of this battery type?

Please describe exactly how you are going about measuring the current consumption

A schematic would help

1 Like

Directly connected where ?

A schematic is essential, you presumably know where stuff is connected, the forum does not.

Just a minute ago I was measuring the running current consumption of ESP32S3 vs ESP32C3 vs ESP32C2

Measuring current with a multimeter is done like this:
The battery minus is connected to GND of the MCU.
The probes of the multimeter are connected to COM and mA. One proble is connected to the plus of the battery, the other one to the plus of the MCU.

There are two pins that need voltage so the ESP is powered up: The "3v3" and the "EN".
The 3v3 is the plus of the LiFePo4 battery.

Did you measure it when connected to a LiFePo4 battery?

No, but if I was and had your problem, I would measure what was the actual voltage on the '3V3' pin of the ESP32S3, your problem sounds like a brownout.

Hard to comment further since you have just shown a tiny fragment of the schematic.

Good idea, I just did that and these are the results:
The battery has a voltage of 3.501V
The voltage reaching the input of the ESP32 (passing the mosfet and so on) is 3.463V
The voltage reaching the input of the ESP when the multimeter is in between (measured with a second multimeter) fluctuates between 3.420 and 3.442V. I dont know about the current that is able to reach the input of the ESP but the voltage should be enough. The volatge does not pass any series resistors except the ones possibly in the multimeter.

Also I want to provide the full schematic, I had to delete a lot of notes and clean it up first, but here it is:

I just googled it, you suspect a sudden voltage drop.
I just checked with a oscilloscope at the output of the multimeter that goes into the PCB in current mode (the setup when the issue happens) and you are right. The voltage suddenly drops to less than 2V which is way too low for the ESP.


I just took the same measurment with the LiPo battery and that voltage drop occurs too, but only down to 3.0V so it does not restart.
From the timing I would guess it is around the time the wifi is turned on, causing a voltage spike and the multimeter does not seem to be able to handle it.
Without the multimeter in the circuit, there is no voltage drop measurable with the oscilloscope at all.

How can all the multimeters I bought, even the one for 160 euros, cause such a big voltage drop when the wifi is turned on? And is there something I can do to fix it?

The turning on of the WiFi is very well know to cause problems. There is a (another very) large current spike when the WiFi turns on and this does cause brownouts in a lot of setups.

Well, multimeters measure current by measuring the voltage drop across a series resistor that's inserted into the line. And it may switch in different resistor values for different current ranges. Are your meters autoranging? If so, maybe they are just slow to adjust to a sudden increase in current. In any case, if you don't see any voltage drop when the meters are not in use, even with the LeFePo4 battery, then the explanation almost has to be something like this.

But is there anything you can do to prevent a brownout?

Yes, they are, but they also have a manual fuction and the issue happens in both modes.

yes, it can only happen inside the multimeter in mA mode. In A mode, it also does not happen.
If it is caused by the switching of resistors during the voltage spike, is there any way to stop the multimeter from switching resistors? If I remember correctly, the ESP runs at around 35mA normally and spikes up to 200mA during the wifi phase.

Also, if nothing works, is it possible to solder a switch between the plus of the battery and the plus input of the PCB, which is turned on during the spike phase and turned off once the current is more stable? so the current could pass the switch and does not fully go through the multimeter, and as soon as the switch is closed, it flows through the multimeter again

Use a fixed value resistor between battery(+) and ESP.
Then measure the voltage across that resistor with your DMM.
Try 1 ohm, which gives one volt per Amp on your DMM.
When this is still problematic, then lower the value to 0.1 ohm.

Don't use thin/long wires between battery and ESP.
You only have 3.3volt from the battery most of the time, and you can't afford to loose any.

A 470uF or 1000uF cap on the ESP's 3.3volt supply is a good way to smooth those WiFi current spikes.
Leo..

2 Likes

+1 to Leo's suggestions. Rather than wonder about which resistor the meter has inserted into the line, install you own very low value resistor, and measure the voltage across it with your meter. That has the additional advantage that the meter leads won't be carrying any material current, so the meter's presence won't affect the circuit.

1 Like

I have tried it but ran into problems again.
With 3 Ohms, the controller did not start.
With a 50 milliohms shunt resistor, the MCU runs, but the voltage difference between the awake state and the deep sleep is so small that I can't get a usable value out of it.

So I will have to order some new resistors for the testing. You mentioned a 1000uF capacitor, 1 Ohm and 0.1 Ohm. Would you suggest any other values that I should order, since the resistors will be pretty cheap compared to the shipping cost?

If you're mainly interested in low currents, then use a 10 ohm or 100 ohm shunt with a Schottky diode across.
The uCurrent amplifier from EEVblog could be a good investment.
Leo..

I thought that the reason the ESP did not start was, that the 3 Ohms I testet was too high so there was not enough current reaching the ESP. Would 10 or 100 ohms not make the problem worse? With 100 Ohms, only 30mA would reach the ESP.
And the diode would reduce the 3.3V by 0.7V?
Or do you think it would be enough as soon as the cap is implemented?

If three ohms prevents startup, then there is barely enough power in the first place. Maybe a bad connection.

Anyway, set up the 3R resistor in the circuit, with your meter measuring the voltage across it, but put a jumper across the resistor so it has no effect during bootup. Then when the ESP has gone into deep sleep, remove the jumper.

Assuming sleep current is a few microamps, you may be able to use a larger resistor, like 10R, which is more convenient math-wise.

If sleep current is the one you want to measure…

Place a toggle switch in the power line, and you ammeter probes on either side of that toggle switch.

With the switch closed, attash the battery. Set the ammeter for microamps. It reads zero because of the short circuit which is the toggle switch.

When the system is sleeping soundly, open the toggle switch and read the sleeping current.

HTH

a7

That's why I said "Schottky diode".

A jumper, as mentioned, is another solution.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.