Trying to build a PWM fan controller - Page 1
Forum section: electronics / beginners

author: eamoex
author_rank: Contributor
timestamp: December 03, 2018, 07:43:29 pm
content: Hello Everyone,first, please know that I'm a total newb, and so I use language which is almost certainly wrong. I do things which are almost certainly stupid. But I'm not all that young anymore, have no one around to teach me and rely on information and hardware gleaned here and there. So please don't bash me...So. I would like to build a 556-based PWM fan controller. I found this schematic:onthis [url=http://www.overclockers.com]www.overclockers.compage.I've started breadboarding it and have made some progress, i.e. the PWM output lead does its job (or so it seems to me anyways) but I don't get how the PWM signal is "interpreted" by the fan. The 556-based circuit does change the signal's duty cycle, but fan speed follows some indetermined curve, going slow in the middle and fast at the ends. It also doesn't seem to span the full spread of available speeds, i.e. when it's slow, I think it could actually be much slower.I've triple checked the circuit and think all is right according to schematics.Here's a video of my being ignorant with my donated 1-channel oscilloscope:http://www.emyamstein.ch/media/forums/IMG_0410.MOVThe fan is this:https://www.amazon.com/Noiseblocker-.../dp/B00839GBC6Also, I know that you savvy people know better, more elegant ways to achieve PWM control, but doing this is a lot of fun to me, although certainly clunky-looking for the expert.Can somebody please tell me what's wrong with the circuit? Or me?

author: jmelson
author_rank: Super Contributor
timestamp: December 03, 2018, 09:17:23 pm
content: Does your fan have a logic-level PWM input, or is it just a plain 2-wire fan? If 3-wire with PWM input, then check the data sheet to find the optimum PWM frequency and duty cycle range.If a 2-wire fan, then you will have to run the PWM at a low enough frequency for the fan to work right. Many 2-wire fans have a start-up mode that they execute every time power comes on to get the rotor started, and this will likely interfere with PWM speed control.Jon

author: eamoex
author_rank: Contributor
timestamp: December 03, 2018, 10:24:05 pm
content: Thanks for your reply.Itisa 4-wire, tach + PWM input fan. The datasheet unfortunately doesn't say anything about frequency or duty cycle. It boasts about propeller and case material, longevity, low acoustic dB... just about anything but that information.I've reached out to the company to get the data. I'll see what I get...

author: spec
author_rank: Frequent Contributor
timestamp: December 03, 2018, 10:39:36 pm
content: Hi eamoexHere is a datasheet which shows the fan speed range:https://www.blacknoise.com/datas/downloads/datasheets/TData_BSP8025_122012_de_en.pdfIt seems odd that your fan has a four-pin connector because the Amazon advert states a P1 version (3 pin Black=0V, red=12V, yellow=taco op). The four pin version is PP.The schematic for the PWM has no values, which means we can not analyze it.Also we would need a complete schematic of your circuit from the power source to the PWM to the fan. Presumably you have a 5V and 12V power source.

author: grumpydoc
author_rank: Super Contributor
timestamp: December 03, 2018, 10:53:55 pm
content: If it is standard computer 4-wire +tacho there is a specification to which it should adhere.https://folk.uio.no/kyrrens/diverse/viftekontroller/developer-specs-REV1_2_Public.pdf

author: nemail2
author_rank: Regular Contributor
timestamp: December 04, 2018, 12:22:23 am
content: just a side note, imho a standard 3 pin fan never incorporates pwm. the 3rd pin is the tacho signal. if you have 4 pins, the 4th pin is the pwm input.

author: eamoex
author_rank: Contributor
timestamp: December 04, 2018, 06:29:48 am
content: Hello Everybody, thanks a lot for your replies.Quote from: spec on December 03, 2018, 10:39:36 pmYes, it's the datasheet I found too and my version is the PP. Just hadn't noticed there were two versions when I referenced the Amazon page.Quote from: spec on December 03, 2018, 10:39:36 pmOkay, I'll draw it later. But basically, the breadboard is powered by a 5VDC 3A USB supply and the 12V fan by my little bench lab supply. And the fan is hooked to the PWM signal lead by the PWM pin (not the tacho one; I only connect to the tacho wire to read fan speed – which gives me horrible wobbly signals by the way, but that is another question probably linked to my not knowing how to reference the oscilloscope, or other interferences…).Quote from: grumpydoc on December 03, 2018, 10:53:55 pmThanks for the spec, very useful.I'll do more testing, draw the full schematic and report back.

