* [RFC] iio: ppm: Add IIO_PPM channel type
@ 2015-08-27 6:45 Matt Ranostay
2015-08-27 15:40 ` Lars-Peter Clausen
0 siblings, 1 reply; 11+ messages in thread
From: Matt Ranostay @ 2015-08-27 6:45 UTC (permalink / raw)
To: jic23; +Cc: linux-iio, Matt Ranostay
There are air quality sensors that report data back in parts per million
of VOC (Volatile Organic Compounds) which are usually indexed from CO2
or another common pollutant.
This patchset adds an IIO_PPM type because no other channels types fit
this use case.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
Documentation/ABI/testing/sysfs-bus-iio | 7 +++++++
drivers/iio/industrialio-core.c | 1 +
include/uapi/linux/iio/types.h | 1 +
3 files changed, 9 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 42d360f..79366a3 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -1459,3 +1459,10 @@ Description:
measurements and return the average value as output data. Each
value resulted from <type>[_name]_oversampling_ratio measurements
is considered as one sample for <type>[_name]_sampling_frequency.
+
+What: /sys/bus/iio/devices/iio:deviceX/in_ppm_raw
+KernelVersion: 4.3
+Contact: linux-iio@vger.kernel.org
+Description:
+ Raw (unscaled no offset etc.) parts per million measure reading
+ of data like CO2 or VOC (Volatile Organic Compounds) substances.
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index b3fcc2c..65285c7 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -75,6 +75,7 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_ENERGY] = "energy",
[IIO_DISTANCE] = "distance",
[IIO_VELOCITY] = "velocity",
+ [IIO_PPM] = "ppm",
};
static const char * const iio_modifier_names[] = {
diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
index 2f8b117..7113f9b 100644
--- a/include/uapi/linux/iio/types.h
+++ b/include/uapi/linux/iio/types.h
@@ -35,6 +35,7 @@ enum iio_chan_type {
IIO_ENERGY,
IIO_DISTANCE,
IIO_VELOCITY,
+ IIO_PPM,
};
enum iio_modifier {
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-27 6:45 [RFC] iio: ppm: Add IIO_PPM channel type Matt Ranostay
@ 2015-08-27 15:40 ` Lars-Peter Clausen
2015-08-27 15:58 ` Lars-Peter Clausen
0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-08-27 15:40 UTC (permalink / raw)
To: Matt Ranostay, jic23; +Cc: linux-iio
On 08/27/2015 08:45 AM, Matt Ranostay wrote:
> There are air quality sensors that report data back in parts per million
> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
> or another common pollutant.
>
> This patchset adds an IIO_PPM type because no other channels types fit
> this use case.
Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
scale. The type would be concentration. But that still doesn't tell us what
is actually being measured. Concentration is always something of unit Y per
unit of X. Knowing Y and X is in my opinion important to makes sense of the
data. I'm not sure how to express these though.
Maybe a modifier for what is measured and then define that the rest of the
units cancel out. Like CO2 concentration is CO2 molecules per molecule so
you'd just end up with CO2 for the modiifer and use the scale to define
whether it is %, ‰, ppm, ppb, ppt.
Given that concentration will not be larger than 1 it makes sense to use
something small as the standard unit and then use the scale factor to scale
up or down.
E.g. lets say we make ppm the standard unit, then a scale 1 means ppm,
0.0001 means ppb, 1000 means ‰, 10000 means % and so on.
- Lars
>
> Signed-off-by: Matt Ranostay <mranostay@gmail.com>
> ---
> Documentation/ABI/testing/sysfs-bus-iio | 7 +++++++
> drivers/iio/industrialio-core.c | 1 +
> include/uapi/linux/iio/types.h | 1 +
> 3 files changed, 9 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 42d360f..79366a3 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1459,3 +1459,10 @@ Description:
> measurements and return the average value as output data. Each
> value resulted from <type>[_name]_oversampling_ratio measurements
> is considered as one sample for <type>[_name]_sampling_frequency.
> +
> +What: /sys/bus/iio/devices/iio:deviceX/in_ppm_raw
> +KernelVersion: 4.3
> +Contact: linux-iio@vger.kernel.org
> +Description:
> + Raw (unscaled no offset etc.) parts per million measure reading
> + of data like CO2 or VOC (Volatile Organic Compounds) substances.
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index b3fcc2c..65285c7 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -75,6 +75,7 @@ static const char * const iio_chan_type_name_spec[] = {
> [IIO_ENERGY] = "energy",
> [IIO_DISTANCE] = "distance",
> [IIO_VELOCITY] = "velocity",
> + [IIO_PPM] = "ppm",
> };
>
> static const char * const iio_modifier_names[] = {
> diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
> index 2f8b117..7113f9b 100644
> --- a/include/uapi/linux/iio/types.h
> +++ b/include/uapi/linux/iio/types.h
> @@ -35,6 +35,7 @@ enum iio_chan_type {
> IIO_ENERGY,
> IIO_DISTANCE,
> IIO_VELOCITY,
> + IIO_PPM,
> };
>
> enum iio_modifier {
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-27 15:40 ` Lars-Peter Clausen
@ 2015-08-27 15:58 ` Lars-Peter Clausen
2015-08-27 16:19 ` Jonathan Cameron
2015-08-27 21:40 ` Matt Ranostay
0 siblings, 2 replies; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-08-27 15:58 UTC (permalink / raw)
To: Matt Ranostay, jic23; +Cc: linux-iio
On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>> There are air quality sensors that report data back in parts per million
>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>> or another common pollutant.
>>
>> This patchset adds an IIO_PPM type because no other channels types fit
>> this use case.
>
> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
> scale. The type would be concentration.[...]
Reading a bit more[1], concentration doesn't actually seem to be the right
term in this case, the correct term is mole fraction. Maybe we can use that
as the type. That also makes it clear that the unit is molecules per molecule.
- Lars
[1] https://en.wikipedia.org/wiki/Concentration
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-27 15:58 ` Lars-Peter Clausen
@ 2015-08-27 16:19 ` Jonathan Cameron
2015-08-27 21:40 ` Matt Ranostay
1 sibling, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2015-08-27 16:19 UTC (permalink / raw)
To: Lars-Peter Clausen, Matt Ranostay, jic23; +Cc: linux-iio
On 27 August 2015 16:58:55 BST, Lars-Peter Clausen <lars@metafoo.de> wrote:
>On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>> There are air quality sensors that report data back in parts per
>million
>>> of VOC (Volatile Organic Compounds) which are usually indexed from
>CO2
>>> or another common pollutant.
>>>
>>> This patchset adds an IIO_PPM type because no other channels types
>fit
>>> this use case.
>>
>> Hm, I'm not sure if parts-per-million is a good channel type. It's
>more of a
>> scale. The type would be concentration.[...]
>
>Reading a bit more[1], concentration doesn't actually seem to be the
>right
>term in this case, the correct term is mole fraction. Maybe we can use
>that
>as the type. That also makes it clear that the unit is molecules per
>molecule.
>
>- Lars
>
>[1] https://en.wikipedia.org/wiki/Concentration
Works for me.
I'm tending to prefer base units that don't have an arbitrary scale factor and use the
IIO types to define. Molecules per molecule then use scale would be my
preference.
Agreed on using modifiers for what we are measuring. Guessing there aren't that many sensor types out there. If it gets really silly we can add a means of listing chemicals detected!
J
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-27 15:58 ` Lars-Peter Clausen
2015-08-27 16:19 ` Jonathan Cameron
@ 2015-08-27 21:40 ` Matt Ranostay
2015-08-28 6:34 ` Lars-Peter Clausen
1 sibling, 1 reply; 11+ messages in thread
From: Matt Ranostay @ 2015-08-27 21:40 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio@vger.kernel.org
On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>> There are air quality sensors that report data back in parts per million
>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>> or another common pollutant.
>>>
>>> This patchset adds an IIO_PPM type because no other channels types fit
>>> this use case.
>>
>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>> scale. The type would be concentration.[...]
>
> Reading a bit more[1], concentration doesn't actually seem to be the right
> term in this case, the correct term is mole fraction. Maybe we can use that
> as the type. That also makes it clear that the unit is molecules per molecule.
>
Actually we can't use mole fraction for this because we aren't in a
chemistry lab, and know the other compounds that make up the local
atmosphere. Besides you'd have to include some insane lookup table for
molar mass of carbon or whatever VOC being measured :)
IIO_CONCENTRATION could be useful since you could just change the
scale to make it ppm or ppb or whatever.
> - Lars
>
> [1] https://en.wikipedia.org/wiki/Concentration
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-27 21:40 ` Matt Ranostay
@ 2015-08-28 6:34 ` Lars-Peter Clausen
2015-08-28 9:05 ` Matt Ranostay
0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-08-28 6:34 UTC (permalink / raw)
To: Matt Ranostay; +Cc: Jonathan Cameron, linux-iio@vger.kernel.org
On 08/27/2015 11:40 PM, Matt Ranostay wrote:
> On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>>> There are air quality sensors that report data back in parts per million
>>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>>> or another common pollutant.
>>>>
>>>> This patchset adds an IIO_PPM type because no other channels types fit
>>>> this use case.
>>>
>>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>>> scale. The type would be concentration.[...]
>>
>> Reading a bit more[1], concentration doesn't actually seem to be the right
>> term in this case, the correct term is mole fraction. Maybe we can use that
>> as the type. That also makes it clear that the unit is molecules per molecule.
>>
> Actually we can't use mole fraction for this because we aren't in a
> chemistry lab, and know the other compounds that make up the local
> atmosphere. Besides you'd have to include some insane lookup table for
> molar mass of carbon or whatever VOC being measured :)
I don't think you'd need that. Mole fraction tells you the number of
molecules of something per total number of molecules. You don't need the
mass for this.
But what exactly is the sensor measuring? CO2 (or VOC) molecules per total
number of molecules or number of CO2 molecules in a particular volume?
>
> IIO_CONCENTRATION could be useful since you could just change the
> scale to make it ppm or ppb or whatever.
>
>> - Lars
>>
>> [1] https://en.wikipedia.org/wiki/Concentration
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-28 6:34 ` Lars-Peter Clausen
@ 2015-08-28 9:05 ` Matt Ranostay
2015-08-28 9:16 ` Lars-Peter Clausen
0 siblings, 1 reply; 11+ messages in thread
From: Matt Ranostay @ 2015-08-28 9:05 UTC (permalink / raw)
To: Lars-Peter Clausen, attila, Pantelis Antoniou, Matt Porter
Cc: Jonathan Cameron, linux-iio@vger.kernel.org
On Thu, Aug 27, 2015 at 11:34 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/27/2015 11:40 PM, Matt Ranostay wrote:
>> On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>>>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>>>> There are air quality sensors that report data back in parts per million
>>>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>>>> or another common pollutant.
>>>>>
>>>>> This patchset adds an IIO_PPM type because no other channels types fit
>>>>> this use case.
>>>>
>>>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>>>> scale. The type would be concentration.[...]
>>>
>>> Reading a bit more[1], concentration doesn't actually seem to be the right
>>> term in this case, the correct term is mole fraction. Maybe we can use that
>>> as the type. That also makes it clear that the unit is molecules per molecule.
>>>
>> Actually we can't use mole fraction for this because we aren't in a
>> chemistry lab, and know the other compounds that make up the local
>> atmosphere. Besides you'd have to include some insane lookup table for
>> molar mass of carbon or whatever VOC being measured :)
>
> I don't think you'd need that. Mole fraction tells you the number of
> molecules of something per total number of molecules. You don't need the
> mass for this.
>
> But what exactly is the sensor measuring? CO2 (or VOC) molecules per total
> number of molecules or number of CO2 molecules in a particular volume?
>
CC'ed my Swiss colleague on this because he knows much on the
interworkings of VOC sensors than I could hope to.
So simply these sensors are finding VOCs (which the sensor in question
does CO2 and tVOC indexes.. probably not too independent of each
other)
But molecules are not parts.. think of taking an X volume of air and
figuring what is precent of oxygen is verses nitrogen, argon, etc,
etc. Sure the highest is nitrogen at atomic weight 14.01 with ~78% of
the "air", oxygen is ~20% at the weight of 16.00, and etc.
Think about cutting cube into a millions of pieces and figuring an X%
is Y substance which you can detect, but can't detect X, Y, and Z
(think any particles in 'air' that aren't bonded with carbon). So mole
fractions are impossible here, and you could only take a parts in a
known volume.
Most VOCs (if not all, bit of newbie here) use UV LEDs to ionize
particles, and with some maths calculate the parts-per-million.
>>
>> IIO_CONCENTRATION could be useful since you could just change the
>> scale to make it ppm or ppb or whatever.
>>
>>> - Lars
>>>
>>> [1] https://en.wikipedia.org/wiki/Concentration
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-28 9:05 ` Matt Ranostay
@ 2015-08-28 9:16 ` Lars-Peter Clausen
2015-08-28 16:27 ` Matt Ranostay
0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-08-28 9:16 UTC (permalink / raw)
To: Matt Ranostay, attila, Pantelis Antoniou, Matt Porter
Cc: Jonathan Cameron, linux-iio@vger.kernel.org
On 08/28/2015 11:05 AM, Matt Ranostay wrote:
> On Thu, Aug 27, 2015 at 11:34 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> On 08/27/2015 11:40 PM, Matt Ranostay wrote:
>>> On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>>>>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>>>>> There are air quality sensors that report data back in parts per million
>>>>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>>>>> or another common pollutant.
>>>>>>
>>>>>> This patchset adds an IIO_PPM type because no other channels types fit
>>>>>> this use case.
>>>>>
>>>>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>>>>> scale. The type would be concentration.[...]
>>>>
>>>> Reading a bit more[1], concentration doesn't actually seem to be the right
>>>> term in this case, the correct term is mole fraction. Maybe we can use that
>>>> as the type. That also makes it clear that the unit is molecules per molecule.
>>>>
>>> Actually we can't use mole fraction for this because we aren't in a
>>> chemistry lab, and know the other compounds that make up the local
>>> atmosphere. Besides you'd have to include some insane lookup table for
>>> molar mass of carbon or whatever VOC being measured :)
>>
>> I don't think you'd need that. Mole fraction tells you the number of
>> molecules of something per total number of molecules. You don't need the
>> mass for this.
>>
>> But what exactly is the sensor measuring? CO2 (or VOC) molecules per total
>> number of molecules or number of CO2 molecules in a particular volume?
>>
> CC'ed my Swiss colleague on this because he knows much on the
> interworkings of VOC sensors than I could hope to.
> So simply these sensors are finding VOCs (which the sensor in question
> does CO2 and tVOC indexes.. probably not too independent of each
> other)
>
> But molecules are not parts.. think of taking an X volume of air and
> figuring what is precent of oxygen is verses nitrogen, argon, etc,
> etc. Sure the highest is nitrogen at atomic weight 14.01 with ~78% of
> the "air", oxygen is ~20% at the weight of 16.00, and etc.
>
> Think about cutting cube into a millions of pieces and figuring an X%
> is Y substance which you can detect, but can't detect X, Y, and Z
> (think any particles in 'air' that aren't bonded with carbon). So mole
> fractions are impossible here, and you could only take a parts in a
> known volume.
>
> Most VOCs (if not all, bit of newbie here) use UV LEDs to ionize
> particles, and with some maths calculate the parts-per-million.
But what per what? PPM is a completely ambiguous unit if you don't specify
parts of what per million of what.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-28 9:16 ` Lars-Peter Clausen
@ 2015-08-28 16:27 ` Matt Ranostay
2015-08-31 8:06 ` Lars-Peter Clausen
0 siblings, 1 reply; 11+ messages in thread
From: Matt Ranostay @ 2015-08-28 16:27 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio@vger.kernel.org
Ah true but we could add a few IIO_MOD* modifiers for CO2, tVOC, VOC,
etc, etc. I think Jonathan was suggesting that.
Thanks,
Matt
On Fri, Aug 28, 2015 at 2:16 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/28/2015 11:05 AM, Matt Ranostay wrote:
>> On Thu, Aug 27, 2015 at 11:34 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>> On 08/27/2015 11:40 PM, Matt Ranostay wrote:
>>>> On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>>> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>>>>>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>>>>>> There are air quality sensors that report data back in parts per million
>>>>>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>>>>>> or another common pollutant.
>>>>>>>
>>>>>>> This patchset adds an IIO_PPM type because no other channels types fit
>>>>>>> this use case.
>>>>>>
>>>>>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>>>>>> scale. The type would be concentration.[...]
>>>>>
>>>>> Reading a bit more[1], concentration doesn't actually seem to be the right
>>>>> term in this case, the correct term is mole fraction. Maybe we can use that
>>>>> as the type. That also makes it clear that the unit is molecules per molecule.
>>>>>
>>>> Actually we can't use mole fraction for this because we aren't in a
>>>> chemistry lab, and know the other compounds that make up the local
>>>> atmosphere. Besides you'd have to include some insane lookup table for
>>>> molar mass of carbon or whatever VOC being measured :)
>>>
>>> I don't think you'd need that. Mole fraction tells you the number of
>>> molecules of something per total number of molecules. You don't need the
>>> mass for this.
>>>
>>> But what exactly is the sensor measuring? CO2 (or VOC) molecules per total
>>> number of molecules or number of CO2 molecules in a particular volume?
>>>
>> CC'ed my Swiss colleague on this because he knows much on the
>> interworkings of VOC sensors than I could hope to.
>> So simply these sensors are finding VOCs (which the sensor in question
>> does CO2 and tVOC indexes.. probably not too independent of each
>> other)
>>
>> But molecules are not parts.. think of taking an X volume of air and
>> figuring what is precent of oxygen is verses nitrogen, argon, etc,
>> etc. Sure the highest is nitrogen at atomic weight 14.01 with ~78% of
>> the "air", oxygen is ~20% at the weight of 16.00, and etc.
>>
>> Think about cutting cube into a millions of pieces and figuring an X%
>> is Y substance which you can detect, but can't detect X, Y, and Z
>> (think any particles in 'air' that aren't bonded with carbon). So mole
>> fractions are impossible here, and you could only take a parts in a
>> known volume.
>>
>> Most VOCs (if not all, bit of newbie here) use UV LEDs to ionize
>> particles, and with some maths calculate the parts-per-million.
>
> But what per what? PPM is a completely ambiguous unit if you don't specify
> parts of what per million of what.
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-28 16:27 ` Matt Ranostay
@ 2015-08-31 8:06 ` Lars-Peter Clausen
2015-09-04 7:30 ` Matt Ranostay
0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-08-31 8:06 UTC (permalink / raw)
To: Matt Ranostay; +Cc: Jonathan Cameron, linux-iio@vger.kernel.org
On 08/28/2015 06:27 PM, Matt Ranostay wrote:
> Ah true but we could add a few IIO_MOD* modifiers for CO2, tVOC, VOC,
> etc, etc. I think Jonathan was suggesting that.
What I meant was CO2 measured in what unit per what unit.
Like is it weight per volume or volume per volume or weight per weight or
molecules per volume ...
- Lars
>
> Thanks,
>
> Matt
>
> On Fri, Aug 28, 2015 at 2:16 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> On 08/28/2015 11:05 AM, Matt Ranostay wrote:
>>> On Thu, Aug 27, 2015 at 11:34 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>> On 08/27/2015 11:40 PM, Matt Ranostay wrote:
>>>>> On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>>>> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>>>>>>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>>>>>>> There are air quality sensors that report data back in parts per million
>>>>>>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>>>>>>> or another common pollutant.
>>>>>>>>
>>>>>>>> This patchset adds an IIO_PPM type because no other channels types fit
>>>>>>>> this use case.
>>>>>>>
>>>>>>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>>>>>>> scale. The type would be concentration.[...]
>>>>>>
>>>>>> Reading a bit more[1], concentration doesn't actually seem to be the right
>>>>>> term in this case, the correct term is mole fraction. Maybe we can use that
>>>>>> as the type. That also makes it clear that the unit is molecules per molecule.
>>>>>>
>>>>> Actually we can't use mole fraction for this because we aren't in a
>>>>> chemistry lab, and know the other compounds that make up the local
>>>>> atmosphere. Besides you'd have to include some insane lookup table for
>>>>> molar mass of carbon or whatever VOC being measured :)
>>>>
>>>> I don't think you'd need that. Mole fraction tells you the number of
>>>> molecules of something per total number of molecules. You don't need the
>>>> mass for this.
>>>>
>>>> But what exactly is the sensor measuring? CO2 (or VOC) molecules per total
>>>> number of molecules or number of CO2 molecules in a particular volume?
>>>>
>>> CC'ed my Swiss colleague on this because he knows much on the
>>> interworkings of VOC sensors than I could hope to.
>>> So simply these sensors are finding VOCs (which the sensor in question
>>> does CO2 and tVOC indexes.. probably not too independent of each
>>> other)
>>>
>>> But molecules are not parts.. think of taking an X volume of air and
>>> figuring what is precent of oxygen is verses nitrogen, argon, etc,
>>> etc. Sure the highest is nitrogen at atomic weight 14.01 with ~78% of
>>> the "air", oxygen is ~20% at the weight of 16.00, and etc.
>>>
>>> Think about cutting cube into a millions of pieces and figuring an X%
>>> is Y substance which you can detect, but can't detect X, Y, and Z
>>> (think any particles in 'air' that aren't bonded with carbon). So mole
>>> fractions are impossible here, and you could only take a parts in a
>>> known volume.
>>>
>>> Most VOCs (if not all, bit of newbie here) use UV LEDs to ionize
>>> particles, and with some maths calculate the parts-per-million.
>>
>> But what per what? PPM is a completely ambiguous unit if you don't specify
>> parts of what per million of what.
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] iio: ppm: Add IIO_PPM channel type
2015-08-31 8:06 ` Lars-Peter Clausen
@ 2015-09-04 7:30 ` Matt Ranostay
0 siblings, 0 replies; 11+ messages in thread
From: Matt Ranostay @ 2015-09-04 7:30 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio@vger.kernel.org
Ok that is pretty sane. I'll submit my full patchset for the driver marked RFC to see if my use of types and modifiers makes sense. Well once I get the module off the slow boat from Taiwan and test it
Sent from my iPhone
> On Aug 31, 2015, at 01:06, Lars-Peter Clausen <lars@metafoo.de> wrote:
>
>> On 08/28/2015 06:27 PM, Matt Ranostay wrote:
>> Ah true but we could add a few IIO_MOD* modifiers for CO2, tVOC, VOC,
>> etc, etc. I think Jonathan was suggesting that.
>
> What I meant was CO2 measured in what unit per what unit.
>
> Like is it weight per volume or volume per volume or weight per weight or
> molecules per volume ...
>
> - Lars
>
>>
>> Thanks,
>>
>> Matt
>>
>>> On Fri, Aug 28, 2015 at 2:16 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>> On 08/28/2015 11:05 AM, Matt Ranostay wrote:
>>>>> On Thu, Aug 27, 2015 at 11:34 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>>>> On 08/27/2015 11:40 PM, Matt Ranostay wrote:
>>>>>>> On Thu, Aug 27, 2015 at 8:58 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>>>>>>> On 08/27/2015 05:40 PM, Lars-Peter Clausen wrote:
>>>>>>>>> On 08/27/2015 08:45 AM, Matt Ranostay wrote:
>>>>>>>>> There are air quality sensors that report data back in parts per million
>>>>>>>>> of VOC (Volatile Organic Compounds) which are usually indexed from CO2
>>>>>>>>> or another common pollutant.
>>>>>>>>>
>>>>>>>>> This patchset adds an IIO_PPM type because no other channels types fit
>>>>>>>>> this use case.
>>>>>>>>
>>>>>>>> Hm, I'm not sure if parts-per-million is a good channel type. It's more of a
>>>>>>>> scale. The type would be concentration.[...]
>>>>>>>
>>>>>>> Reading a bit more[1], concentration doesn't actually seem to be the right
>>>>>>> term in this case, the correct term is mole fraction. Maybe we can use that
>>>>>>> as the type. That also makes it clear that the unit is molecules per molecule.
>>>>>> Actually we can't use mole fraction for this because we aren't in a
>>>>>> chemistry lab, and know the other compounds that make up the local
>>>>>> atmosphere. Besides you'd have to include some insane lookup table for
>>>>>> molar mass of carbon or whatever VOC being measured :)
>>>>>
>>>>> I don't think you'd need that. Mole fraction tells you the number of
>>>>> molecules of something per total number of molecules. You don't need the
>>>>> mass for this.
>>>>>
>>>>> But what exactly is the sensor measuring? CO2 (or VOC) molecules per total
>>>>> number of molecules or number of CO2 molecules in a particular volume?
>>>> CC'ed my Swiss colleague on this because he knows much on the
>>>> interworkings of VOC sensors than I could hope to.
>>>> So simply these sensors are finding VOCs (which the sensor in question
>>>> does CO2 and tVOC indexes.. probably not too independent of each
>>>> other)
>>>>
>>>> But molecules are not parts.. think of taking an X volume of air and
>>>> figuring what is precent of oxygen is verses nitrogen, argon, etc,
>>>> etc. Sure the highest is nitrogen at atomic weight 14.01 with ~78% of
>>>> the "air", oxygen is ~20% at the weight of 16.00, and etc.
>>>>
>>>> Think about cutting cube into a millions of pieces and figuring an X%
>>>> is Y substance which you can detect, but can't detect X, Y, and Z
>>>> (think any particles in 'air' that aren't bonded with carbon). So mole
>>>> fractions are impossible here, and you could only take a parts in a
>>>> known volume.
>>>>
>>>> Most VOCs (if not all, bit of newbie here) use UV LEDs to ionize
>>>> particles, and with some maths calculate the parts-per-million.
>>>
>>> But what per what? PPM is a completely ambiguous unit if you don't specify
>>> parts of what per million of what.
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-09-04 7:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-27 6:45 [RFC] iio: ppm: Add IIO_PPM channel type Matt Ranostay
2015-08-27 15:40 ` Lars-Peter Clausen
2015-08-27 15:58 ` Lars-Peter Clausen
2015-08-27 16:19 ` Jonathan Cameron
2015-08-27 21:40 ` Matt Ranostay
2015-08-28 6:34 ` Lars-Peter Clausen
2015-08-28 9:05 ` Matt Ranostay
2015-08-28 9:16 ` Lars-Peter Clausen
2015-08-28 16:27 ` Matt Ranostay
2015-08-31 8:06 ` Lars-Peter Clausen
2015-09-04 7:30 ` Matt Ranostay
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.