From 5819051eee071d622e5cb1f32c74112b1c7b1072 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Wed, 29 Dec 2010 17:02:02 +0100 Subject: [PATCH] support humidity sensor type Change-Id: I4156842677e91de0f922284d196147ff61e71a70 --- api/current.xml | 11 ++++ core/java/android/hardware/Sensor.java | 7 +++ core/java/android/hardware/SensorEvent.java | 60 ++++++++++++++++++++- 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/api/current.xml b/api/current.xml index c43075bd5a410..1591baba44d37 100644 --- a/api/current.xml +++ b/api/current.xml @@ -77615,6 +77615,17 @@ visibility="public" > + + - * + * + *

{@link android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY + * Sensor.TYPE_RELATIVE_HUMIDITY}:

+ * + *

+ * When relative ambient air humidity and ambient temperature are + * measured, the dew point and absolute humidity can be calculated. + *

+ * Dew Point + *

+ * The dew point is the temperature to which a given parcel of air must be + * cooled, at constant barometric pressure, for water vapor to condense + * into water. + *

+ *
+     *                    ln(RH/100%) + m·t/(Tn+t)
+     * td(t,RH) = Tn · ------------------------------
+     *                 m - [ln(RH/100%) + m·t/(Tn+t)]
+     * 
+ *
+ *
td
dew point temperature in °C
+ *
t
actual temperature in °C
+ *
RH
actual relative humidity in %
+ *
m
17.62
+ *
Tn
243.12 °C
+ *
+ *

for example:

+ *
+     * h = Math.log(rh / 100.0) + (17.62 * t) / (243.12 + t);
+     * td = 243.12 * h / (17.62 - h);
+     * 
+ * Absolute Humidity + *

+ * The absolute humidity is the mass of water vapor in a particular volume + * of dry air. The unit is g/m3. + *

+ *
+     *                    RH/100%·A·exp(m·t/(Tn+t))
+     * dv(t,RH) = 216.7 · -------------------------
+     *                           273.15 + t
+     * 
+ *
+ *
dv
absolute humidity in g/m3
+ *
t
actual temperature in °C
+ *
RH
actual relative humidity in %
+ *
m
17.62
+ *
Tn
243.12 °C
+ *
A
6.112 hPa
+ *
+ *

for example:

+ *
+     * dv = 216.7 *
+     * (rh / 100.0 * 6.112 * Math.exp(17.62 * t / (243.12 + t)) / (273.15 + t));
+     * 
+ * * @see SensorEvent * @see GeomagneticField */