Light dependent resistor (LDR) switched LED-circuit
HINTS


Choose R1's value so that


When no light shines on LDR1 the voltage across R1 is less than M1's gate-to-source threshold voltage \$V_{TH}\$.
When light shines on LDR1, the voltage across R1 is greater than M1's Miller Plateau voltage, but does not exceed M1's maximum allowed gate-source voltage \$V_{GS(MAX)}\$. The Miller plateau voltage is usually provided via a "Gate-to-Source Voltage vs. Total Gate Charge" graph in the MOSFET's datasheet.



$$
V_{Miller Plateau} \leqslant V_{GS} \leqslant V_{GS(Max)}
$$


The zener diode and resistor R2 are both unnecessary and should be removed. Connect M1's GATE directly to the node between R1 and LDR1.


MEMORY AIDS


When designing a MOSFET switch, always connect the SOURCE pin directly to the power supply (S&#8288;OURCE to S&#8288;UPPLY) as follows:


For an N-channel MOSFET (NMOS) switch, connect the SOURCE pin directly to the power supply's NEGATIVE (-) terminal&mdash;i.e., N&#8288;MOS SOURCE -> N&#8288;EGATIVE terminal (-) on the power source.
For a P-channel MOSFET (PMOS) switch, connect the SOURCE pin directly to the power supply's POSITIVE (+) terminal&mdash;i.e., P&#8288;MOS SOURCE -> P&#8288;OSITIVE terminal (+) on the power source.

For both NMOS and PMOS switches, the load circuit is connected to the DRAIN pin.
For both NMOS and PMOS switches, do not insert components between the SOURCE pin and the power supply.