PWM to Analog converter circuit

But I've been in a similar situation, usually when fixing the car. I can usually find every socket except the size I want lol.

Oh I know mate. That always happens to me too. Mind you it's probably because I never put anything back where it's supposed to be and then when I need it I can't find it.

Would you believe that out of dozens upon dozens of transistors I only have a single PNP? I have small, large, FETs,low power, medium power, high power, audio, regulators, switching, amplifying and probably others all available in NPN but just the single PNP general purpose (and therefore pretty poor) transistor.

So I decided to test the B772 to see if it was really broken. I tested collector to emitter and it is short circuit, so yes it's broken. :)

Seeing as Hong Kong still haven't come through I decided to load up the 2N3906 PNP that I have and see what difference it makes.

Well, it's massive. With the B772 I could power 5-6 of any of my fans (apart from the PSU fan I have) but with the 2N3906 I can't really power even a single fan. Max power capability, even with the lowest resistor I dare, was around 0.06A. Pretty pants really.

Edit and update: Didn't want to bump but I just found another transistor, this is a 2A PNP in TO-92 package that works ok and will do 0.4A before sagging dramatically. Shows the switch working though as it drops that 0.4A right down to 0.22A as I engage the 2k resistor over the 0.5k resistor.

I ordered some other parts last night. Stripboard, switches, resistors, cable and connectors. I already have some heatshrink big enough if I reduce the width of the design.

This morning I laid out the design to take up 5 holes rather than 7, I might be able to squeeze it down to 4 if I need to got it down to 13 holes long rather than 17.
 
Last edited:
Not so much an update but a notification.

I received some S8050D transistors today along with some 3/4 pin PWM connectors and terminals. I thought it best if I went for the 4 pins on both sides as it's cheaper and will allow easy connection of any fan, DC or PWM. Not quite sure how I'm going to crimp up the 08-50-0105 terminals yet but with 13 years experience in the terminal application field I will figure it out. :)

P1040844.jpg


I received some PCB and cable the other day. The LM78L05 are a voltage regulator that I actually don't need for this project but bought as a solution for one particular design that I was looking at.

july-comps.jpg



equip-wire.jpg



Still waiting on the B772 though. I'm beginning to think I should have bought a couple of B772s from the UK while the postal service from HK rides the waves.

I might throw a S8050D into the circuit later and compare against the BS170. The big difference between the two devices is that the S8050D is a current controlled device (more current in, more current out) , while the BS170 is a voltage controlled device (more voltage in makes it more switched on and allows more current to flow).

I did find a small power PNP transistor the other day that I couldn't find a datasheet for but I know it's PNP as I tested it. It works, but not as good as the B772 medium power transistor, being as it is fraction of the size.

I have been able to test my slide switch with different settings for Lo-Med-High and it works really well. With 1 standard fan I can have 10-100% speed or 70-100% (or thereabouts) depending on how I select and with more fans I should be able to keep the current flowing well into the 3 or 4 fan range. The switch also allows you to keep fans running relatively slowly vs PWM duty cycle if you have a couple of screamer fans that just don't need to be going mental.
 
Last edited:
Ok so I replaced the FET with the BJT and it doesn't do much at all. I noted down the voltage and currents through 1-4 fans and I'm only getting 30mA better power handli9ng at the heavy load end and 0.02v to 0.1v difference.

I really didn't think it'd make much difference but it was nice to try it out.

I've got a 100x S8050D and just a few BS170 so will be switching to the S8050D for now.
 
Amazing. Guess what arrived today.


Yes you got it, the B772 transistor.

B772atlast.jpg


Spent a little while messing around trying to figure out which resistors to use for Lo-Med-High.

