31
\$\begingroup\$

I have a 3-pin 12 V computer fan and I want to interpret its speed sensor output. At the yellow wire I get something that looks like pulse-with modulation. How would I interpret the output without actually connecting the fan to a computer?

\$\endgroup\$
3
  • \$\begingroup\$ Related article: petervis.co.cc/cpu%20fan%20tacho/cpu%20fan%20tacho.html \$\endgroup\$
    – AndrejaKo
    Commented Dec 26, 2010 at 3:26
  • \$\begingroup\$ Updated link: petervis.com/electronics%20guides/cpu%20fan%20tacho/… \$\endgroup\$
    – Andrew
    Commented Oct 13, 2011 at 1:15
  • 3
    \$\begingroup\$ This petervis links seem suspect -- the article claims the tach signal is in "PWM format", which is nonsense, and that the tach output is at TTL voltage level. The author may be confused between tach output, and PWM input to fan. (Not all fans have both, or indeed either, of PWM input and tach output.) Read answers below, and Intel document mentioned. \$\endgroup\$
    – gwideman
    Commented Aug 28, 2014 at 1:11

5 Answers 5

44
\$\begingroup\$

Brief background: The tachometer output comes from a Hall-effect sensor mounted on the motor driver PCB on the fan frame. One or more magnets embedded in the fan rotor hub activate the Hall-effect sensor as they pass by. The sensor is amplified, and eventually drives a logic circuit. The fans that I have seen use an open drain/open collector output.

One (or more) pulse is generated every time the the fan rotor completes a revolution. The number of pulses counted in one minute is directly proportional to the RPM of the fan. In your fan's case, I think it would be reasonable to guess that there are two pulses generated for each revolution. With the frequency that you have measured, about 1500 RPM sounds right, given that you are running it at 10V (12V nominal) and the typical is 1800-2000 RPM.

If you want a more visual approach, you can make a crude strobe tachometer using just a LED and resistor. Connect a LED (brighter is better) and an appropriate current-limiting resistor between power and the tachometer pin. If you mark one of the fan blades with something easy to see, like a sticker, you should be able to shine the LED on the fan blades and see the sticker illuminated in two places. You can use this technique to count the number of times the tachometer output goes low each rotation, and to approximate the duty cycle of the signal.

\$\endgroup\$
11
  • 7
    \$\begingroup\$ That's a little bit too clever. I'm on to you! ;) \$\endgroup\$
    – tyblu
    Commented Dec 26, 2010 at 8:48
  • 2
    \$\begingroup\$ You can set up a 555 in one-shot mode, and then you can actually get the strobe to be short enough to "freeze" the blades. \$\endgroup\$
    – W5VO
    Commented Dec 26, 2010 at 16:45
  • 6
    \$\begingroup\$ You can use the pulse to fire a gun through the blades without damage. Should you be inclined to do so. \$\endgroup\$
    – markrages
    Commented Mar 5, 2011 at 19:25
  • 5
    \$\begingroup\$ In general, a standard computer fan should send out two pulses per revolution, so as to be consistent with all other fans and motherboards. A fan that doesn't use two pulses per revolution will obviously appear (to the motherboard/monitoring software) to be spinning at a different speed than it actually is. \$\endgroup\$
    – Shamtam
    Commented Jan 4, 2013 at 2:54
  • 2
    \$\begingroup\$ @Faloude On a 3-wire fan, probably not as the hall-effect sensor requires power. For a 4-wire, it may be possible to power the controller without powering the fan. \$\endgroup\$
    – W5VO
    Commented Nov 13, 2018 at 17:46
11
\$\begingroup\$

All the needed infos are published here:

http://www.formfactors.org/developer/specs/REV1_2_Public.pdf v1.2

https://www.glkinst.com/cables/cable_pics/4_Wire_PWM_Spec.pdf v1.3

and here

https://noctua.at/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf v1.3, including example schematics

More specifically,

Voltage 12 ± 1.2V
Peak current (@13.2V) 2A

Tachometer section:
Speed reading: 2 pulses per revolution
Open-collector or open-drain type output
Mobo has pullup

PWM frequency: 21-28 kHz, target 25 kHz
logic low: <=0.8V
Imax: 5 mA
Vmax: 5.25V
PWM duty represents the speed output compared to full speed, linear relationship
If PWM is lower than minimum accepted value for that fan, undetermined behavior according to specs

Fan should match PWM control signal ±10%
Rotor lock and polarity protections are expected
Pins: 1, 2, 3, 4 are black, yellow, green, blue and their function is GND, 12V, sense, control

