What I was hoping to achieve was: when VLINE goes below ~4V then the red LED would turn on.
What I got was: the LED would only turn on when VLINE was below ~8V
In the end I was hoping to use this on the output of a LM317 to display when the output has been shorted.
With all that said would any grey beards be able to offer some input as to what rookie mistakes I made?
Cheers
The zener drops the input voltage by 3 volts. So the voltage at the mosfet gate will be Vline - 3 Volts.
P -type mosfets will be turned off as the gate voltage increases up to Source voltage.
Your source voltage is 6.6 Volts, so when Vline = 9.6 Volts, the voltage at the gate will be 6.6 Volts. Therefore at Vline= 9.6 volts the mosfet is fully turned off.
Don't increase the Vline voltage too much above 9.6 volts, because then the gate gets reverse biased and this might damage the mosfet. See in the datasheet how much reverse voltage the gate of that particular mosfet can tolerate.