The idea: Use an Arduino-like µC to control a set of CPU fans by control the voltage the CPU fans receive. My question: How can I do this in an easy way?

Yes, I know, there is PWM but this is not very suitable for this purpose: I did some tests with it but it turns out that the characteristics of PWM fans don't suite my purpose: PWM fans are designed to be controlled between not audible and full speed, not between nearly not rotating and full speed. Even very special fans with a wide range of PWM speed control don't work as well as powering a regular 12V fan with just 5 or 6V.

Which brings me to an alternative idea: It should be possible to send an I2C or SPI signal to some kind of IC that then provides a voltage as required.

Alternatively to that there seem to be PWM controlled voltage regulators available. But that doesn't seem to be a very elegant solution, isn't it?

Or is there an even better way of controlling the voltage output to the fans I'm not aware of?

I'm aiming for a solution that works well and can be build with little effort. Unfortunately I don't know how to do that: I can't find any breakouts I could use right away for that purpose. Probably there are some and I just have not been able to find them? Any help is appreciated!

1 Answer 1


It's actually very simple, and it indeed does involve using PWM.

PWM is just a signal being on for a percentage of a predefined period. That percentage is also, when the PWM signal is averaged out, equivalent to a percentage of the peak voltage of the PWM signal.

So if you take a PWM signal and use it to switch a higher power source (say, through a P-channel MOSFET that's being itself switched by an N-channel MOSFET), then add smoothing to that switched output, and you have a variable voltage.

If you want to know what that voltage is you can add a resistor network to the output (assuming it's higher than the voltage the MCU can handle) and read the divided voltage using an ADC. You can then use that as a feedback loop to adjust the PWM duty cycle to get your desired voltage.


simulate this circuit – Schematic created using CircuitLab

That is precisely* how switch-mode power supplies work. Use PWM to switch a FET that controls an incoming voltage, then smooth it out, adding a feedback network for control.

*Apart from the PWM bit: they often use other methods of switching the signal to get better efficiency at different loads, such as PFM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.