6

I've seen numerous questions/answers showing how to get temperature information from an Android device - using this approach:

int zoneNumber = 0; // Usually 0 or 1
String temperatureFileLocation = "sys/devices/virtual/thermal/thermal_zone" + zoneNumber + "/temp";
File temperatureFile = new File(temperatureFileLocation);
scanner = new Scanner(temperatureFile);
double temperatureC = scanner.nextFloat(); // Degrees C
...
scanner.close(); // finally

I wasn't really sure what each zone is for (i.e., in which part of the device the sensor is located) but I just discovered that there is also a file that describes the type of each zone - for example:

String zoneTypeFileLocation = "sys/devices/virtual/thermal/thermal_zone" + zoneNumber + "/type"; // NB - that's "/type" not "/temp" !

Now, when using Scanner to read in what type each zone is, I get values back such as this:

mtktswmt 
mtktscpu
mtktspmic
mtktspa
mtktsabb
mtktsbattery
tsen_max
sec-fuelguage

Can anyone explain what locations/components all these zone names are actually referring to?

(Ideally, I would like to obtain the temperature of the device's NFC hardware.)

ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253

1 Answers1

10

I guess that's the Hardware thermal sensors of the mobile. They usually give the temperature of the given zones when the mobile is working or even when you perform some benchmarks results. like

  1. mtktswmt is Wifi Chip temperature zone.
  2. mtktscpu is cpu temperature zone.
  3. mtktspmic is Multi IO and Regulator Chip temperature zone.
  4. mtktspa is Thermal sensor MD1
  5. mtktsabb is processor temperature zone.
  6. mtktsbattery is the battery temperature zone.
  7. tsen_max is the maximum temperature sensor capacity(I dont know for sure).
  8. sec-fuelguage is the fuel gauge chip.

the mtkt prefix is just the name of the maker. In this case it is Mediatek

That's pretty hardcore hardware stuff. These are actually used by the makers of the android mobile phone(I guess). Even the above mentioned data is searched from google android open source project where the values were found in kernal drivers. Hence it's pretty hardcore hardware to play with it.

For using the Hardware Properties that actually gives you your desired results try HardwarePropertiesManager.

I hope it Helps.

Sahil
  • 1,399
  • 9
  • 11
  • Great answer - thank you. As mentioned, I'm trying to obtain the temperature of the NFC hardware - or the closest thing to it. For this, would you use `HardwarePropertiesManager.DEVICE_TEMPERATURE_CPU` or `HardwarePropertiesManager.DEVICE_TEMPERATURE_BATTERY` - or one of the **mtkts** readings? – ban-geoengineering Sep 01 '17 at 11:43
  • 1
    I guess you can go for CPU temperature for NFC as with battery it tends to increase while charging. If you want to know the NFC temperature visit this question. Pretty hardware again. https://stackoverflow.com/questions/28944342/nfc-temperature-logger-commands and if you are satisfied don't forget to mark it as correct for others. Thanks – Sahil Sep 01 '17 at 11:57
  • Do mark it as correct for others @ban-geoengineering and upvote thanks! – Sahil Sep 02 '17 at 15:32