I am using this circuit to control the speed of a small motor (12VDC, 0.3A). The arduino PWM output saturates a 2N2222 NPN transistor which saturates the mosfet gate.
My issue: when PWM is high (5V), the output is low at the mosfet (0V = motor stopped). So when my controller starts up, the motor is running until the code applies the max value to the PWM output to shutdown the motor.
What I want to achieve: PWM high (5V) results in output high. instead of "PWM high (5V) results in output low".
I could solve it using an opamp to invert the signal but there must be a simpler way?