I wanted to write a program in c++ where the program actually calculates the cpu fan speed and the program displays the information to the user. I researched online about using speedfan software etc etc but i wanted to try writing my own program so that i can challenge my skills. I have a feeling that i need to add some sort of hardware which can read the rotational speed of the fan but i was wondering that is there any algorithm between cpu fan speed and any other process inside the computer like cpu temperature.May be then i wont be required to use any external hardware. Thanks
Asked
Active
Viewed 974 times
0
-
Sounds like you'll need to use some OS-specific API. – The Paramagnetic Croissant Aug 12 '14 at 19:11
-
This definitely isn't easy. You'll be needing the impractical use of `rdtsc` – Adam Aug 12 '14 at 19:13
-
possible duplicate of [How can I control my PC's fan speed using C++ in Vista?](http://stackoverflow.com/questions/786984/how-can-i-control-my-pcs-fan-speed-using-c-in-vista) – The Paramagnetic Croissant Aug 12 '14 at 19:14
-
1Getting the fan speed is OS-dependent and could even be hardware-dependent. Furthermore, the CPU fan speed is given to you as is, and no further calculations are required except for perhaps some scaling; you can't actualy count the number of rotations and divide it by time. The relation between temperature and fan speed is usually completely hardware-dependent (software will only set '50% of maximum power', so not even 50% of maximum RPM). So, stick to SpeedFan or HWiNFO or equivalent; they may even provide an API for fun stuff. – Sanchises Aug 12 '14 at 19:28
-
@ paramagnetic croissant:- i have this feeling that may be creating some sort of speed sensors can actually make my work easier and then may be i can integrate the sensors to my software. This can give me precise and accurate reading. Whats your take on that – Aug 12 '14 at 19:28
1 Answers
0
You can try to use built-in cpu-fan sensors to get speed, if any. Actually, i see no way to precise calculate fan speed from another parameter (such a temperature or anything else), only do some kind of prediction (e.g., if temperature rise extremely high, than more likely, that fan will rotate at max speed and so on).

ars
- 707
- 4
- 14
-
:- i have this feeling that may be creating some sort of speed sensors can actually make my work easier and then may be i can integrate the sensors to my software. This can give me precise and accurate reading. Whats your take on that? – Aug 12 '14 at 19:25
-
If your fan has no any sensor, than maybe you can do it. For example, if you get a laser (light source) and some kind of light-sensor (receiver), you can put the laser ray through the rotating fan, and by count impulses on light receiver you can realize, how often fan blades interrupt laser ray. And from this you can calculate fan speed, with some tolerance. – ars Aug 12 '14 at 19:34
-
:- Thats actually a pretty gud idea. I really appreciate it. Its always fun to create something rather than using the same old conventional way. Even if it fails, we always learn something. I will actually implement your idea asap. Thanks – Aug 12 '14 at 19:51
-