Electrical – Inverting output of gate driver for MOSFET

mosfet-driverpwmtransistors

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?

enter image description here

Best Answer

when my controller starts up, the motor is running until the code applies the max value to the PWM output to shutdown the motor.

You can use a pull-up resistor with your existing circuit to ensure the load stays off until your code reaches the point of enabling its output pin.

schematic

simulate this circuit – Schematic created using CircuitLab