PWM to Analog converter circuit

Soldato
Joined
13 Jul 2009
Posts
7,228
Location
Llanelli
PWM to 3 pin fan converter circuit

Or how to finely control 3 pin fan/s with your 4 pin PWM motherboard/graphics card header and still get RPM feedback.

Have PWM control without the annoying tick noise that PWM fans sometimes create.

Drop me a message in trust, or post, if you want to ask me about making a circuit up for you. I've already made about 30 or 40 of these circuits for OcUK forum members.

The start of this thread deals with the development of the converter, it includes pictures and many videos and also explanations of what's going on electronically and may be a bit heavy for some.

However, this is the final product and this is what it does.

  • Control 3 pin fans directly from a 4 pin PWM fan header. That's CPU headers and GPU headers and any other PWM source in your PC.
  • Plugs into a 4 pin PWM fan header and spits out a smooth voltage the other side so you can control 3 pin fans with as small as a 1% change in duty cycle.
  • Has absolutely no PWM tick noise.
  • You still get RPM feedback.
  • It can control between 1 and 6 fans (depending on current rating), from less than 0.1A up to approx 1A via a adjustable screw.
  • It will adjust speed based on the PWM signal it gets from your CPU fan header or the graphics card header.
  • It uses less energy at low duty cycle. More efficient than many fan controllers.
  • It can be tucked behind the motherboard or in a 5.25" bay.
  • It can use Molex or fan header for power.
  • It can drive fans down to 150 RPM and right up to maximum speed.
  • It's home-made. Nothing quite like a ghetto mod :)
  • It's safe. The circuit takes only a very small load from the PWM pin.

This is a version 2 I made for OcUK forum member.

JBYSmrX.jpg

This one is designed for a Gelid Icy Vision and plugs into the graphics card to give the user fine control over their graphics card fan speed

jM6I4o1.jpg

Here are two I made with 4 fan headers on the output.

s8SPRpU.jpg

I fit a heatsink to the larger transistor as it can get a little warm when driving 2 or more fans.

WhHUZt4.jpg

...and an older one I made for another OcUK forum member who wanted Molex for power. This one shows the inside of the heatshrink and one with the components in view, some of these components are now SMD and mounted under the board.

bJuhTGc.jpg

21DW5gg.jpg

I can make these for a small cost to cover materials and postage and a bit for the time. Just drop me a trust message. I only make the latest versions these days, these come with all the trimmings and feature the best developments I've made on the circuit in the last two years.


---------------------------------------------------------------------------------------------------------------------------------
And now the original first post.

*****Due to Photobucket changing their third party website policy some of the images won't be working, if you want more detail let me know.*****


This thread details a small electronics project I'm currently developing to solve a problem I've had since building my rig a couple of years ago.

So many CPU coolers come with 3 pin fans yet we all have 4 pin headers on our motherboards, it's a very puzzling situation and in some cases motherboard just don't have any 3 pin control support. So we then have to ditch the fans and buy some 4 pin PWM ones. My Gigabyte motherboard has far better control over 4 pin fans than 3 pin fans, indeed Easytune6 or the BIOS won't even begin to control my 3 pin fans and I have to use Speedfan. At the moment I have the fan ramp up and down between two values 600RPM and 1000 RPM. It's not ideal.

I've always thought it'd be nice to be able to have the full 20-100% speed control of a 3 pin fan, just as we can have with 4 pin PWM fans, such as the Thermalright TY-140, Akasa Apache and Akasa Viper and other PWM fans.

Now I'm just too tight to buy more fans, considering I have so many 3 pin fans, just to get this fine control so I've always thought it'd be cool to have some sort of converter. It is, however a little tricky.

First thing's first. What is PWM? Pulse Width Modulation is a method of rapidly switching something on and off , varying the ratio of the time it is on related to off. The fan doesn't notice the switching because it's too fast, but other electronic items will.

Consider the following image with a PWM signal at approx 25,000 times per second.

PWM-vary.jpg


It starts at 20% on/80% off, then goes to 50/50, rising to 80% on/20% off and finally 95% on/5% off. This is what a 4 pin PWM fan sees but cannot react fast enough to stop and start.

Consider again, if you will, the following DC voltage trace.

