Iam designing 3.3V to 24V Non Inverting Level Shifter by using NPN Transistor and P Channel Mosfet.
Input : STM32 Microcontroller GPIO- 3.3V (High ,Low)
output : 24V , 24 mA (High low)to Drive an SFH617A-3X007T Optocoupler (Which has series resistoir to limit the current to the Opto Coupler Diode on other side)
Note: In order to Keep the MOSFET Gate Source Voltage with in the Threshold i have used Two Methods .
Design 1 : I have used Resistor divider to the collector so when the NPN Transistor is ON The P-CH-MOSFET Gate Source voltage will be clamped to 12V (Within the Threshold) .

Design 2 : I have used a 12V Zener Diode to Clamp the Gate Voltage with in the MOSFET Gate source threshold Voltage.

Questions:
- Which method is better to use it ? what are the pros and cons of both the designs In terms of Level Shifting and Protection?
- is there any issue in the circuits ? If There Please Guide me ?
- Is it okay to use NPN instead of N-CH to drive P-CH ? Do I need to consider Base collector reverse voltage for NPN?
Iam trying to understand the Transistor Switching , Please Guide me through.


