none
Get temperature of CPU.

    Question

  • I want to get temperature  of CPU or dependes property (fan speed , fan status ,…).

    When I execute query in WMI , the result of "ManagementObjectSearcher" dose not have any ManagementObject item.

    I have checked some hardware classes in WMI such as "Win32_Fan" , "Win32_Refrigeration" , "Win32_TemperatureProbe" ; but They do not return their property by code.

    I wrote those codes in C#.net 2005.

    Have you ever seen this problem?

    Monday, August 06, 2007 11:37 AM

Answers

  •  

    You would only have access to this information if the system you were running on exposed the information to Windows.  Unless you are running a gaming rig or a server you probably don't have that information.  Only systems with cooling systems by third-party vendors probably even remotely this stuff.  The standard fan attached to your case or to the CPU won't.  Nor will there be any temperature probe in a standard case to report temperature information.

     

    Michael Taylor - 8/6/07

    http://p3net.mvps.org

     

    Monday, August 06, 2007 12:22 PM
    Moderator
  • First, download and install the WMI Code Creator utility so you can play with WMI queries.  I found a CPU temperature reading in the root\WMI namespace, MSAcpi_ThermalZone Temperature class.  Current Temperature is the CPU temp in 0.1 degrees Kelvin.  Convert to Celcius by subtracting 2732 and dividing the result by 10.
    Monday, August 06, 2007 1:04 PM
    Moderator

All replies

  •  

    You would only have access to this information if the system you were running on exposed the information to Windows.  Unless you are running a gaming rig or a server you probably don't have that information.  Only systems with cooling systems by third-party vendors probably even remotely this stuff.  The standard fan attached to your case or to the CPU won't.  Nor will there be any temperature probe in a standard case to report temperature information.

     

    Michael Taylor - 8/6/07

    http://p3net.mvps.org

     

    Monday, August 06, 2007 12:22 PM
    Moderator
  • First, download and install the WMI Code Creator utility so you can play with WMI queries.  I found a CPU temperature reading in the root\WMI namespace, MSAcpi_ThermalZone Temperature class.  Current Temperature is the CPU temp in 0.1 degrees Kelvin.  Convert to Celcius by subtracting 2732 and dividing the result by 10.
    Monday, August 06, 2007 1:04 PM
    Moderator
  •  It is impossible to only use C# to get CPU temperature. You must implement Monitor chip driver by C language. If mother-board manufacturers implement WMI in their drivers, you can get CPU temperature from WMI. So far as I know; no mother-board manufacturers implement WMI, so WMI always returns the same value.
    First, you need know what monitor chip on your mother-board. You may look your mother-board. If you see LM75, LM78, Winbond ...etc trademark on your chip, download the datasheet of your chip according to your number of chip. The datasheet will show you how to access the chip.
     This web site contains some source code about CPU temperature. The author implemented monitor chip driver of W83697HF and W83627EHF which have Hardware Monitor function.
     http://temperature.myweb.hinet.net/index_en.htm The source code maybe help you.
    Friday, August 15, 2008 3:19 PM
  • Are you high or is there something you didn't explain? Converting K to C is just -273.

     

    YES I KNOW THIS IS FROM THREE YEARS AGO.

    Tuesday, February 15, 2011 4:19 PM
  • Well, if you're going to comment on a 3 year old post, at least be careful! The value from WMI is an integer value equal to 10 times the temperature in whole degrees K (i.e. it reads in 0.1K increments), hence the need to divide by 10.

     


    -cd Mark the best replies as answers!
    Wednesday, February 16, 2011 7:16 AM
    Moderator
  • How accurate is this information?  Is it actually CPU temp?

    I'm running Core Temp 0.99.8 it's supposedly giving a Core Tempature of 23C (for each core).

    When I run the WMI it reads as 40.05 C or 3132.

    • Edited by reaplo Monday, March 07, 2011 8:36 PM too mean
    Monday, March 07, 2011 8:33 PM
  • How accurate is this information?  Is it actually CPU temp?

    I'm running Core Temp 0.99.8 it's supposedly giving a Core Tempature of 23C (for each core).

    When I run the WMI it reads as 40.05 C or 3132.


    I think WMI is giving you the more accurate temp reading, because 23°C is way too low. 40.05°C sounds more realistic. You have to think; 23°C is a little short of room-temperature and your CPU is supposed to generate heat.

    ... maybe your system is super-water-cooled? :P jokes

    Thursday, October 06, 2011 7:51 AM