views:

2319

answers:

5

My question is very similar to this one: iPhone Proximity Sensor. There's clearly some manner of thermometer within the iPhone that's readable by the OS. Has anyone uncovered the super-secret undocumented APIs to read this sensor?

+3  A: 

I doubt this sensor is for ambient temperature - rather I suspect it is for overheating of the circuits. If that is all you want then great, but again, I think it would be useless for ambient temperature.

just my opinion.

Tim
I agree. And I sure wouldn't control my air conditioner with this sensor's output. But because the iPhone is just a mere phone with low power passively cooled electronics, its thermometer should report a temperature close to ambient. Throw in an averaged offset and you've got a temperature reading that's *good enough*.
Kevin L.
+2  A: 

All i could find was CTGetTemperature in CoreTelephony of all places.

valexa
+1  A: 

I don't know about previous models, but my iPhone4 goes from cool-ish to very warm in a matter of minutes depending on the various radio usages. So unless "good enough" = "within 20 degrees F or so", then probably not good for ambient measurement.

Unless (maybe you meant this) you could also track radio usage and subtract a temperature variable depending on radio usages. phew. complicated. Easier to just query NWS.

joe johnson
+1  A: 

Hello,

Any new developments? I have been looking for ways to turn an iPhone/iPod into an ambiënt thermometer for a while. It can be done using extra hardware. A bit like the nike-sensor. but it would be great if it could be done just using software and sensors inside the phone. It would be a great feature to make a lot of apps more intereactive. Only look at the massive amount of weather related apps. To get an accurate reading from the battery-sensor you probably have to match it with processor activity or a little memory (measurement based at lowest battery activity in the past hour e.g.)

Warm regards,

Arno

Arno
+1  A: 

Same discussion: http://stackoverflow.com/q/3744571/444452

flutewang