Powering Stepper Motor and DFPlayer with ESP32S3 on Battery

There are plenty of ways to provide necessary current to your motor. Just verify that the 5V voltage is really sufficient, not just in your mind, but in practice. If that is verified you could use some module like this:

Here is what Bill at DBWS has to say,

it will induce electrical β€œnoise” onto its power supply lines and this could damage your Arduino. Always use a separate power supply to power your stepper motors!

Many if not all of those chargers are flawed, see
https://youtu.be/T70mBHeIOZA?si=qQ8vdY7q8GqpM1MU

Your video was for V3, not for V8, but generally I agree.. :wink:

I apologize if my English isn't perfect, as it's not my primary language.
To clarify, I would use optocouplers to separate the logic circuit from the power circuit.
The ground would be separated through the step-up converter.
If I were to use two batteries, I would need to charge them through different ports, which seems like a poor design choice.

Same family of product, I doubt they fixed it, would cost too much.

You will be removing the batteries from the circuit to charge them, I don;t see your point.

I made at start a frizzing to look what i am dooing. it is not perfekt and i changed a few parts and the bord but this setup works. But I you say it is a bad circut design I would like to get feadback!:

Now do get back to what I want to solve I changed the word to the ESPS3 XIAO that provides a battery charging modul integrated.
But i would still like to use the USB Pin of the arduino to load the battery and still get the power from the battery to run the motor that worked as tested with mostly this setup.
and why would i remove the battery to charge them? I plug the cable in and it charges the battery.
This was my idea with the relay: Data package from August 4th. - FileTransfer.io
This link was also mentioned in the forum, but it didn't resolve the issue. However, the person in that thread seems to have the same problem as mine:
Combining 2 battery charger circuit - #5 by gabrieleagrillo95

It's not a question of esp, xiao or usb, it's a question of driving that stepper motor. If you don't have your motor physically, in real life verified to work for your use case at 5V voltage, it's a moment to do it. Otherwise get a 12v stepper driver and suitable battery for that to move forward.

I have the motor, and it works. The issue is not in driving the motor but rather in supplying the necessary current while maintaining battery charging with the ESP32S3.

Then have a look at the module I linked. There are also "5V 18650 ups" modules that could work for your case. They are not the highest tech available, but if you need battery charging, battery protection, step up/down at few amps and reasonable price...

Sorry, I will not be clicking any links to domains I have no personal knowledge of. I am opting out of this thread.

That's okay. I can't upload files here due to new user restrictions.

I appreciate your help. I will definitely take away from this post that I need to provide less information and be more concise about the core problem.

Unfortunately, it seems that you haven't fully understood my issue. So I think I'll go with my relay idea, but instead of using a relay, I'll use a MOSFET transistor and a diode to completely separate the charging and discharging interfaces. Hopefully, this will work smoothly.

I try it based on: Add battery charger to ESP8266 and ESP32 (well done) - eMariete

In short, I'll set up {ESP32S3 <--> battery} and connect in parallel to the battery {(battery) and (5VUSB pin of ESP32) -> MOSFET transistor and a diode -> step-up converter -> motor}. This way, the circuits will be separated and the 5V should still be available when the USB is connected.
The battery won't be used in USB case, but provide a output when USB is not connected. This setup might work very well, but I have to make a plan before trying this. To get how to separate the grounds and not using the step up converter on USB mode.
If this doesn't work, I'll revert to the old setup and connect the second charging module to the ESP so that both batteries can be charged via the USB port on the ESP.
But for every one else your input would be appreciated!

I think like this:

External Power Supply 5v (Pin 1) Connected and Enabled
         |
         |-----------------------------------------------------
         v                                                    |
       +---+                                                  |
       | | |  Diode (D2)                                      |
       +---+                                                  |
         |                                                    |
         |                                                    |
         v                                                    v
       +---+					+---+                        +---+
       | D |  MOSFET (Q1) -->	|5v |  Step-up Converter --> |5v | Load (Devices Circuit)			
       +---+					+---+                        +---+

         |
         x
         |
       +---+
       | β€” |  Diode (D1)
       +---+
         ^
         |
         |
       +---+
       |   |  Battery 3.7v
       +---+


  External Power Supply 5v (Pin 1) Disconnected or Disabled
         |
         x-----------------------------------------------------
         | 	                                                  |
       +---+                                                  |
       | β€” |  Diode (D2)                                      |
       +---+                                                  |
         |                                                    |
         |                                                    |
         |                                                    v
       +---+					+---+                        +---+
       | D |  MOSFET (Q1) -->	|5v |  Step-up Converter --> |5v | Load (Devices Circuit)			
       +---+					+---+                        +---+
         ^
         |
         |
       +---+
       | | |  Diode (D1)
       +---+
         ^
         |
         |
       +---+
       |   |  Battery 3.7v
       +---+

I plan to follow the schematic for the ESP32S3 XIAO, specifically the power path circuit that automatically toggles between VBAT and VBUS, using the components Q1 LP0404N3T5G, R9 100K, and D2. You can find the schematic at this link: https://files.seeedstudio.com/wiki/SeeedStudio-XIAO-ESP32S3/res/XIAO_ESP32S3_SCH_v1.1.pdf.

However, I'm looking for a larger version of the LP0404N3T5G MOSFET that can handle more than its current maximum of 1.4A. Does anyone have a recommendation for a MOSFET with higher current capacity?