With my High setting (2x510 ohm in parallel for 255 ohm) I found the resistors running to the switch to get pretty hot, that's because they are only 0.25W rated and I'm allowing 0.3W to pass through them. I will have to fix that. I'm thinking I might just go with 500 ohms, 1.5k and 3.2k as my settings. This'll allow for 0.4A, 0.2A and 0.1A of fans to work with good travel. That's capability to drive 2-4 fans, 1-2 fans and 1x <1500RPM fan down to 500-600RPM and up to near maximum speed.


The B772 gets mighty hot when I throw 0.5 Amps at it. It's only 6W total to the fans but the B772 needs to dissipate some of that energy as heat.




So I soldered a heatsink on it. I'm still using the little wires that I was throwing any PNP on I could find to test. Makes it easier to swap out.

heatsink.jpg


You may wonder if that's actually a single brass picture hook but you'd be wrong, it's a heatsink, really it is. :)

It barely gets warm now. :) The transistor has very limited surface to dissipate heat so this superbly designed heatsink really works well. Better than I expected actually.

I've also run some further tests with FET to Transistor and there's really nothing in it. The FET does allow slightly lower bottom end speed but it's so close it's not worth messing about. S8050 all the way from here I think.

So I'm closer to finished now. I have everything I need apart from the selector switches and possibly a male 4 pin Molex peripheral connector or two to power everything if it's needed. I should have a few of them on old fan splitters and stuff that I can use.

Next few minutes I get to fiddle I will change the resistors to the switch and retest the ranges.

I will also redo the board so it's thinner and longer, and possibly populate the selector resistors on the PCB, rather than have them on the cable.
 
Missed a day as we went off to Drayton Manor yesterday in the glorious sunshine.

Now back and I'm just not 100% sure about this switch idea. Choosing the right combinations resistor that affect the power handling is much trickier than I first thought and I might have to spread them out even more as I'm not quite getting low enough speed on the single fan setup, it goes from 12v down to 7v but I'd like it lower.

For simplicities sake the switch is much better than a potentiometer but you do lose that fine tuning option which I thought was awesome, but might be making things a touch complicated.

I think this is the problem trying to convert a digital signal into analog without a microcontroller. The end product will work, and can work really well, but the setup of the circuit in the first place needs a little thought and attention to balance as many eventualities as possible.

Phanteks went for a simple design that worked with their own fan and would probably work with many other fans just as well.

Will have to throw it on my PC later if I get a chance and see what the real world speed of the fans is going to be with it's current setup of 500 ohm, 1.5k and 2.2k and then maybe try and push it out to 1k, 2k & 4k or something.
 
A microcontroller is a small processor basically. You program it to do whatever function you require and it can control stuff on it's output. To be honest I assume it would be possible with one but lack the knowledge on how it would be done.

I've not fiddled with microcontrollers as of yet as I've been mainly looking at good old fashioned electronics with off the shelf ICs and transistors.

Microcontrollers cost a few quid each and then there's the cost of the development board and learning curve to use them. There's loads of them though. Maybe that's a job for another time.


A lot of the little electronics items we buy have microcontrollers of some kind but they are usually embedded and preprogrammed. Discrete microcontrollers you can buy are like a single chip that can do thousands of different tasks and range fron just a few pins to ones with a large footprint and dozens of outputs.

Anyway I've swapped the Low setting to 4.4k and the low speed on a single <1500 RPM fan is much improved.

So at the moment I can power 3-4 lowish speed fans and control from 95% or so right down to sub 500 RPM. I can power 1-2 fans with the same range in the middle setting. I can also power 1 fan (be it a 1000 or 1500 RPM) to the same range. I can go lower if desired but think that 500-600RPM should be low enough for just about anyone.
 
So I deciced to try and mount the components on a smaller footprint of stripboard as already mentioned. I managed to get it down to 18x5 instead of 17 x 7 for a reduction of 20 odd percent. I also managed to get the switch reduction resistors mounted in a spare bit of space. For a final build (I cracked this board so will have to redo) I will use hot glue to insulate the upright resistors.

Terminating the 4 pin PWM connector terminals was a breeze with a pointy nose pliers, a soldering iron and solder. Safe and strong connection.

No heatsink as yet fitted to the B772. I will do a high load test on it tomorrow at low and high duty cycle to monitor the temperature as the change to 500 ohm has limited the current it now handles a bit.

P1040912-1.jpg


P1040918-1.jpg


P1040919-1.jpg


A 3/4 pin header to mate with a 3 pin fan. I might just snip off the spare.

P1040915-1.jpg


A close up of the selector switch. I will have this sticking out under the covering heatshrink and use a combination of a cable tie and perhaps hot glue to hold in place.

P1040916-1.jpg


Hopefully tomorrow/next day I will do a demosnstration of how the switch works and how one would set it up for different fans. :)
 
Right guys as promised here's a video of me setting up for a few different fans by changing the switch position.


Simple enough I think.

Not totally happy with the High setting so even though I did record some video setting up three and four fans I've sinced modified it again to give just a tad more power differential betwen High and Medium. More on that soon.

So what you basically have is a choice to make on which setting you have it on, whether you want fast speed, low speed or a combination and compromise between the two. Regardless of this compromise though it is a lot more flexible than the Phanteks circuit. I still prefer the unlimited setting of the potentiometer but you are so limited then by the current capability of 0.1W through it.

I didn't test high load today and whether the B772 needs a heatsink but will do that soon.

Oh and I got the switches. They are bigger than the Tri-cool one but not a big problem. They also have mounting holes and solder holes so should be stronger.

switches.jpg


Oh and I got these things today

bitfenix99.jpg


Couldn't resist testing down the shed with a few fans.

shed-test.jpg


I'm going to review it and test it and then switch the LEDs to orange :)
 
Last edited:
Argh.

I think I might have to switch back to the FET BS170 as the S8050 transistor just can't work such a good range from low to high duty cycle as the FET. I've got a few BS170 and a few more 2N7000 which are similar but with slightly lower current rating, which shouldn't be an issue. Will have to check that out.
 
Last edited:
Yes mate it's just got complicated trying to accomodate different fans and quantities.

Doing a straight single 0.12A fan or similar converter would be child's play.

Anyway the 2N7000 is similar enough to the BS170 and responds exactly the same as expected so I have plenty of parts. Response is so much better using a FET.

So as it stands I have a circuit that works well on 0.1A-0.3A of a combination of fans, which covers pretty much anything besides fans that go above 2500rpm. If you were to load on a 5000rpm 120mm fan it would just run slow on every setting. It would still work of course.

So to do...

1) High load 100% test. Will check transistors for excess heat.

2) High load 5% test. Will check transistors for excess heat.

3) Long time run test. I will leave it for a few hours chugging away and see how hot stuff gets.

Then if that goes well I will put together a final build and test on my PC.

Then once I'm happy maybe someone else would like to test one out. :)
 
Ah but the TY-143 you refer to already use TY-143 goodness by design so they'd never come near my converter anyway :)

I of course can make one to work with much higher loads but it won't then work too well with lighter loads. Combining a high load fan with a low load fan would be ok though.

Most I've actually had working was in excess of 0.6A and that's just with the 1/4w resistors I have. With a power resistor or a resistor array I could drive up to 2A I'd imagine. I have loads of fans but doubt even together they'd go up to 2A.

Update: I managed to get it up to 0.75A on my old circuit with a bunch of resistors in parallel to share the load and got 5 fans spinning between 11.5v and 2.7v, which was nice.

Now running heat test with 0.37A at full speed on the final circuit with a slightly modified heastink (I cut the bottom hook off as there's no room for it now) as the B772 was getting quite hot. Ideally the circuit should be good for 0.3A with minimal voltage drop enabling powering of 1 high power fan, 2 or 3 low power fans.

It's trivial to increase the power output of the circuit by swapping a few resistors in and out, and even replacing the switch with just a single bank of resistors to give one high end power range. As these are hand made I can easily custom build power output to suit any needs. For example if I wanted to control a 0.08A fan such as a Gentle typhoon I would choose a 3.5k resistor. If I wanted to control a 140mm Spectre Pro I would go with 2k. A 120 Spectre pro would be 1k and 3 Spectre 1000RPM fans would need something around 750 ohms. So you see it's not really complicated to design the converter to control a known load.
 
Last edited:
So I did some long test with the sort of final board

newboard.jpg


The FET is mounted underneath as it's easier to swap it in and out when it's not hole mounted.


So that's just fine.

Next up is bringing it in the house and connecting it up to my graphics card PWM so I can change the duty cycle at a whim.
 
This isn't hard work it's fun, or at least it is for me. :) Plus the wife has gone out for the afternoon so I get lots of time to tinker.

Brought a few fans and the circuit indoors to run on my PC as a final test before making a final final build.

The circuit has no effect on the PC as it sits purely on an output. My graphics card PWM signal was happy to go into the circuit and it had no effect on my graphics card fan. The circuit works exactly the same as it does off my bench power supply, although it does get 12v in my PC versus 12.3v on my bench power supply.

Fan speeds were good when the selector switch was in the correct position for the fans attached, giving me almost full 12v speed at the top end and sub 400 at 20% duty cycle. Even with four fans loaded up all fans would spin at 20% if they were encouraged, although I would say it was a bit overloaded and could really do with being just 3 fans.

I did notice during the test that one fan, a 120mm black Bitfenix Spectre Pro did make some bearing noise which I hadn't noticed before. It seemed to make it throughout the range of speeds so I checked it on a decent DC source and confirmed that it just didn't like being mounted horizontally.

Anyway another video of the PC test here. None of these are professional as you may have noticed but I feel it's easier to describe something with video than it is with just images and text.

 
Panyan said:
would it be safer using a molex input for the power rather than running multiple fans off one header

Not safer as such as the circuit can't draw much more than about 0.4A but I have already planned to remove the two wires from the PWM connector and get power from a Molex as an option.

I'm also thinking about designing a second partner circuit that will drive fans without RPM feedback and this could then run off the Molex and you could perhaps run loads of 3 pin fans off that, still using the same PWm signal. I have the design ready, just need to breadboard it up. I could make a distribution board for it too, something like the one you might have seen in my videos. One one side the PWM to DC circuit and on the other a PWM to 12v circuit for the rest of your fans.

Every single fan controlled by your CPU temperature PWM curve. Sound interesting?

Panyan said:
ive heard lots of reports that pwm fans can click when run at under 12v (or not run on pwm mode), especially akasa apaches

This shouldn't be the case as 4 pin and 3 pin fans don't really differ mechanically, just electronically, however it's not wholly relevant here as we won't be using 4 pin fans on the circuit.

Interesting though as I have a Apache and might whip it off and test that out. Mind you sometimes I notice it clicking even when running under PWM control. I knew I shouldn't have believed the Akasa hype, when I knew they were a bit pants from fans I've had from them before.
 
Last edited:
I could probably do 0v or 3v up to 11v or something for this proposed second circuit. 0v-12v will be tricky indeed as you have voltage drops through transistors, regulators and stuff. A lot of fan controllers don't do full 12v anyway so I don't think this will be a huge problem. The big problem is that PWM fans have a different setup electronically and stay live all the time, just that the motor gets power as per duty cycle. What I'm proposing is switching the whole fan, including PCB on and off with the duty cycle. This may be problematic and I may have to go with some other method that switches high (11v) and low (say 3v) instead of 11v and 0v.

Ideally I'd like there to be an adjustable minimum fan speed for lowest duty cycle so you could choose the lowest RPM you want, eithr on a per fan or per board basis. There are some transistors with silly current ratings out there that could control dozens of fans off a single signal. Not quite sure how dozens of fans would interact with each other though.

I don't want to get too side tracked at the moment designing and testing more circuits until I've completed the original planned circuit though.
 
Last edited:
I knew I said I didn't want to get sidetracked but..

Hmm actually it's probably better if I don't have a 3 pin fan switching on and off 25,000 times a second and besides converting 5v PWM to 12v is trickier than I first thought. I've done 12v PWM to 12v fan and that's fine but the switching problem still remains. In the Oscilloscope graphic you can see me modifying the duty cycle up and down.

So if I can work towards 3v-11v (or thereabouts) I can use a Low Pass filter to voltage regulator circuit.

LP-1083.jpg


The triangle shaped component on the left receives a filtered PWM signal which basically smooths it out from it's bumpy 0v-5v shape to an average value between 0v and 5v. This then acts with the other components to output a reference voltage of the square LT1083 regulator. I've got plenty of the triangle components and other stuff and have ordered a LT1083 just to try it out.

The components at the top 1uF and 100 Ohm act as a buffer for when the circuit starts so it spins up to 100% for a brief time, it also acts as a buffer for when you change PWM duty cycle so it doesn't react too fast and cause noise variations. These should normally be 1k and 100uF. If I leave these as normal values it takes like 2 minutes just to drop down in simulation as it isn't real time.

The board for this circuit will be larger and drive loads of fans with adequate heatsinking on the regulator.

Under simulation I can throw over 5.5 Amps through the regulator without deflecting the output more than a few dozen millivolts. I'm not wholly sure if this simulation will bear out into the real world but will have to wait and see. LT1083 coming from China so will be a while and will give me a chance to finish the other circuit.

What I could do is mount the circuit on stripboard along with a few 3 pin headers for fans, and a Molex connector for power, either mounted or on wires. The board could sit somewhere like where a fan controller would go and it could be mounted in a box.
 
Last edited:
Haha.

It would be awesome if it did but in this case it's just Linear Technology number 1083.

Don't forget that this concept hasn't been tested properly yet and may not actually work.

Anyway if I get around to it Tuesday or Wednesday I will start making some originals with the Rpm feedback. I'm thinking this one would be useful for CPU coolers and can control an entire PCs fans if you use a few with splitters.

Who wants one? Any individual requests ie. Molex power etc I will fully test any I send out on my own PC.

We can organise things in trust.
 
Last edited:
Ok a couple of vidoes today.

First one is another aside is a LED strip PWM dimmer concept mentioned by Panyan as an idea.

Ever wanted your system LEDs to get brighter as your CPU warms up? Well this little circuit will do it for you.

I take the PWM signal and run it into a Darlington TIP112 transistor (just what I had to hand) and power the strip through the transistor collector connection. A Darlington is basically two transistors in series emitter to base so the current amplification can be 1000 times. If there are just a few LEDs a Darlington won't be needed and a normal power transistor would do.


The second is a video showing the circuit I built for Panyan.


So it's the same core circuit but with four fan headers on the board, it's powered by Molex and I've managed to get the full heatsink in place by shifting the B772 slightly. The resistors, although still a little upright are much neater and I will cover them with hot glue later.

I'm very happy how it's turned out and also very happy with the speed regulation, which allows a fast mid range, or a slightly slower mid range depending on which switch setting you choose. The low speed setting would also be useful for a single fan if desired.

Ideally the board will be mounted in a box of some kind or just insulated from the case. Most important is that the underside of the board is kept away from metal. I'd probably wrap in insulation tape and stick out of sight. I will leave that choice up to Panyan.
 
Stick it in a sock. It's not going to be seen so it just doesn't matter. :)

I will get measurements of the board for you. Sticking it all in a single heatshrink might be tricky though as the fans are all connected and add a fair bit to the height, although you could shrink it half way across the board. The B772's heatsink can be trimmed and even flattened down.

There are loads of electronic project boxes available of all different sizes available. Most are made of plastic and can be drilled to make holes for cable and stuff.
 
Back
Top Bottom