Variable DC Voltage Control With Arduino

Hi all,

I have a pair of fans that are being run off of a benchtop DC power supply that need to be run at many different speeds, and they need to be controlled by a computer. Unfortunately, the DC power supply uses knobs to control the voltage so I cannot directly send it signals to change the voltage. I was thinking of turning the DC power supply all the way up and connecting it to an LM317 voltage regulator that has a digital potentiometer as one of the control resistors. This way, I can send a command from my computer to an Arduino to adjust the digital potentiometer, adjusting the output voltage of the LM317, thus controlling the fan speed. Is this feasible/what are the drawbacks? Are there any easier/better ways to accomplish this?

Thank you an advance for any and all help!

More than likely the control 'knobs' are potentiometers, so rather than using a digital pot to control an LM317 just replace the control pots directly.

Running fans at diffrent speeds is best done by supplying it with a PWM signal. What is the top voltage? See this:-

Hi guys, thanks for the replies.

@wanderson Just to be clear, if the knobs are potentiometers, replace them with the digital pot right?

@Grumpy_Mike I was considering a PWM signal but wasn't sure how to implement that with the higher voltages. The top voltage for the fans are 20V. I also wanted to say thank you for making such a great site, it is extremely useful!

wasn't sure how to implement that with the higher voltages

Just look at the first diagram on this page:-

@Grumpy_Mike Thank you for your help! I have a few quick questions if you have the time:

  1. I read on your website about connecting all the grounds. Is it safe for my laptop to connect the the usb powered arduino ground to the DC power supply ground? I plan on getting an optoisolator but I won't be able to get one for a little while.
  2. Do transistors have a slew rate or bandwidth? Since PWM is a rapidly switching voltage is there too high of a frequency for the transistor to handle?
  3. I'm not very solid in my transistor analysis, how does the transistor behave when being manipulated by the arduino? Is the transistor in the active region, passive region, etc?
  1. Yes it is safe.
  2. Yes they do. You can get high frequency transistors but the PWM frequencies we are talking about here are all very low by transistor standards. The turn off time of a transistor will be slightly longer if you put too much base current in.
  3. It depends on what base current you put through them, although I have not come across the term active region & passive region so I am not too sure what you mean. Most of the time you want to operate it as a switch, that is in the saturated region the other is called the liner region and that is what you use for liner amplifiers.

Thank you for your help Grumpy_mike, I will definitely be trying this as soon as I get the parts