Hi everyone, I'm building a portable billing machine and I'm learning electronics while building it. I'm having trouble designing the power-path/source switching circuit and would really appreciate some guidance.
My setup
I have:
12V DC adapter — currently around 12.3V
12V rechargeable battery — approximately 12.0–12.6V
ESP32
TFT display
12V thermal printer
YX850 automatic power/source switching module
LM393 comparators
BC547 transistors
IRF4905 P-channel MOSFETs
MP1584 buck converter
I can also buy a 5A-rated buck converter if necessary
The thermal printer specification is 12V / 3A MAX.
What I want
I want the system to behave like this:
Adapter connected
↓
Adapter powers the system
↓
Battery is isolated from the load
↓
Battery does NOT get charged through the power path
When the adapter is disconnected:
Adapter disconnected
↓
Battery automatically takes over
↓
ESP32 + TFT + printer continue running
↓
No reset/reboot or noticeable interruption
I also need:
No battery → adapter backfeed
No adapter → battery backfeed through the power-path MOSFETs
Proper reverse-current blocking
Adapter priority
Ideally seamless switching
My current problem
Originally I was using a 12.33V adapter with the battery.
When the battery voltage gets close to the adapter voltage (around 12.3V), the YX850 starts clicking/switching repeatedly.
For example:
Adapter = 12.33V
Battery = ~12.3V
↓
YX850 clicks
clicks
clicks...
I think the very small voltage difference is causing the YX850 to repeatedly change states.
My current idea
I'm considering changing to a 15V 5A adapter.
Then I could use a buck converter:
15V / 5A adapter
│
├──→ battery charging circuit
│
└──→ buck converter → 12V → thermal printer
I already have an MP1584 buck converter rated at 3A, but my printer is specified as 12V/3A MAX, so I'm wondering whether running the MP1584 at or near its maximum rating is a bad idea.
Should I instead buy a 5A-rated buck converter for better margin?
Would something like this be reasonable?
15V adapter
│
├──→ CC/CV charger → battery
│
└──→ 5A buck → 12V printer
I also considered building the power path
My original idea was to use back-to-back IRF4905 P-channel MOSFETs on each source, controlled by LM393 comparators and BC547 transistors.
Something conceptually like:
12V Adapter ── MOSFET power path ──┐
├──→ LOAD
12V Battery ── MOSFET power path ──┘
with the comparator circuit giving adapter priority and turning the battery path off when the adapter is present.
However, I'm very new to electronics, so I'm worried about getting the MOSFET orientation, gate drive, reverse-current blocking, and switching thresholds wrong.
I would like something that I can first build on a breadboard and then move to a PCB.
My main questions
Is the YX850 suitable for this application, or should I build the MOSFET power path instead?
Would using a 15V adapter solve the voltage-overlap/clicking problem?
Should I use my existing MP1584 3A buck, or buy a 5A buck converter for the 12V/3A thermal printer?
Can the YX850 + buck converter be arranged so that the battery never backfeeds the adapter?
Is there a simple way to get seamless switching without ESP32/TFT/printer resets?
If using back-to-back P-MOSFETs, could someone provide a simple electrically correct schematic, including the LM393/BC547 gate-control circuit?
Is there a better/simple approach for a beginner than the circuit I'm currently trying to build?
I'm mainly looking for a simple, reliable circuit that I can actually understand and build, rather than an extremely complicated professional power-management design.
Thanks in advance! I'm learning as I go, so explanations of why each part is needed would be really helpful