I am trying to create a PCB that can operate on 5, 12, or 24 VDC. The PCB will need a 5 V rail for the digital signal to the LED lights and a 3.3 V rail for the MCU.
I would like to make a cost-effective way to accept VIN as 5 V and automatically bypass the DC-DC step-down converter with a P-channel MOSFET. I have no problem with the DC-DC converter that will not be enabled until the threshold is met, so if 12 or 24 V is applied, the converter will step it down to the 5 V rail.
From my research so far I have decided to use an LM358 as it can operate on 24 V DC. It will be low if the voltage is less than 6 V DC and thereby bypass the DC-DC converter and the 5 V rail will be powered by the external power supply.
My main question is: will there be an issue with the MOSFET’s Vgs as the limit is 20 V, will Zener D2 actually do anything to reduce the gate voltage when the gate is pulled low by the LM358? Or do I need another Zener in the circuit somewhere? And is D3 even necessary?