author: eamoex
author_rank: Contributor
timestamp: December 04, 2018, 07:04:09 am
content: The whole rig

author: grumpydoc
author_rank: Super Contributor
timestamp: December 04, 2018, 07:12:39 am
content: Component values would be useful.I would start with the single 555 circuit from the same pageWhat test equipment do you have?

author: spec
author_rank: Frequent Contributor
timestamp: December 04, 2018, 07:59:29 am
content: Quote from: eamoex on December 04, 2018, 07:04:09 amThanksTry making the connection shown in red on your modified schematic attached below:I found the component values- they are on the page you linked to in your opening post.

author: spec
author_rank: Frequent Contributor
timestamp: December 04, 2018, 08:40:29 am
content: Attached below is your modified schematic with component values included.The first thing I happened to notice is that 1N4148 diodes are called up in the components list, but schottky diode symbols are shown on the schematic. Schottky diodes (BAT48) would be much better because they have a lower forward drop (Vf) than ordinary diodes. This is especially relevant with this circuit when running from a low supply rail, like 5V.The second thing is that there appears to be an error on the schematic- will describe in next post.I will have a look at the 556 circuit further.

author: spec
author_rank: Frequent Contributor
timestamp: December 04, 2018, 09:48:41 am
content: Another schematic attached showing a correction in red for the 'error' I mentioned.On reflection, the original circuit would always work, but the circuit, as I have shown, is much cleaner and better practice.AFAIK, the fan PW control input is expecting an open collector/drain drive with pull up resistor, but the present 556 circuit is providing source and sink drive. Not sure how happy the fan circuitry would be with that.

author: spec
author_rank: Frequent Contributor
timestamp: December 04, 2018, 10:21:26 am
content: Yet another schematic attached.This schematic only uses the first section of the 556 and provides an open drain drive for the PW input to the fan.Not sure if a 10K pull up resistor is low enough, but that is easily fixed.

author: Ian.M
author_rank: Super Contributor
timestamp: December 04, 2018, 10:37:57 am
content: The 556 or dual 555 circuits from overclockers.com are pointless, and only showcase the limited electronic design skillbase at that site.Instead of driving the fan from the push-pull signal on the 555's Out in, simply drive the fan PWM input from the 555's Discharge pin, which is open drain if you use a CMOS 555 (and open collector for a bipolar one), so is closer to the Intel 4 wire fan specification drive requirements, and also removes any need for a second 555 or 1/2 556 for buffering.I'm rather suspicious of the 100K pot and 680pF capacitor as I think the frequency will be outside the 21KHz to 28KHz range called for in the Intel spec. near the ends of pot's travel.I've attached a LTspice sim of a simplified single 555, single 12V supply circuit, using a potential divider to pull up the Discharge pin to an effective 5V level, with a 50K pot and a 1nF timing cap which should meet the 21KHz to 28KHz range requirement, or at least be far closer to it.Edit: it looks like Spec's been working on something similar while I've been typing this.

author: spec
author_rank: Frequent Contributor
timestamp: December 04, 2018, 10:47:39 am
content: Quote from: Ian.M on December 04, 2018, 10:37:57 amThat applies to many circuits you see on the net and to a lesser degree in booksQuote from: Ian.M on December 04, 2018, 10:37:57 amGreat minds think alikeThe OP is using a CMOS 556Quote from: Ian.M on December 04, 2018, 10:37:57 amThat was my concern too.Quote from: Ian.M on December 04, 2018, 10:37:57 amGood move. Handy info about the Intel spec frequency range.Quote from: Ian.M on December 04, 2018, 10:37:57 amHappens to me all the time

