I have a fan that rotates at 2800 RPM. I need to make sure that the fan is operating. I need to monitor the fan.

It has an output that gives a signal 2 times per rotation so it's 5600 pulses which is 933 pulses per second. So I guess scan time will be a problem. So I can't use normal inputs. The machine is a Siemens S7-226. I have little experience with PLCs, however I have read the manual on the Siemens 27-2xx and it tells me that there is a high speed counter HSC0. With something like 30KHz so I guess this is what I need, right?

Also, do I just need to count up 5600 every minute to know that my fan is working, reset the counter and then count again? It seems very easy... too easy :) What am I missing?

  • \$\begingroup\$ Yep it seems fairly simple, at least logically. Count the number of pulses in a 1 minute window and see how close you are to 5600 \$\endgroup\$
    – krb686
    Mar 25, 2014 at 20:42
  • \$\begingroup\$ You could count for 3 seconds and compare to 280 (or maybe 260). That gives you 10 RPM resolution and maximum 3 second response time. \$\endgroup\$ Mar 25, 2014 at 21:31

1 Answer 1


I would add some head-room. Most likely the fan's speed will vary by a few rpm (or a few hundred rpm if it's not too critical what the actual speed is).

Another potential method is to use an "inverse counting" method for calculating the fan rpm.

If your application can't tolerate the fan being off for a minute before you realize something is wrong, or if you want to be able to distinguish between a fan which oscillates between 10000 rpm for a bit and then off for a bit, you can instead trigger an external "high speed" counter to start/stop whenever you receive a pulse.

The frequency of the fan is then f/count (or f/(2*count) for 2 pulses/revolution), where f is the high speed counter frequency. With a ~1kHz pulse rate this should give you up-to-date information on the actual rpm of the fan every ~1ms as opposed to every second, or worse every minute. You also get much better resolution on the actual frequency.

However, with a 30KHz high speed timer your expected count between pulses is ~30, so this method may not be the best unless you can get a faster high-speed timer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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