\$\endgroup\$
4
  • 4
    \$\begingroup\$ Can you please include enough information that your link is only further reading, currently if that link dies most of your answer does also. \$\endgroup\$
    – Kortuk
    Commented Jan 4, 2013 at 1:56
  • 1
    \$\begingroup\$ In case you want to search, possibly for newer edition, the doc name is "4-Wire Pulse Width Modulation (PWM) Controlled Fans", and it's published by Intel. \$\endgroup\$
    – gwideman
    Commented Aug 28, 2014 at 1:06
  • \$\begingroup\$ In short: the pins may be other colors, placed long flat side down on table, ribs up, with holes facing you, wires away. The pins will be far left gnd, inside left V+, inside right tach(or rotor lock, active high (ie, low when spinning) typically used on server fans), far right speed signal input. Regardless of wire color, they should always have this orientation. Tach signal is a path to gnd opened shortly for a given field change over the sensor. ie, NS high z then gnd, SN nothing, NS high z, SN nothing. 2 interrupts to gnd per rotation. Sig is a PWM, constant raising edge, off<10%-95%<full. \$\endgroup\$
    – Tank R.
    Commented Jan 16 at 16:16
  • \$\begingroup\$ Oh, also the tach circuit assumes signal monitoring circuit is pulled up, but does not have to share V+, just gnd. When the fan momentarily interrupts gnd the tach wire is in a high z state (effectively disconnected, ie a wire not connected to anything), thus the circuit between the fan and monitor device sees a drain towards the fans gnd, then a sudden peak to sense voltage and back to a drain. You can put an LED, properly limited, between V+ and tach, then point it at the hub (with a sticker or mark). Youll see a blured image with 2 short cuts in it (gnd z gnd z) Signal Vin can be ~5v to 12v \$\endgroup\$
    – Tank R.
    Commented Jan 16 at 16:27
6
\$\begingroup\$

From fan pulse signal (tachometer) convert to speed by measuring the frequency of the tachometer which 1 full rotation of fan represent 2 pulse signal. Thus, for a minute times with 60 seconds.

Fan speed in RPM:

$$RPM = \frac{freq}{2}*60$$

\$\endgroup\$
4
\$\begingroup\$

In most fans that I've worked with, the yellow wire is referred to as the TACH or tachometer wire. It is similar to PWM output but it is the frequency that is related to rotation of the fan. Sometimes it is 1:1 and one period output on the TACH line is equal to one revolution of the fan; sometimes there are 3 periods on the TACH to 1 revolution of the fan, you need to check the datasheet.

You can connect the TACH signal to an I/O pin on a microprocessor and determine the RPM value of the fan pretty easily.

\$\endgroup\$
4
  • 5
    \$\begingroup\$ That's not PWM (pulse width modulation). \$\endgroup\$
    – starblue
    Commented Dec 26, 2010 at 12:24
  • 4
    \$\begingroup\$ it would be PFM (pulse frequency modulation) \$\endgroup\$
    – Nick T
    Commented Dec 27, 2010 at 18:46
  • 2
    \$\begingroup\$ @NickT I proposed an edit. Let's see if it is accepted. \$\endgroup\$ Commented Sep 4, 2013 at 9:51
  • \$\begingroup\$ Tach is an interrupt to gnd (a momentary high z state) when the field direction through the sensing region of the hall effect and coil control device (the thing with the 4 legs between the motor coils) changes in a specific direction. Assuming N to S, as the ring magnet polarity at the sensor face transitions from N to S it changes the coils and shortly interrupts the tach wire circuit to ground as if the wire wasnt connected to anything. S to N does nothing but change the coil polarity as normal. N to S, again interrupts. With 4 poles of the magnet, NSNS, thats 2 interrupts per rotation. \$\endgroup\$
    – Tank R.
    Commented Jan 16 at 16:36
0
\$\begingroup\$

The fan signal is the rate of rotation, 1 Hz = 1 RPS (rotation/revolution per second.) Connect a PIC or your favourite brand of microcontroller to the signal, count each rising or falling edge in one (or however many you want - more seconds, more accuracy) second and multiply to get RPM. If your processor is fast, you could even measure the period of the waveform and from this determine the speed to a high degree of accuracy (1/t = f).

For most fans the 1 Hz represents one rotation, as it is more expensive to include multiple switches in the fan, but don't rely on this.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Are you sure it 1 Hz = 1 RPS? I'm measuring frequency and I'm getting around 50 Hz when I run the fan at 10 V. It's a 92x92x25 fan and they are usually rated between 1800 and 2200 RPM, so 3000 seems a bit high, especially on 10 V. Also, I just found out on the Internet that max RPM for my fan is 2000, so could it be 1 Hz = 1/2 RPS? \$\endgroup\$
    – AndrejaKo
    Commented Dec 26, 2010 at 2:21
  • \$\begingroup\$ @AndrejaKo, I suppose it could be - how many blades does it have? 4? \$\endgroup\$
    – Thomas O
    Commented Dec 26, 2010 at 2:37
  • \$\begingroup\$ It has 7 blades. \$\endgroup\$
    – AndrejaKo
    Commented Dec 26, 2010 at 2:40
  • \$\begingroup\$ @AndrejaKo, well that's rather odd then, because there's no sane multiple that would get you that speed. \$\endgroup\$
    – Thomas O
    Commented Dec 26, 2010 at 2:52
  • 1
    \$\begingroup\$ How does number of blades affect speed reading? \$\endgroup\$
    – AndrejaKo
    Commented Dec 26, 2010 at 3:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.