DCline.jpg


This is what a 3 pin fan sees.

How can we take the first image trace and convert it into the second but have that line vary depending on the percentage that our motherboard tells it to run at? To further complicate things motherboard/graphics card PWM is just a 5v signal and carries nowhere near enough power to do anything useful. It's just a control signal, not a current source.


Over in another thread Doyll was talking about an adaptor that Phanteks had sent him to do just that. My interest was piqued.

So I set about simulating a circuit in Multisim (circuit simulation software from National Instruments) and it didn't work. Not even close.

So after trying a few other ideas and realising that it's not going to be cheap or easy I came back to the original circuit, made a few adjustments, substituted my own transistor and got a really good result.

I threw a few components onto a board and tested.

PWM-converter.jpg


This little circuit can drive a fan down to 150 RPM and all the way up to 100% of it's rated speed, just by the adjustment of the duty cycle. It's sensitive enough to change speed even with a small change to duty cycle, and what's even more useful is that I get full RPM feedback from the tach wire, something which was missing from so many other converter circuits.

This little circuit can be plugged into the motherboard PWM header and drive fans, or it can be plugged into a graphics card PWM header and drive fans. Basically as long as you shove a decently high Hertz PWM signal into the circuit it'll work.


So I've got more tests to come but this was one of my first. I hooked the circuit up to a 555 timer PWM circuit (on the left of the white board) and had it's tach output go to a counter circuit to light up the LEDs.

It's poor quality as it's recorded on my iPod.


I have hooked it up to my PC but light conditions were poor at the time so didn't record anything. I may upload a further video showing the amount of control I can have over the fan speed in a day or so. I am also hoping to load it up with 3 or so fans so I can to test it for capacity.

Thanks to Doyll for the images and help. :)
 
Last edited:
Tests with multiple fans were not encouraging. It seems that the voltage is shared across both fans as if they are in series. Tried with identical fans too.

Doyll. Are you able to run more than one fan per converter? I'm wondering of my substitution of a MOSFET instead of a BJT is to blame here, or maybe it's just not good for more than one fan. When I hooked up two fans both fans would slow down noticeably and they'd have trouble starting.
 
Will check it out this afternoon and let you know.

Thanks mate. Just measured voltage drop and it's 3.5v down to 2.5v and at the top end 12v down to 8.5v so it's significant so you should see a marked difference in speed.

I suppose it's not really super important as one converter per fan is no major hardship.

Thinking about getting some S8050 in now though.


Pretty awesome stuff, don't know why these convertors aren't available to purchase.

I know. I'm sure they'd do well out of them, although more and more fans are PWM these days.
 
Interesting stuff. Not able to get 100% duty cycle on my bench PWM circuit so not seeing full speed with either fan. I've only got a two way splitter at the moment but think I will try 3 fans anyway, just for giggles.

S8050 on hold until I can figure this out.

I can measure current draw across fans with my meter so will see if it's that the current is restricted by the small transistor.
 
Resident said:
Firstly I apologise if this is a REALLY dumb question. <snip>

Fans in close proximity that are running at different speeds can have a drag effect on each other.

The third wire is for a sensor output only. It's not useful as a control mechanism.

The PWM design above uses the red and black power wires only.

Doyll said:
You know where to get one if you need it.

I hooked up two, then three 1000, 1000 & 1300 RPM fans and noted that the current drawn by the whole circuit only went up by about 20mA for each additional fan. So 120mA for one fan, 140mA for two and 160mA for three. It should be 120mA, 240mA, 360mA.

Voltage drop was worse with three over two as well. Ohms law in effect I suppose. A finite amount of energy is available through the circuit and once you add more load it just shares that energy amongst all the loads, the rising mA reading accounts for the voltage drop. 12v@100mA is the same power as 10v@120mA and 8.5@140mA.

The B772 was the hot component. I'm a little surprised that a 3 Amp rated transistor can't cope with a piddling 200mA load without getting scorching hot.

I wonder if Phanteks have designed this device solely around their 140mm fan series, which has a known energy dissipation of max 0.15A.

I think I might breadboard this circuit up again and substitute something else for B772.
 
