23 ianuarie 2024

MESHTASTIC TTGO T-Beam V.1.1 Power On issues

 A few weeks ago, I start to play with Meshtastic using two TTGO - TBeam V.1.1 LoRa boards based on ESP32 MCU.

Because plans are to use them as ROUTER_CLIENT, I choose to recharge the battery using a separate TP4035 module and a solar panel.

Of course, I could very well use the built-in AXP192 battery management but the circuit was pretty unsuitable for small solar panels and the TP4056 offers a more stable configuration. 

In the tests I observed a strange behaviour that can negate the usage of these boards as a reliable remote installed device: 

if the battery voltage drops under the Low voltage treshold, the board will not boot into operating mode.

The same behaviour was consistently observed even the charging was resume on the USB port on the T-Beam board itself.

The ESP32 datasheet have some clues about why this issue occurs and how to mitigate it.

Once the power is supplied to the chip, its power rails need a short time to stabilize. After that, CHIP_PU – the
pin used for power-up and reset – is pulled high to activate the chip. For information on CHIP_PU as well as power-up and reset timing, see Figure 2-4 and Table 2-2.


• In scenarios where ESP32 is powered up and down repeatedly by switching the power rails, while there is a
large capacitor on the VDD33 rail and CHIP_PU and VDD33 are connected, simply switching off the
CHIP_PU power rail and immediately switching it back on may cause an incomplete power discharge cycle
and failure to reset the chip adequately.
An additional discharge circuit may be required to accelerate the discharge of the large capacitor on rail
VDD33, which will ensure proper power-on-reset when the ESP32 is powered up again.
• When a battery is used as the power supply for the ESP32 series of chips and modules, a supply voltage
supervisor is recommended, so that a boot failure due to low voltage is avoided. Users are recommended
to pull CHIP_PU low if the power supply for ESP32 is below 2.3 V.

I run some tests and found that if the above hints are observed, the recovery of the ESP32 from transient voltage induced coma is 100% so a supervisor chip was ordered.

The STM1001 microprocessor reset circuit is a low-power supervisory device used to monitor power supplies. It performs a single function: asserting a reset signal whenever the VCC supply voltage drops below a preset value and keeping it asserted until VCC has risen above the preset threshold for a minimum period of time (trec).

To be continued...

LATER EDIT:

The STM1001 finally arrived (after three days) and I was eager to test the validity of my rationale.

 
So, I installed it on the board; the Vss was soldered on a little island of Copper exposed by a sharp razor and the Vcc was tied to the Source pin of the P-channel NCE3401 MOSFET.

 

 

This transistor is there to protect the board against reverse polarity from the battery.

The RST of the STM1001 was tied to RST of the T-Beam board.

And here it is, the final installation:



Now, for the tests...

There are two distinct situations, depending on how the battery is charged; internal or external.

 

FIRST VARIANT - battery charged internally, using the AXP192

The battery is directly installed on the board and the AXP192 circuit is used at it's full. 

The battery is a small capacity one (1.28 Wh), to be able to have it quicly charged to observe the parameters.

The battery is charged by AXP192.

Going from a flat battery (around 2.5V), the  voltage of the cell, measured at STM1001 Vcc and Vss.

The blue LED is signalling the charging, the voltage is rising and when it reached 3.19V (on my DVM), the RST is released from Vss to 3.2 V (the Vcc of the ESP32).

The ESP32 start to run, the LoRa RTX is sending the first beacon.

This was consistent during a set of 5 tests.

SECOND VARIANT - battery charged externally through a TP4053 board.

The same battery is connected to a TP4053 board with protection and the output of the board is connected to the T-Beam board in place of it's battery.

The AXP192 is not able to manage the charging process because it cannot detect the external power presence.

Therefore, the AXP192 will not start and will not be able to Power On the T-Beam board, at least in the current firmware used for Meshtastic.

Due to the way it works (it is a very complicate process - if you don't believe me, read the AXP192 datasheet) it is mandatory to simulate PEK press (Power Enable Key) after the voltage reach 3.2V which is beyond my scope.

I did some crude tests and it is doable but the solution will be more complicate than the one I am searching for.





 


06 ianuarie 2024

TC4056 1 cell LiIon charger module

I have a lot of those little boards made around a TP4056 IC.

According to the datasheet:

The TP4056 is a complete constant-current/constant-voltage linear charger for single cell
lithium-ion batteries. Its SOP package and low external component count make the TP4056
ideally suited for portable applications. Furthermore, the TP4056 can work within USB and wall
adapter.
No blocking diode is required due to the internal PMOSFET architecture and have prevent to
negative Charge Current Circuit. Thermal feedback regulates the charge current to limit the die
temperature during high power operation or high ambient temperature. The charge voltage is
fixed at 4.2V, and the charge current can be programmed externally with a single resistor. The
TP4056 automatically terminates the charge cycle when the charge current drops to 1/10th the
programmed value after the final float voltage is reached.
TP4056 Other features include current monitor, under voltage lockout, automatic recharge and
two status pin to indicate charge termination and the presence of an input voltage.

This might be a problem with low capacity cells because to keep the charging in the safe area, the charging current must not exceed 1C (C=designed capacity).

Charging above this might give a temperature rise and this is not good for Li based cells. Of course, there are specific cells that accept charging currents above this safety limit but those are special ones thus not taking risks is a good approach.

Going to the datasheet of the TP4056 give us some interesting informations.


We can conclude that we can use this circuit directly connected to a small Solar panel able to output 6V.

But what about the current? 

Well, the charging current is set by the value of a resistor, Rprog in the test circuit below:

 The value of this resistor determine the charging current as per the table below:

On some modules, the resistor is marked "R3" but anyway, you can easily found it by tracing the circuit from the pin#2 of the IC; in the photo is the one below the little capacitor on the left side of the circuit:

From the factory it came with a 1K resistor which, according to the datasheet, correspond to a 1000mA (1A) charging current.

I changed it with a 2.2 KOhm one and the charging current dropped, as expected, around 500mA.



For final, here is what this module wants to tell us, based on the LED status:







 


Most viewed posts in last 30 days