matxt
Newbie level 4
Hello folks, for some time I am in developing a device for my car, and must carry a lithium battery. Basically it feeds with 12v of car battery only when the ignition key is closed, and also charge the lithium battery of the device. When the ignition key is opened, the device is powered only by lithium battery.
To implement the switching power supply, I use an op amp as comparator (LM358) and a MOSFET (fdn340). Basically, the schematic is the same as making in any Arduino to switch the USB power to external power.
The problem is that I had some problems with this schematic, and have decided to make this simpler, discarding the operational amplifier, and connecting the 12v car battery to the gate of the MOSFET with voltage divider, with a pulldown resistor. This way i can solve my problem, and work perfectly!
The questions,
Why Arduino not use only a MOSFET to switch the inputs power supply?
What is really the role of the operational amplifier if it can be omitted?
What problems (if exists) I may have with my schematic?
Any response will be greatly appreciated! Thankyou!
I attached the Arduino schematic, and mine.
Arduino Switching Power Supply

Mosfet switching

To implement the switching power supply, I use an op amp as comparator (LM358) and a MOSFET (fdn340). Basically, the schematic is the same as making in any Arduino to switch the USB power to external power.
The problem is that I had some problems with this schematic, and have decided to make this simpler, discarding the operational amplifier, and connecting the 12v car battery to the gate of the MOSFET with voltage divider, with a pulldown resistor. This way i can solve my problem, and work perfectly!
The questions,
Why Arduino not use only a MOSFET to switch the inputs power supply?
What is really the role of the operational amplifier if it can be omitted?
What problems (if exists) I may have with my schematic?
Any response will be greatly appreciated! Thankyou!
I attached the Arduino schematic, and mine.
Arduino Switching Power Supply

Mosfet switching