Will try another fan I have, a 2500 RPM 0.4A noisy one, and see what current it draws. I dismatled my counter circuit though so can't verify it's top speed unless I bring it inside.

Might look at another circuit design. Bit more complicated (and expensive) this one and it has a voltage drop caused by the regulator.

LowPass.jpg


It simulates well enough. The varying voltage on the oscilloscope is from me adjusting the duty cycle. The LT1083 regulator drives the load and is rated at 7.5A so can drive a whole bunch of fans, in theory. It's only 12 components.
 
Last edited:
Hi Panyan. Well yes this is possible. If I'm thinking about this right the circuit which I built above is simple because it's designed for a range of fans with a known impedance and current rating. Problems arise when you try different fans, and multiple fans. It's just too simple a circuit unfortunately. That said it'll drive most quiet fans perfectly fine, and to really slow speeds, really quite ridiculously slow speeds and still give RPM feedback.

What you'd need to do is have a PCB with mutliple circuits all laid up next to each other, driving separate fans. This isn't tricky at all as the PWM signal wire can be shared easily amongst multiple circuits. These parts can be quite cheap if you buy a few in at a time.

Overall I'm really impressed with the circuit, and will use it, but want to experiment on other combinations of resistor and transistors before comitting it to my rig.
 
Nothing is ever perfect.

Other ways of doing this involve losses. The circuit above has at 1v loss from top end taking it down to 11v. Substituting cheaper components drops this down to 10v.

Now toying with the idea of increasing the voltage to compensate for losses but I'm beginning to think this is getting a little out of hand.

Might just be better to forget the tach readout and go for straight MOSFET switching of DC fans on and off where fans are too powerful for the initial circuit.
 
I don't think so. Transistors work like one way valves and should prevent any current flashing back into the PWM.

I'm a little surprised by Phanteks recommending more fans considering that the circuit is designed for one. Throwing more on will just reduce the current, voltage and speed to each fan and heat up the B772, or at least it does with my example. You could slap a heatsink on the B772 but it'll still be limited.
 
Ordered some S8050 for £2.28 for 100 :)

Also noticed that I got the resistor R2 and R4 positions mixed up. The R2 limits current coming from PWM and R4 has an effect on voltage going to the B772 base terminal, plus also adjusting current to S8050.
 
So I swapped the resistor around so that the 10k between the big transistor and the little transitor is now 1k and I can get a few fans running at near max speed(I think) I put on a 0.4A Yate fan and it shows up as 0.28A, I will compare against direct 12v power use later. I didn't swap the resistor on the PWM signal to 10k though but that shouldn't make that much difference to a MOSFET, although it will to a BJT.

Of course this is off whatever current my 555 circuit can provide through the MOSFET so it may be totally different on a motherboard PWM header which provides a few mA.

It's my own fault as I pieces together the circuit from a few different emails an my own knowledge, 10k made sense in the circuit where it was so didn't think it important.

What sort of speed drops did you see between 1, 2 an 3 fans attached Doyll?
 
Last edited:
Thanks for that mate.

Not a massive difference but you can see that the voltage is sagging a bit judging by the speeds.

Ok some developments.

Since changing that resistor I've noticed that I can now power 3-4 standard 1000-1500 fans to within a very close margin of the 12v rail, this means that it doesn't sag very much and almost gives me full speed and great speed reduction at the lower duty cycles.

Analog electronics is always a balance though and now I don't get such good speed reduction when I use a single fan. I'm adding extra power to the circuit (by increasing the voltage and current going to the B772) so it's staying closer to 12v as the extra power I'm supplying isn't used up in the low part of the PWM cycle and remains in the capacitor.

Fortunately we can solve this in a couple of different ways.

1) Modify the capacitor value so that it has more or less capacity to cope with the amount and power of the fans. Adjustable capacitors are not readily available though.

2) Modify the resitance between transistors to limit the current available in the circuit. Variable resistors, or potentiometers are cheap, readily available and can be mounted on a wire, or on the PCB. If you put a 1k resistor between the transistors (acts as highest possible power), and then a variable resistor of 5k or maybe 10k in series with that you can set the circuit up for your fan array so that you get the reduction in speed that you want based on the curve you have set. With this you could power 0.1A or 0.4A of fans, more if the resistor is less than 1k, although I haven't tested that yet.

