I am working on a hobby project, it will be a general purpose open source irrigation controller.
I haven't built the PCB yet but I want to power the board either through the USB port for small valves and through 12V to 24V for larger ones. Here is a block diagram of what I have in mind.
To select between these voltages I thought of using a circuit I usually use to select between VBUS and a single cell Lion/Lipo battery. The spice simulation gives an acceptable result as seen below. The green line is the voltage at Source of the PMOS and the blue line at the Drain.
However I am unsure if this is the "good" way of doing it, since VCC will also power the valves . Which are inductive loads. I will be using the circuit below to drive the Valves albeit with different components. I don't have any previous experience designing motor drivers.
I would very much appreciate it if you could point out any errors I may have in my line of thinking.