I need to switch a load with a 3.3 volts logic level (pic microcontroller) is this design is correct?
There are two things wrong with your circuit: -
- The P channel FET is upside down (will always conduct thru its body diode)
- If you correctly placed the FET it's a little tricky to directly drive it from a 3v3 logic power supply without damage. You need level translation.
The easiest method is to use an N channel device with the load tied to the 24V rail. Here's an idea that controls a motor: -
If you need the load to be grounded you need an extra transistor: -
Note that there is some attention to protecting the gate from over-voltage - the two resistors and the zener diode limit the gate voltage to below the maximum allowed by the P channel FET.
If your MOSFET was a logic level device that adequately operated at 3V3 gate drive you could use a zener diode directly from the 3V3 logic but it can be a little tricky to set up correctly.