My goal was to use PWM output from Arduino (0-5V) and a low pass filter to smooth out that voltage. I then wanted to feed that voltage into the gate of a P Channel MOSFET which would normally be pulled up to 12V via a transistor.
So the goal was have either 12V at gate (off), or somewhere between 0 and 5V (more on or less on respectively). And my hope was I could control a DC computer fan with this smooth voltage. (Someone told me you can’t use PWM on an older computer fan). If I had a newer fan I suppose all the circuit issues would go away and I could just feed the PWM directly into the fan.
I had a couple issues. THe point which I wanted to be at 0-5V and 12V was not going between 0 and 5V, it was simply either 12V or 0V depending on if I had Arduino PWM active or not.
I thought about it a while and realized the transistor was current controlled not voltage controlled and so I decided to move my low pass filter from the base of the transistor to the gate of the MOSFET.
So the point between the pull up resistor and transistor was a pwm as well but going between 0V and 12V. So I would have expected the low pass filter to smooth out the PWM properly and result in a smooth voltage somewhere between 0V and 12V going into the MOSFET gate which would then allow fan speed control.
The problem was that when I added the low pass filter to gate of MOSFET I was getting weird issues where my PWM would drop form 12V HIGH to like 1V or 0.5V HIGH depending on resistor I used in filter.
Was I like inadvertently creating a voltage divider or something? Below is my schematic. Any help is appreciated.