Converting PWM to 0-12V Analog DC

Hi every one:) I just looking for some circuit or module to convert 0-5V PWM pulses to 0-12V Analog DC! Just searching around two hours on the net and unfortunately all of modules or circuits or tutorials I found are about 0-10V :(

I have this 16CH PWM module:

https://de.aliexpress.com/item/16-Channel-12-bit-PWM-Servo-Driver-I2C-interface-PCA9685-for-Arduino-Raspberry-Pi-DIY-Servo/32753830158.html

It is a 12-bit module with maximum frequency of 1,6 KHz. I know how a Low-Pass filter circuit should be, But I don't know how can I calculate Resistor and capacitor values for my uses :(

Thanks a lot and have a lovely day :)

Do you have a 12V supply handy? If not, will be difficult to get a 12V signal out.

sonixax: I just looking for some circuit or module to convert 0-5V PWM pulses to 0-12V Analog DC!

Is this to power/speed control your 16 PC fans? Leo..

CrossRoads:
Do you have a 12V supply handy? If not, will be difficult to get a 12V signal out.

Currently I use a 12v 2000mA power supply! But I know I need more amps cause of my fans.

Wawa:
Is this to power/speed control your 16 PC fans?
Leo..

Yep,
I can control them with PWM signal and a MOSFET, but cannot read the rpm! So I need analog voltage!

Thank you :slight_smile:

sonixax: I can control them with PWM signal and a MOSFET, but cannot read the rpm! So I need analog voltage!

You can't use an n-channel fet in the ground line, because ground of the fan is shared with the fan's tach circuit. You must PWM the fan high-side (in the + line) with a p-channel fet or PNP transistor. Third circuit here, but better to replace the 1N4004 with a schottky diode (e.g. 1N5819). Leo..

Wawa: You can't use an n-channel fet in the ground line, because ground of the fan is shared with the fan's tach circuit. You must PWM the fan high-side (in the + line) with a p-channel fet or PNP transistor. Third circuit here, but better to replace the 1N4004 with a schottky diode (e.g. 1N5819). Leo..

Thank you :) And is it noisy or damaged my fans in time? Because these fans using to cool down 19 gpu on my rigs! And also on another rendering server.

At this time all fans are running at high speed which is not we are looking for, cause of power consumption and too noisy. Also there is no any 16ch network base dc fan controller out there!

I don’t see how that could damage a fan.

It could be noisy though (whining), because you’re PWM-ing the fans in the audible range.
You might have to drop PWM frequency of the PCA9685 to 30-50Hz if PWM noise is a problem.
But leave it on default (200Hz) first.

I suppose you would have an alarm going off if one of the fans stops spinning.
And, as always, build/test one fan circuit before you build 16+.
Leo…

Thanks a lot :) Can I use other MOSFET instead of fqp47p06 because it is too hard to find in my area! And waiting to deliver from another countries or cities need a lot of patient :D

Yes, most p-channel mosfets can be used here. Post the numbers of the ones you can get, so we can confirm. Leo..

As example I can buy:

Irf9530
Bss84
Bts100
Irf9530npbf

Also can I ask you why you believe converting PWM to a analog dc voltage not working?

Only the BSS84 is too small. The others are ok.

Converting PWM to analogue would be better (silent), but requires more parts. And the pass transistor will get hot (needs a heatsink). Leo..

CrossRoads, that circuit will not result in a linear conversion from 0-5V PWM to 0-12Vdc out, because the charge time constant is longer than the discharge time constant.

It might work if (calling them R1, R2, and R3 from left to right) you make R2<<R3, such that R3 is 100 times or more higher in resistance than R2. That should reduce the linearity error below 1%.

I’d run it in LTSpice, but I’m at work (lunch) and we can’t install anything.

Load is also a problem. Any load on the circuit will lower that 12volt output.
An RC filter, followed by a rail2rail opamp with a gain of 2.4 (12/5) would be better.
Leo…

I dont have problem with more parts! My plan was to build a low-pass for every mosfet! Input signal (PWM) can be maximum 5v becaus of my PWM module. Any mosfet can drive an additional 12V or 18V from power supply.

So I beleive a low-pass filter can make smooth 0-12Vdc voltage!

The problem is, I have no idea how can I calculate Resistor and Capacitor values.

Just looking on the net but cannot find anything!

And another question, thos dc/dc step down modules! Are they suitable for this? For example this one:

https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.de%2Fulk%2Fitm%2F182545080096

Set potantiometer to have 12V on maximum PWM output frequency!

At t = RC, charge is up to 63%. If you use frequency = 1/(RC), you'll get a lot of ripple. If you use frequency = 1/(10RC), you will get very little ripple.

I agree with Wawa, simpler to just smooth the 5V PWM with an RC lowpass, then send into an Op Amp with gain = 2.4. No transistor involved. Since it will be a noninverting configuration, the input will be unloaded by anything but the incredibly high input resistance of the Op Amp's noninverting input.

I found this article about running 12V 3Pin fan using PWM :

https://www.baldengineer.com/pwm-3-pin-pc-fan-arduino.html

So is it good to use with my project? and is the output voltage for the fan side 12V?

Thanks a lot :)

OK,
I just test this one,
As you can see, voltage tolerance is too high!
I can reduce the tolerance by increasing R and play with C values! but it kills my amps!
so How can I have a smooth analog voltage in this sample with 0.1V - 0.5V tolerance and prevent to kill amps?

Thanks a lot :slight_smile: