• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

FEATURED Building PWM Controller for 4 wires PWM fan

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.
Let me do some playing with one of my atmega328s and see what If I can get a decent PWM frequency out of it.
Do you know what frequency your fans are looking for?
 
Okay I've put together a list of what parts are needed to build Bing's 0-98% controller. There were a lot of specifications about the parts that I wasn't sure about. For instance, how many watts the resistors need to handle, what the voltage rating the on caps should be (except the one where it is mentioned) etc.
Can someone please double check these parts to see if I'm making any mistakes. I don't want to have to put another order through digikey.

2X Diodes
100K Potentiometer OR Potentiomenter
1K resistor 1K resistor
10K resistor 10K Resistor
470 pf Capacitor
0.01 uf Capacitor

10 uf capacitor

0.1 uf Capacitor 0.1 uf Capacitor
TLC556 NE556
Circuit Board
2X Fan headers This is not the correct connector for a standard fan. It is about 1.5X too big.
4 pin molex connector The pins for this connector are just a bit too big to fit into a PCB. You will either have to drill bigger holes, or get a different part.
Breadboard
 
Last edited:
I know three pin fan headers fit radioshack boards, that one may well fit that board. It's worth a shot.


EDIT:
Tested a Kingwin fan (yeah right, don't know the actual manufacturer) and it accepted a 33khz PWM signal direct from my atmega328p microcontroller. I'm going to test the Intel and Nidec fans at some point.
If they all accept it, this may herald a new dawn for fan controllers :D
 
Last edited:
Okay I've put together a list of what parts are needed to build Bing's 0-98% controller. There were a lot of specifications about the parts that I wasn't sure about. For instance, how many watts the resistors need to handle, what the voltage rating the on caps should be (except the one where it is mentioned) etc.
Can someone please double check these parts to see if I'm making any mistakes. I don't want to have to put another order through digikey.

2X Diodes
100K Potentiometer
1K resistor
10K resistor
470 pf Capacitor
0.01 uf Capacitor

10 uf capacitor

0.1 uf Capacitor
TLC556
Circuit Board
2X Fan headers (This probably won't fit in the slots of the above circuit board)
4 pin molex connector


IMO,
the diode is okay...
the resistor is too big, I build my controller with 1/4watt rating (you can save a lot of space on the layout)
the caps are okay, since the circuit will be run from the 5v rails, so the 10v should be safe
as for the molex connector, maybe you can rethink of a cable converter instead of connecting it with molex (it saves space IMHO)
and for the pots, if it's me I'll search for smaller physical size (again for space sake)

but to be brief, your components choice is far than safe (if you connect it right though:p)

here's what I've done with my 2-98 controller:
21032011060.jpg
I used 1/4 watt resistor and 25v electrolicyt (can't find the 10v:bang head)
the match box is really popular in Indonesia, (but I don't have any idea if it's international sized though:rofl:)

and here's my connection while I build the 0-100 and still on my "gettho" adapter:
16042011130.jpg

hope this images will help you decide which components you should buy:)

and since you plan to use a thermistor in your design, please share your design later (I really like to learn how to use the thermistor too:D)
TIA
 
Hi Omega,

Just read thru your posts here, just fyi, at the 2-98% version, you just can not easily replace the P1 100K pot with a thermal sensor like a thermistor to turn it into a thermal throttled fan controller for pwm fan. This because the whole 100K pot value it self is the component in determining the pwm frequency, so if the pot's value change, the frequency will change as well. As I mentioned in the past, this is because the 2-98% version is sorta poor man pwm controller design, while the 0-100% version is much more superior in design and can easily modded or tweaked for further variations.

In order to make this kind of circuit, the 0-100% version is more suitable, and we need to change or tweak around the R3, R4 and P1 values and place the sensor within that section.

But few words about this thermally controlled fan controller, had done that in the past and "usually" they will end up with a big head-ache since the thermal sensor's slope against the the temperature usually will not work as expected in translating to the fan's speed, and this kind of situation usually will consume lots of time and energy to tweak/tune/adjust and etc.

Correct me if I'm wrong, I think you're not a tinkerer and you just need to get it done as fast as you can without going thru the tinkering part ?

As Bob pointed out on using additional microcontroller (mcu), actually this is the right direction as the mcu will acting as the translator from the limited slope reading from the thermal sensor reading into the level of fan's speed that "WE"RE EXPECTING", this is a crucial part to understand before you stuck into an endless frustration in using the analog thermal sensor only to control the fan. Yeah, it will be more complicated, but thats the reality. :shrug:


Suggesting you to consider it seriously before deciding to jump into this thingy vs your expectation from the 1st place.


Okay I've put together a list of what parts are needed to build Bing's 0-98% controller. There were a lot of specifications about the parts that I wasn't sure about. For instance, how many watts the resistors need to handle, what the voltage rating the on caps should be (except the one where it is mentioned) etc.
Can someone please double check these parts to see if I'm making any mistakes. I don't want to have to put another order through digikey.

Just went thru you list, here few changes I recommended :

  • All resistor change to 1/2 or even 1/4 watt sized. 1 watt sized is too big.
  • Since this circuit is working on 5 volt, just pick 10 volt rated capacitor, this should be enough. Don't use the 6.3 volt part since they're too close to working voltage, also we will never know if they might be a voltage spike at the 5 volt rail.
  • About the TLC 556, this the cmos version, change it to NE556, here the Digikey's part I founded that is suitable -> http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=296-6504-5-ND , TLC556 vs NE556 part is CMOS vs BiPolar, use NE is better for this circuit, I should change that in my schematic.
  • Buy a breadboard, this is IMPORTANT as you never done electronic diy before, doing it on the 1st time at PCB level usually will end up with lotsa frustation. ;)
  • Finally, buy more sets of these components, who knows you might zapped or toasted some of them during the making, anyway, they're dirt cheap.


Actually, contemplating the datasheets and such, an atmega mcu given a 10mhz clock can output 20khz PWM directly! I'm going to have to get myself a 10mhz resonator and try this out!
8mhz is a standard option, that gives 15.6khz PWM output, that might actually work just fine, we'll have to wait for Bing on that one.

EDIT:
Tested a Kingwin fan (yeah right, don't know the actual manufacturer) and it accepted a 33khz PWM signal direct from my atmega328p microcontroller. I'm going to test the Intel and Nidec fans at some point.
If they all accept it, this may herald a new dawn for fan controllers :D

Bob, actually the lower PWM frequency, the better the efficiency, but there is a possiblity that it might generate audible noise since that freq is in human hearing zone. But no one never knows, this needs trial and error.

Keep us updated Bob, this is getting really interesting.
 
Aha! 16k-ish would definitely beat 33k! The 10mhz crystal may or may not confuse the 328p mcu badly with regards to ADC and serial communication, that would be an issue.

I'll see if I can convince one of my 328p mcus to run on it's internal 8mhz resonator so I can play with the 15.6k pwm frequency.
If it works and plays nicely with fans it'd be a very nice fan controller setup, it has two timers (each with 2 pins of PWM) that you can play with the frequency on without disrupting the basic internal timing. If you're willing think using 65k "milliseconds" as one second you get two more PWM pins as well, though communication to the outside world is rather difficult at that point.
I need to see if the basic idea works on the Attiny85, because if it does that drops the price for a mcu fan controller way down, the attiny doesn't need nearly as much life support as the 328p does, and costs a lot less to begin with too. Tougher to reprogram out in the field though.

Anyway, thanks for the info, I'll keep posting updates!
 
Bob, about power efficiency vs pwm frequency, since you're using a mcu based to control that digital pot, it will be easy to set "an exact" duty cyle point compared to mechanical pot which will not be precise as yours.

Prepare the mcu to set at the digipot at few test points, say at 25%, 50% and 75%, and do the test run on the fan with different pwm frequencies while monitoring the fan's speed rpm, the higher rpm has higher efficiency, thats all. ;)

Of course while doing that, don't forget to observe at which freq is the most favorable to your ears while finding the efficiency sweet spot, ok, tad nit picking I'd say, but just want to share my experience in cherry picking the pwm freq. :D
 
Thanks for the help guys. I updated my above post so if anyone else wants to build one they have all the updated part numbers.

@bing. You're right, I don't really have too much time to tinker with it and as much as I would like spend some time on this I doubt that will happen. That being said, I think I'll just stick with your original design. I updated all the parts to use 1/4 watt resistors but I could not find 10V rated capacitors that have the correct capacitance. Looking at the sizes of the ones that are rated at 50V though, they don't look like they're too big. Other than size, does it matter if they are rated higher?
I will definitely be ordering a couple of sets just in case. The reason I didn't want to go with the breadboard is because it doesn't look like going from breadboard to PCB is straightforward. The whole layout will probably have to change, although the connections will remain the same. I thought most of the problems would be with the layout anyway so that's why I was going to go straight to the PCB. Plus I was under the impression that the breadboard was for testing out a circuit to make sure that in principle it works, but since many people have already made this board wouldn't that be a redundant step?
That being said, I'm going to order a breadboard anyway but it's kind of pricey.

@inVain
Thanks for the help. Your circuit looks super clean. I was inspired by the design and looked for the smallest parts I could find. I switched the resistors to 1/4 watt ones and got the smallest 100 K pot. I guess I wasn't really looking at the sizes before and they all look the same size in the digikey images :)
Anyway, what are the copper bridges/links that you have in your PCB? Is that just solid wire? What thickness? I found something on digikey called jumper wires, and the breadboard I'm going to order comes with some but considering they're just wires, they seem awfully expensive.
 
Bob, about power efficiency vs pwm frequency, since you're using a mcu based to control that digital pot, it will be easy to set "an exact" duty cyle point compared to mechanical pot which will not be precise as yours.

Prepare the mcu to set at the digipot at few test points, say at 25%, 50% and 75%, and do the test run on the fan with different pwm frequencies while monitoring the fan's speed rpm, the higher rpm has higher efficiency, thats all. ;)

Of course while doing that, don't forget to observe at which freq is the most favorable to your ears while finding the efficiency sweet spot, ok, tad nit picking I'd say, but just want to share my experience in cherry picking the pwm freq. :D

That's simple enough. The first test will be 16khz vs 32khz, as those are two PWM output frequencies that the mcu can output natively, then I can skip the entire fan controller circuit/digipot thing and cut down the parts bill a bit.
In theory I could get it down to a couple ten cent caps, a $2.26 mcu, a $1.10 temp sensor, and some wires and connectors. I need to play with an attiny85 and the ozzyscope a bit and see if they can do the same frequencies.
 
@InVain
Thanks for the help. Your circuit looks super clean. I was inspired by the design and looked for the smallest parts I could find. I switched the resistors to 1/4 watt ones and got the smallest 100 K pot. I guess I wasn't really looking at the sizes before and they all look the same size in the digikey images :)
Anyway, what are the copper bridges/links that you have in your PCB? Is that just solid wire? What thickness? I found something on digikey called jumper wires, and the breadboard I'm going to order comes with some but considering they're just wires, they seem awfully expensive.

yeah, it's super clean....
thanks to the simple schematic, but yet a powerfull controller that bing have shared us:)

the links are made of salvaged telephone cables.
yep, they are solid core wire. I'm not really sure 'bout the thickness, but roughly measured on the ruler, it should be around 5mm-6mm. this telephone cable is really cheap here, spend $1 and you will get plenty:D

and after building my first 2-98% controller, I found out that breadboard will really helpfull...
"each fan is unique" is the law here....
some fan will respond better with different frequency, and my delta pfc is behaving quite "arrogant", by being the only fan which need a different diodes-pots arrangement.
so by having a breadboard around you can easily make these change:thup:
 
Omega,

Just rechecked your updated components list :

The 0.1 uf Capacitor , change to this -> http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=478-3150-1-ND , its smaller and easier to handle.

I can see you changed the pot to smaller one, its fine too, as long you're aware that your 1st selection is bigger and easier to handle and cheaper too.

When it comes to voltage rating for cap, higher rating is just fine, its just sometimes for > 1 uF cap they will usually bigger. But for < 1 uF cap, usually they're rated way higher like 50 volt or above, which is fine, also these smal value caps are small sized.

About the breadboard, actually its more for motivating factor rather than technical reason. Cause when it comes to fixing a circuit at PCB level using solder usually will ended up quite messy, especially if its your 1st diy circuit, and worry you might get really frustrated, worst it will ended up as abandoned project.

While using breadboarded circuit, its a lot easier to fix any mistakes, and the most important is once you saw your self it worked, then when moving to pcb, you will be heck a lot motivated even through long & tiring hours in fixing it since you've seen it worked before, thats all. ;)

So for breadboard, its your call.

inVain is right, don't buy those damn expensive jumper wire, just use the ordinary telephone wires that has solid copper core for the breadboarding and as jumper wire at pcb. A trip to your local radshack should cover all your wiring need.
 
Last edited:
Hi guys im John

im a graduating student here in the Philippines
i have a special project in school that i need to make a "fan speed controller" to be able to past my subject eventually i don't have any idea how to make that happened so.. luckily i find this site that hopefully can help me

after reading this thread i find it so hard to understand because this is a trial and error for making a "Fan speed controler" that's why im very confuse right now what specific material should i buy and what diagram should i use

can somebody help me :cry:.. this is my last hope to past my subject
i only need to build 0% - 100% speed 4 or 3pins

thanks in advance kindly PM me for some guides and tips
thank you thank you
 
Okay so I am trying to build this thing in a circuit simulator just to see how I can move things around on the PCB without affecting functionality but it looks to me like C4 and C3 are in a loop with no resistance? Since they are going straight from the power source to the ground are they actually doing anything?
I would have posted the circuit simulation that I built, but when I went to get the URL for the applet, it opened another java applet that deleted the whole circuit I had built so I can't really show what I set up. This is the java applet I was using though.

http://www.falstad.com/circuit/
 
Hi guys im John

im a graduating student here in the Philippines
i have a special project in school that i need to make a "fan speed controller" to be able to past my subject eventually i don't have any idea how to make that happened so.. luckily i find this site that hopefully can help me

after reading this thread i find it so hard to understand because this is a trial and error for making a "Fan speed controler" that's why im very confuse right now what specific material should i buy and what diagram should i use

can somebody help me :cry:.. this is my last hope to past my subject
i only need to build 0% - 100% speed 4 or 3pins

thanks in advance kindly PM me for some guides and tips
thank you thank you

John, :welcome: to OcF !

1st, just want to inform you that should this is project is your school's home work in doing a paper/report on an electronic fan controller, let me tell you, no body going to help you, afraid you will have to do it your self.

But if you're going to build it, the circuit is quite simple & clear and I believe deep knowledge in electronic field is not needed, you just need to find the components and connect or solder them according to the schematic, thats all you need. Also those components are easy to find at any electronic components store.

Fyi, this circuit is not for 3 wires fan, it is designed specifically for 4 wires pwm fan only.


Okay so I am trying to build this thing in a circuit simulator just to see how I can move things around on the PCB without affecting functionality but it looks to me like C4 and C3 are in a loop with no resistance? Since they are going straight from the power source to the ground are they actually doing anything?
I would have posted the circuit simulation that I built, but when I went to get the URL for the applet, it opened another java applet that deleted the whole circuit I had built so I can't really show what I set up. This is the java applet I was using though.

http://www.falstad.com/circuit/

Just briefly played the simulator and I don't think its enough to simulate accurately this pwm circuit, not sure though, haven't go through in detail. If you're really want to simulate it properly, suggesting to look for a decent electronic simulator program called Spice, there are a lot of it out there in the net.

The C3 & C4 are called bulk caps in electronic speak, their purpose is to provide an energy buffer to the ICs, and to ensure they supply enough juice when the circuit is loaded. This is common practice, especially when the circuit is far from the power source, in our case the psu. Regarding lack of current on those caps at that simulator, I'm afraid that simulator is not good enough to provide any details on those caps.
 
A bump just to brag on a gift that I just received from inVain, an excellent built of the 0-100% version pwm controller. :rock:

Imo, this is a work of art, very nicely laid components ! :thup:
View attachment 95166

Watch the blue box, it is the C1 cap which is installed on a sockets rather than soldered to the board. This means changing other PWM's frequency is now a piece of cake, just by pulling that cap and replace it with other values without any hassle at all. Great idea. :clap:
View attachment 95167

Thank you inVain, really honored to have this piece of fine work of yours. :salute: :bday:
 
Last edited:
Invain makes the cleanest layouts ever. Very impressive! I like the socketed cap too, I'll have to try that.

On another note, if y'all want to see the three output double-556 PWM thing I put together for Sebas for Miah from Bing's schematic, there's a pic mid way down the first post of this thread. Pic#3.
 
Last edited:
Invain makes the cleanest layouts ever. Very impressive! I like the socketed cap too, I'll have to try that.

On another note, if y'all want to see the three output double-556 PWM thing I put together for Sebas for Miah from Bing's schematic, there's a pic mid way down the first post of this thread. Pic#3.

LOL...

I just saw that controller InVain sent bing and was about to reply asking you (Bnova) why it was that you could not get the one you built for Miah to look this good? :chair:


@ bing
Man... I hope I can get a circuit down on pcb to look as clean as what InVain sent you. That guy is a magician with the pcb!

@ InVain
That is one sexy looking controller you built for bing my man. Maybe one day I will be able to lay my components down as cleanly as you have on that one.

:thup:
 
your welcome bing. I believe the honour is mine, good sir:)
thx to the good and simple schematic of yours:thup:

the idea of socketing the components came from Bob's post:

There's another alternative, if you rotate both zener diodes 180* that should have the exact same effect on things.
Might be easier then rewiring the thing to just desolder and resolder those two parts.


thank you Bobnova:salute:


@Sebastian
the reason that the controller looks so clean and sexy, is because bing take the pics of it :D
guess playin' simcity a long-long time ago pay me back for this layouting stuff:rofl:
 
Back