I have 3 of 18650 lithium battery cells and one heat element and one TP4056 charging module. I want to connect the cells in parallel to the charging module to charge them and at the same time I want to connect them in series to power the heat element with 11.1 V. how can I do that? and what are the alternatives if that's not possible?
You can't connect them at the same time for charging in parallel and discharging in series.
You can connect them with relays, to either charge in parallel, or discharge in series.
But it's generally just not worth it. The cost and power consumption of relays would be better spent on simply being able to balance charge a series set of cells.
It's possible, but not usual.
If there was some extremely persuasive reason to do so it could be achieved with 6 SPST switches. These could be relays or FETs .
Or 3 x SPDT switches / relays.
Or a single 3PDT switch or relay.
Break before make is essential if switches or relays are used.
One "persuasive reason" may be the ability to use a 5V supply for charging with no boost converter :-).
Early AM hours here, work & sleep calls so no diagrams for now BUT you should be able to work it out from the above.
Here is a word picture for an FET based arrangement.
Cells A B C in series line A at top, NOT connected.
A+ to V+
C- to ground. Series connect FETs A- to B+, B- to C+
Parallel connect FETs A- to ground, B- to ground, B+ to V+, A+ to V+.
Series to parallel switch: Series FETS off, THEN Parallel FETs on.
Parallel to series switch: Parallel FETS off, THEN Series FETs on.
Do it wrong = magic smoke.
3 cells can be connected to V+/ground in series or parallel
Initial state : Series connection
All switches SSx closed. All switches SPx open.
Change from serial to parallel:
Open all SSx switches then Close all SPx switches
Change from parallel to serial Open all SPx switches then Close all SSx switches
Changing switches in the wrong sequence will lead to magic smoke being released.
All SS switches may be ganged together. All SP switches may be ganged together.
IF "break before make" can be guaranteed a single 4PDT switch could be used.