I've been working on crating a simple PWM fan driver for my Raspberry Pi. To simply explain idea - I get 3 pin input (1 - PWM, 2 - 5V, 3 - GND), then using RC filter I turn PWM signal into voltage and feed it into positive side of OpAmp. Then output drives MOSFET which in turn works essentially as variable resistor controling fan speed (M1 motor on schematic).
My (newbie) questions are:
- PWM signal is 3.3V, is there a way to make OpAmp output do full 0-5V without adding additional OpAmp to scale it up?
- How should I protect circuit from effects that fan might have? It's an inductive load after all.
- And probably most important - am I missing something obvious to people who know what they are doing?
On the side note, speciafic OpAmp and MOSFET I will choose later, but I was thinking about rail to rail opamp that works in 0-5V range and for MOSFET I will use some TTL level one.
Also, C1 is planned to be 1uF