author: spec
author_rank: Frequent Contributor
timestamp: December 04, 2018, 11:00:21 am
content: By the way, you can replace the 5V PSU brick with a 5V Zener diode and resistor running from the 12V supply.(time for work now)

author: eamoex
author_rank: Contributor
timestamp: January 23, 2019, 07:40:00 pm
content: Hello All,I've breadboarded Ian.M's circuit and it works way,waybetter than what I had before. Fan's speed makes a linear, steady progression throughout pot rotation. Thanks everyone for your help!I've checked the PWM pin signal without the fan connected and it is a crisp square wave which goes from almost zero to 100% duty cycle. Frequency tends to drift a little along the pot travel, though, and seems just a bit on the low side, ranging from about 19 to 22 kHz.Hencewhy I wish to trace the output of the tach pin, to check if the fan goes the whole range of RPMs (from 500 to 2000, roughly). I did connect the oscilloscope probe to the tach pin, but I don't understand what I see. It looks like a garbled version of the PWM signal, which makes no sense, because the tach signal should change in frequency but not in duty cycle (actually I have not read this anywhere but it seems obvious enough).Where do I have to stick the oscilloscope probe and ground clip to properly read the tach pin signal?

author: Ian.M
author_rank: Super Contributor
timestamp: January 23, 2019, 08:45:59 pm
content: Try a 4K7 pullup to +5V on the tach pin and see if that cleans up the signal.

author: rstofer
author_rank: Super Contributor
timestamp: January 23, 2019, 08:52:18 pm
content: Quote from: eamoex on January 23, 2019, 07:40:00 pmIntel spec says Tach output is open collector and that the motherboard will have a pull-up to 12V. So, you can probably connect the output to a 10k resistor connected to 5V. Probe between ground - the common ground for everything - and the pin.Ii don't know which schematic you are using. If you don't have a 5V source, you can probably use 12V and a 10k resistor. Ground is still ground.

author: rstofer
author_rank: Super Contributor
timestamp: January 23, 2019, 09:03:06 pm
content: Quote from: eamoex on January 23, 2019, 07:40:00 pmThe tach signal, according to the Intel Spec gives 2 pulses per revolution. Whatever mechanism they use internally, perhaps photoelectric or maybe hall effect, will have an on time proportional to speed.Without the pull-up resistor, all you're going to see is trash.

author: eamoex
author_rank: Contributor
timestamp: January 23, 2019, 09:21:54 pm
content: Thanks Ian.M and rstofer.I'm using Ian.M's schematics so I only need 12V (handy!).Quote from: rstofer on January 23, 2019, 09:03:06 pmYeah... struggling a bit to grasp the ideas behindopen drain/collectorandpull-up/down. I get it when I read about it but then forget what it's about 3 minutes later. I need more practice. By the way,trashvery accurately describes what I see.Will try out the 10K pull-up and report.

author: eamoex
author_rank: Contributor
timestamp: January 23, 2019, 09:50:51 pm
content: Quote from: rstofer on January 23, 2019, 09:03:06 pmWhen you say "an on time proportional to speed", you mean a linear variation in frequency, not duty cycle, right?

author: aheid
author_rank: Regular Contributor
timestamp: January 23, 2019, 10:07:48 pm
content: Quote from: eamoex on January 23, 2019, 09:50:51 pmYes. Emphasis mine:Quote from: 4-Wire Pulse Width Modulation (PWM) Controlled Fans Specification v1.2Note that you're playing the role of the motherboard in this setting, the spec is written from the POV of the fan. You'll pull the line up, and the fan will pulse it low two times per revolution.

author: eamoex
author_rank: Contributor
timestamp: January 24, 2019, 07:26:48 am
content: Inserted a 10K pull-up resistor and the tach signal is PERFECT, even cleaner than the 555 one, no overshoot. Fan speed range is almost perfectly in spec, ranging from a perfect 500 to 1950-ish revolutions per minute.Now this thread is out here for anyone trying to do the same thing!You guys rock, thank you.EDIT: when I bought this second hand scope, little did I know about the level of satisfaction that can be brought by watching a green line moving on a 3 inch CRT.