Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CPU temperature monitoring

For a programming project I would like to access the temperature readings from my CPU and GPUs. I will be using C#. From various forums I get the impression that there is specific information and developer resources you need in order to access that information for various boards. I have a MSI NF750-G55 board. MSI's website does not have any of the information I am looking for. I tried their tech support and the rep I spoke with stated they do not have any such information. There must be a way to obtain that info.

Any thoughts?

like image 646
Paul Avatar asked May 27 '10 18:05

Paul


People also ask

Does Windows 10 have a CPU temp monitor?

There is no such option to check CPU temperature in Windows 10. You can either check the temperature in BIOS or you can use third-party applications.

How do I check my CPU temp and fan speed?

HWMonitor HWMonitor is a great tool if you'd like to monitor more than just your CPU. HWMonitor displays not only your CPU's temperature, core voltage, operating frequency, and load, but it is also able to monitor your GPU, your fan speeds, your storage devices, and plenty more.


2 Answers

For at least the CPU side of things, you could use WMI.

The namespace\object is root\WMI, MSAcpi_ThermalZoneTemperature

Sample Code:

ManagementObjectSearcher searcher =      new ManagementObjectSearcher("root\\WMI",                                  "SELECT * FROM MSAcpi_ThermalZoneTemperature");  ManagementObjectCollection collection =      searcher.Get();  foreach(ManagementBaseObject tempObject in collection) {     Console.WriteLine(tempObject["CurrentTemperature"].ToString()); } 

That will give you the temperature in a raw format. You have to convert from there:

kelvin = raw / 10;  celsius = (raw / 10) - 273.15;  fahrenheit = ((raw / 10) - 273.15) * 9 / 5 + 32; 
like image 129
Justin Niessner Avatar answered Sep 18 '22 06:09

Justin Niessner


The best way to go for hardware related coding on windows is by using WMI which is a Code Creator tool from Microsoft, the tool will create the code for you based on what you are looking for in hardware related data and what .Net language you want to use.

The supported langauges currently are: C#, Visual Basic, VB Script.

like image 22
Ashraf Sada Avatar answered Sep 20 '22 06:09

Ashraf Sada