How to battery power a 5V microcontroller with a 3.7V lithium battery (WT32-SC01 PLUS)

I am still quite new to microcontrollers but with my current knowledge I assembled the following battery powered circuit:

Basically a 3.7V battery with a 5V boost controller powering a WT32-SC01 PLUS board (https://www.antratek.com/media/wysiwyg/pdf/WT32-SC01-Plus-V1.3-EN.pdf). Hope that circuit is correct?

Now I want to put all in a 3D printed case that has ONE (!) USB-C port I can use for charging the battery / powering the device / flashing the board.

I have three potential circuits.

A)

... I assume will not really work because in this circuit the power will not charge the battery right?

B)

... should cause issues because I have basically two power inputs now by simply splitting the USB input? One routed to the onboard USB-C and one coming from the battery?

C)

... best solution because data and power is separated?

Would be very thankful about feedback.

*one thing I want to change is to move the "PWR Switch" to the positive line connecting to the WT32-SC01 PLUS board. So that this way I can charge the battery with the device itself being turned off

According to the data sheet the correct power input is on pins 1,2 of the Extended I/O connector.

... best solution because data and power is separated?

Are they?

Sending 5V to the battery is not a good nor safe idea.
I would suggest using

as your input from your USB charging to the battery as it will protect and safely charge the battery.

Place it before your power switch, that way you can charge the battery both when the power is switched on or off

... both can be used for power input "Extended IO Interface" as well as "RS485". For me the direction the RS485 is facing towards is beneficial for my case placement.

I just like doing things the way the board manufacturer suggests.

1 Like

Where do you read that? To me both are stated in the technical specs as "power supply".

There is no mentioning of a "preferred choice". How do you come to that conclusion?

I started first with the TP4056 ... but to my understanding it does not convert the 3.7V of the battery to 5V of the board input?

So in that case I would need the TP4056 as another additional component?

I saw this project which was only using the 5V boost component:

It says the 5V boost also has a voltage regulator for charging?

You are correct

1 Like

Try this way, because the +5V output charge module exist always, if charging or not .
(I use this module in my several projects).

image

1 Like

My bad the boost converter has a charging chip on it already. Does have over-discharge and short circuit protection ?

Just tracked this boost/charge board down and found the following, so no short circuit or over discharge protection.

For my most recent project, this could not be used as the completed only draw 20mA (by a lot of hard design)

USB Lithium Battery Charging Protection Board Type-C 5V 2A Boost Converter

Basic parameters

Input voltage range: 5-5.5V

Charging cut-off voltage: (4.2V/4.35V) ±0.5%:

Charging current: 2.4A±5%

Boost output voltage: 5V 5.15V (wire loss compensation)

Boost output voltage ripple: 100mV

Boost output current: 2A

Boost conversion efficiency: 92.5% (3.6V input, 5V2A Output)

Battery end quiescent current: 30uA

"Features

The output will be turned off when the load current is continuously less than 50mA.

Supports external buttons, connect the button to point K and the negative output, short press to turn on the power display and turn on the 5V output, and two short presses will turn off the power display and turn off the 5V output.

When the charging current drops to 100mA after reaching the final float voltage, the charging cycle will be automatically terminated.

When the battery voltage drops below 4.1V, the charging cycle restarts.

If the battery voltage is lower than 2.8V, the battery will be precharged with a current of 180mA.

The USB-A female socket welding position is provided on the back of the product, and the female socket can be manually installed.

Supports charging and discharging"

Another option: reduce clock speed to 8 MHz and run directly from the battery...

But this way does not allow me to flash the chip via the USB connection.

Trying to understand why you connect the power switch to "K" pin?

When using your project, will it be necessary to load the code several times?
Or only during development and some correction?

This pin K turn ON and OFF module +5V output.

" It supports the external key, which is connected to the K point and the output negative pole.
Short press to turn on the power display and turn on the 5V output. Two consecutive
short presses will turn off the power display and turn off the 5V output. "

I would like to be able ideally to package everything in one case with just one external USB port.

If I connect a power source (USB) it should charge the battery and if I connect a computer (USB) it should be able to be (re)programmed and charge.

If your battery looks like the one in the picture, it probably has protection circuits built in. If so, that charger/boost module would be all you need.

Edit: But to connect the USB data lines, you would need to plug USB into the processor's USB port if it has one. The charger module only uses the USB power lines.

This pin K turn ON and OFF module +5V output.

" It supports the external key, which is connected to the K point and the output negative pole.
Short press to turn on the power display and turn on the 5V output. Two consecutive
short presses will turn off the power display and turn off the 5V output. "

Ah ok ... but it would basically be the same to have a physical switch between 5V booster and microcontroller like I planned?

Since I am not quite sure what happens when I connect both USB-C ports (one from the charger module and one from the microcontroller board) to one USB-C output port I have my final circuit like this:

Basically use magnetic charging for the battery. The USB-C port that I put on the case will lead to the USB-C from the microcontroller to flash the board. When I do that I disconnect the battery/module with the ON/OFF switch.

ATTENTION, the slots marked +5V are only module output, not input.
The module has one output in the slots and another in the USB type A connector.
But the module input is only through the microUSB connector.
The battery is only charged if the module is powered by the microUSB connector (pin 1 of IP5306).
See the module schematic below.

Yes that is how I interpreted the OUT's as well. Thanks for clarification.

Out of curiosity ... what would happen if the 5V out is connected to another 5V out? Is there a shutdown mechanism? Would this be safe?