Problem with battery charger

I have this charger: Adafruit LiIon/LiPoly Backpack Add-On for Pro Trinket/ItsyBitsy : ID 2124 : $4.95 : Adafruit Industries, Unique & fun DIY electronics and kits
It works fine if I wait for the battery to get fully charged. But if the battery is low and charging, the voltage on Teensy 3.3V output drops to about 2.5V and poor thing goes into a coma.

What charger do you use which keeps 3.3V on Teensy even while charging a totally drained battery?
And I don't want to use any additional switches other than the new on/off button on Teensy 4.0
Ideally, I want to have an analog output pin on the charger which shows the battery level, so that I can show it on Teensy while the battery charges or not.
So, my Teensy should work just like my phone: it shows that the battery is low, I connect it to the USB and it keeps working with no interruption, showing that the battery is charging now.

I don't need a complete board. I'm need a chip and schematics for it, so that I can integrate it onto the new board I'm making.


Based on the schematic of your charger, there is nothing in the circuit which directs the USB 5V supply around the charger to the Teensy. So current for both functions goes through the charger, and it can't supply enough for that. You need a charger with a "load sharing" circuit. That usually consists of a P-channel mosfet, a Schottky diode and a resistor. It lets USB supply power to the Teensy and the charger independently, so battery charging can continue properly to termination while the Teensy is running. The MCP73871 chip is similar to the MCP73831 used in the Adafruit charger, but it has the load sharing circuit built in. It all works automatically just like your phone - no switches. I believe there are charger modules available which use the MCP73871, but any charger with load sharing should work.

Here's an app note that illustrates a load sharing circuit:

By the way, I assume the Teensy has a voltage regulator built in. If not, you would need to add one to bring the voltage up to 5V, or down to 3.3V, depending on which model Teensy you have.

Thank you so much, Sherman. This is the key phrase I was looking for: "load sharing"

Now I need to find a schematic for MCP73871 usage. Found this:
I need to integrate the charger onto my board, along with Teensy and everything else on it.

Ideally, I'd need some kind of battery level indicator as well, so that I can show it to the user, while charging or while using the battery.

I use Teensy 4.0, which is 3.3V.

Thanks again.

Might be easier to get one of these:

I haven't tried these modules, but it seems they should work ok.

This YouTube may be of interest. :grinning:

I think Andreas is dead wrong about some of this. The TP4056 has no trickle charge mode. It continues to charge in constant voltage mode until the charging current drops below 10% of the full charging current. Then it shuts down. If the load is also drawing power form the charger, and the current exceeds that 10% figure, then charging will never shut down. And if you keep that up long enough, the battery will overcharge and may explode. If you are sure the load is less than the 10% current, then the charger would eventually shut down, and power would then be drawn from the battery. But to be completely safe, there should be a load sharing circuit so there is never any "charging and discharging at the same time".

I'm going to try this:
Looks like a lot of stuff for a simple battery charger, but I guess this is what it takes to prevent it from blowing up into my future customers faces (hopefully).
I'm going to limit it to 100ma and enable a 3 hour timer.

You can always use more generic parts, and add your own load sharing circuit. Attached is one of those circuits.

Thanks, Sherman.
I'll keep this as a backup. Just finished the PCB yesterday, not touching it again for the first iteration.
I will make it and see how everything works.
I have about 100 components stuffed on a 8x10cm board, plus Teensy 4.0 and a screen on the other side.