I suppose you could go with a larger capacitor than 10uF, say 33uF and that might allow for even larger current to be drawn, if it can be filled by the B772 in time.

So my next experiment will be to change that cap and to look into the use of a potentiometer. It adds a layer of complexity but meh it's just a twist of a knob. Once it's set it'll be set and not needing touching until you change the fan array.

Update: In simulation (with alternate non-ideal components) a larger capacitor value just smooths the power going to the load and makes the circuit a little slower to react to changes in duty cycle but has no major effect on the amount of voltage present at the output terminals.

I wish I had an oscilloscope so I could see this stuff in the real world.
 
Last edited:
I managed to find some time today.

I didn't take many pictures but did take some video as it's much better to see stuff hapenning rather than just seeing static images.


If I repeat myself or don't explain something then it's probably because some videos didn't make the cut.

So I tried a 10k preset, then a 510 ohm resistor, then both and then hooked up the 4 fans to my PC and tested them at their lowest speed and restarted. My graphics card PWM was used as it's easy to adjust.
 
So yesterday I had a fiddle with a few things.

Firstly I looked at the 10k ohm resistor running from 12v to the B772 base terminal. I didn't want to blow stuff up so didn't try a preset potentiometer but rather used a few resistors in parallel.

At 7.41k
P1040767.jpg


P1040771.jpg


It made no difference..

So I added another 15k to make somewhere around 5k

P1040778.jpg


....and it made no difference.

So on went a 2.2k resistor, to make not far off 2k. No difference again.

P1040784.jpg


So it seems changing this value makes no bit of difference to the power capability of the circuit. I also tested this in Multisim later and it's exactly the same situation.



So onto experiment two.

Change the Mosfet. This little Mosfet is good up to 5.5A and silly voltage.

P1040786.jpg


The BS170 which was used originally was good to much lower levels of voltage and current.

P1040788.jpg


So here it is in situ on my stripboard. The pinout of the larger Mosfet was different so I just wired it up with jumper wires. It adds capacitance, inductance and stuff but meh.

P1040789.jpg




The larger power Mosfet actually adds around 10% more capacity to the circuit when compared with results from earlier experiments and slows down the sag in voltage a little. The price differential is quite large though. BS170 can be had for around 10p while IRF730 cost me around £1 from Hong Kong ages ago. They are available for 36p from the component suppliers but you have to take a massive postage hit with those. The IRF730 is probably not the most ideal transistor for the circuit but it's what I had to hand with a datasheet. I originally bought them to design a fan controller that never got made. Thinking about it though a logic level Mosfet might be much better at 5v as they switch fully on at much lower voltages, but I don't have one, or at least I don't think so.

Stuff I tried with the IRF730.

1) No pre-resistor, straight into Preset potentiometer. Ouch.

2) 510 ohm & Preset

3) 5 fans and compare

4) 6 fans and compare.

5) 7 fans and compare

6) Temperatures when running slow

7) Stupid fast 2500rpm fan when already running 7 fans.

So I think this demonstrates that it's better to use 4 or 5 fans at max, and all fans be of similar specification ie. Current draw and rated speed.

I've also had a look at running two Mosfets, a P-channel and a N-channel and the circuit just goes totally crappy in simulation. I don't think that'll work.

I now understand why the preset destroys itself when I take out the resistor and go with preset. With a 510 ohm resistor I have up to 20mA going through the resistor at 12v (V=IR), that's 0.2W (P=VA). When I remove this resistor and go off the preset and have it at say 100 ohms, then I have 200mA at 12v, which is 2.4W and as presets are rated at lower than this they burn. I'm not 100% sure why the Mosfet melts itself too though. Feedback perhaps.

Edit: Just checked and the presets I've used are actually 0.1W rated so are being over powered if there is 20mA running through the circuit (at 99% duty cycle).

Perhaps a 1k + Preset would be a better long term solution. 12v /1000 = 0.012A and then power = 12*0.012 = 144mW. Still a little over.

I'd then need to take a hit on the overall power though, taking it down to 4 fans, or use a higher gain PNP transistor.
 
