Hi, I'm new here and this is my first post.
I would be grateful if you can help me with this circuit.
I attached a circuit I designed for hitting a small electrovalve at 24V and then hold voltage at 5V. The manufacturer give these voltages to work and I have a switching source from which get both. The idea is to use a small microcontroller or a delay circuit to switch between 24V and 5V.
The trouble starts when I tried to get the circuit to switch between these two voltages.
As you can see, I used a IRF540 NMOS to control ground connection. But I cannot find a way to design the positive switching circuit. I tried to use a P-MOS or the same IRF540 without any results.
More details:
The load is a 30 Ohms solenoid, and the control circuit has to be 5 volts from the microcontroller.
Diodes and protections will be added

I would be grateful if you can help me with this circuit.
I attached a circuit I designed for hitting a small electrovalve at 24V and then hold voltage at 5V. The manufacturer give these voltages to work and I have a switching source from which get both. The idea is to use a small microcontroller or a delay circuit to switch between 24V and 5V.
The trouble starts when I tried to get the circuit to switch between these two voltages.
As you can see, I used a IRF540 NMOS to control ground connection. But I cannot find a way to design the positive switching circuit. I tried to use a P-MOS or the same IRF540 without any results.
More details:
The load is a 30 Ohms solenoid, and the control circuit has to be 5 volts from the microcontroller.
Diodes and protections will be added

Last edited: