W3C home > Mailing lists > Public > public-device-apis-log@w3.org > November 2016

Re: [sensors] Exposing secondary values in the SensorReading

From: Rick Waldron via GitHub <sysbot+gh@w3.org>
Date: Wed, 16 Nov 2016 21:20:24 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-261075536-1479331222-sysbot+gh@w3.org>
> My understanding from looking at the BMP180 (pdf) (which btw 
contains a temp sensor), it that temp is used to calculate true 
pressure (see the algorithm on page 15).

Yes, I've implemented the entire algorithm to support that sensor 
package in J5. The compensated temp and pressure, in C and kPa 
respectively, are exposed via instances of `Thermometer` and 
`Barometer`—there isn't . J5 also provides a novel `Multi` class that 
creates objects that are composed of instances of other sensors, which
 correspond to commercially available sensor packages like the BMP180.
 But that's irrelevant to browser based applications, since they won't
 ever know (or care about) what MEMS sensor is surface mounted to the 
pcb in the laptop or mobile device. Since uncompensated pressure value
 isn't useful (for example, Honeywell requires compensation for its 
uncompensated barometric pressure sensors that do not provide 
compensation themselves), it shouldn't matter to end developers that a
 particular device manufacturer chose to use a temperature compensated
 pressure sensor in their latest handset. 

So what is the point of temperature compensation? Pressure sensors are
 particularly vulnerable to temperature changes: external temperature 
changes the resistive value of the materials inside the sensor itself.
 As temperature increases, so does the resistive value (and 
vice-versa). A constant current circuit is used to counter the effect 
of temperature changes (this is the temperature compensation). Because
 the sensor chips only store values from an ADC reading into a 
register, other registers are used to store the coefficient values 
that will be necessary for an external consumer to compute the 
compensated pressure with the ambient temperature value. The 
compensated pressure value is the only one of the two values that 
matters (vs. uncompensated). 

- A`Barometer` instance object only needs to provide the pressure in 
- It's irrelevant to the end developer, and their program, whether or 
not the MEMS sensor had built in temperature compensation or not—for 
the same reason that we don't expose the byte order, registers or 
coefficients: people want to write applications with this data, not 

GitHub Notification of comment by rwaldron
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/151#issuecomment-261075536 using
 your GitHub account
Received on Wednesday, 16 November 2016 21:20:30 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:53 UTC