Last edited:
What do you guys think of the adjustability of the circuit though?

Do you feel it makes it a bit complicated to need to adjust the setting of the circuit to suit your fans or do you think a one size fits all method would be better, but lose the fine tuning of the way the fans react to PWM cycle?

Just in case you aren't aware of what I'm asking. You may have noticed I added a potentiometer to the design so you can dial the power output of the circuit to match your needs. You can adjust so that the fans don't speed up too much, even at 100% duty cycle, or dial them up so they don't slow down too much, even at low duty cycle. It's a slight fiddle but I think it's a nice idea to dial in the cooling you want, but still have some control over what goes on.

Thinking about it though it's also easy to make fixed devices with different outputs, 510, 1k, 5k etc but you'd lose the fine tuning.
 
That said, looking at my Antec Spot, how hard would it be to replace the potentiometer with a 3-way switch allowing for 3 preset options.

I hadn't really thought of that. I saw a silder switch when I was looking at connectors but didn't really consider it as viable. Maybe as you say a 3 setting switch suitable for Hi, Med, Low power output. Would involve a few different resistors and a slider switch. The switches are reasonably cheap and so are resistors. The switches are also much more tolerant to current so shouldn't burn like potentiometers. Having a slider switch outside the heatshrink won't be so much of an issue as a potentiometer either. Nice idea.

Actually if I get a chance I might look at this today. I have a few slider switches salvaged out of old items so can actually give it a go.

Panyan said:
personally i think a well chosen resistor that can give acceptable output at high and low would be better

have the whole thing in black heatshrink with the ports on either side

That would be the easiest. Not as flexible but just works. If you want more fans added then just get more adapters. If your fan runs too fast then add more fans.


I think I will eventually redo the layout.

PWM-converter.jpg


This design is a bit fat. I think a slightly longer version might be better with components in a line, rather than side by side. It will be easier to heatshrink and hide away in a case. In the build above there are 5 clear lines empty between the transistor and the capacitor so I could utilise those.

A slider won't add anything to the PCB as I will do that off board.
 
Good idea. I've had one of them open and there's not much in there besides the switch as the control mechanism is down in the fan itself. A small switch like that will be low current but should work. I wonder if I still have the switch attached to my fans. Knowing me I probably ripped it off.

Slide switches from Hong Kong are a good price though so I wouldn't consider buying up Tri-cools just for the switches. OcUK used to do black Tri-Cools silly cheap, I assume they were pulled from Antec cases they built where they'd swapped the fans out.
 
Last edited:
So here is the switch out of one of my Tri-cools. Not sure where the other one is but I have a feeling I destroyed it.

P1040811.jpg


I have worked out a little circuit for the switch to allow 3 different settings. 23mA, 12mA and 6mA using just 3 resistors, which I will test to see what I can drive at each setting but it should be around 0.6A, 0.4A and around 0.2A respectively. I could go High, Med, Low, Super Low as well if I can find cheap 4 position switches. Edit: Umm no it looks like the extra position really complicates things and bumps the price right up.

Here's the sort of thing I was thinking from the auction site.

ux_a12013100ux0093_ux_c.jpg


Anyway tests must come first.
 
Last edited:
Doh, looks like I must have thrown the slider switches I had in my parts bin. Will have to use the Tri-cool one.

On a brighter note looks like Bitfenix will be sending me a Recon fan controller and two Spectre Pros, which is really nice.
 
Disaster.

Wired the slider switch up wrong (I made a mistake with it's pin outs), created an open circuit and got that burning smell again. First I assumed it was the Mosfet that had failed, so swapped that for a fresh one but the circuit is not responding to duty cycle. I must have burnt out the B772. That's the second one that's gone pop since starting this project. Still not had any from Hong Kong so can't progress at the moment.

I did get the slide switch working though and as predicted 6mA, 12mA and 24mA or thereabouts.

Might grab another 10 of them if I can't find an alternative.... Done.

Had a look through my parts bin and I have dozens upon dozens of NPN transistors, a lot of them audio grade too, as that's what I've mainly broken down, but not one single useful PNP aprat for some generic jelly bean PNP which would just be no use at all. Come on Hong Kong, earn your money.
 
Last edited:
Back
Top Bottom