Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6294512imm; Mon, 23 Jul 2018 15:17:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRCBlpFJw8TO/WEOeMHWwd7FSOBemuJgtxyWUVmiYhfwptBqZUE3B5OzBg9584zLmO/jSu X-Received: by 2002:a17:902:784d:: with SMTP id e13-v6mr14220783pln.197.1532384252562; Mon, 23 Jul 2018 15:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532384252; cv=none; d=google.com; s=arc-20160816; b=GctoZ6LFlw8sysHoyIDJmoj3wAsjP+/Oa7eYuwSwEG9GmEVhMmBbVp7zsKvVvSdiwG OyhXyplx0jNEwd8knGAwNDPKAcpZtd1DgCD+dqrYgj5n53w3swcoeQ39VaBxRH1XvVOL lFG2pRKbieGS6vuzM1dkJNwsdL0iEBJv8bpwWK9Ywl+be7af5Pv6/IMQZ+t+4zP1jx4A 4ijIcOwxZ3IGeDQkMJIxN7xHH8O9B89gSgCKNsJpZVolOBRs4cL+iKDzTFt7KK1HOIVI KyOueC/a021Gv7MVJHVIlXRu7udoYkw+TctNblVn7PiuFTaeXafPvgwnZKjXw3e+mNcw Pl0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=DrW0AL6xiXNj5GSLncnzrLDl/Q1aHNw16R3yEAim5sc=; b=EajXbzVtuAp8XZPxtcuU/rc0F/6w2xxWVslaDx18vtqma1MHBQTpyWPSjDRJfyfvpk VlzHdbU7nMR7FVjP9tny7/xMDGmzvdZSxy2UCxQYq7Vj1Lo2efawQfjwrYcQiLCzI9PW UxDLRPlNVTDlUr6x/ciEmto/62brEobT6iByY0ovXqG8Vzbw10yrEmV4bXhTvqySXSnA uf6YukMqIuHDj5HRrn8THbnZwLArFosrN4ahxvZJ843mXpiO5VMRsNFzFPzW91QIJnUz joaI68sgXYYjtdLCierCWCxap8JMHBwarak8DbU+2b2Qlkliu8XxkCIajVrq8E8ge7aw le4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@SierraWirelessInc.onmicrosoft.com header.s=selector1-sierrawireless-com header.b=dvLc+zrt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6-v6si6006327plr.33.2018.07.23.15.17.17; Mon, 23 Jul 2018 15:17:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@SierraWirelessInc.onmicrosoft.com header.s=selector1-sierrawireless-com header.b=dvLc+zrt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388199AbeGWXTm (ORCPT + 99 others); Mon, 23 Jul 2018 19:19:42 -0400 Received: from mail-eopbgr720052.outbound.protection.outlook.com ([40.107.72.52]:27136 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388077AbeGWXTm (ORCPT ); Mon, 23 Jul 2018 19:19:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SierraWirelessInc.onmicrosoft.com; s=selector1-sierrawireless-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DrW0AL6xiXNj5GSLncnzrLDl/Q1aHNw16R3yEAim5sc=; b=dvLc+zrtoEJDig5+Dc9B2tC9Rc5ANztRev8M0vLSgjpPLuuaKZr9b/acIKFLSYRxQg5rWMIN4TvpHU5QpRpvdrJw4/RB5y6KiaUO8YsVqmXRq0m8syxHxEqzC2o2/+Fo/IhN+8TTuF/aoj7xzyyT1n0xVvowaIWDhF8fiFRCeeA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=DFrey@sierrawireless.com; Received: from [10.1.70.11] (208.81.120.1) by CY1PR0201MB1435.namprd02.prod.outlook.com (2a01:111:e400:5318::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Mon, 23 Jul 2018 22:16:15 +0000 Subject: Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor To: Himanshu Jha , Daniel Baluta Cc: Linux Kernel Mailing List , linux-iio References: <1532122284-19602-1-git-send-email-himanshujha199640@gmail.com> <20180721161934.75066d97@archlinux> <20180721153607.GA11127@himanshu-Vostro-3559> <20180722222153.GA10066@himanshu-Vostro-3559> From: David Frey Message-ID: Date: Mon, 23 Jul 2018 15:16:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180722222153.GA10066@himanshu-Vostro-3559> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [208.81.120.1] X-ClientProxiedBy: YTXPR0101CA0016.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::29) To CY1PR0201MB1435.namprd02.prod.outlook.com (2a01:111:e400:5318::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6dd490a0-889c-46b1-dbf6-08d5f0e9e88e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:CY1PR0201MB1435; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB1435;3:Pfgfsam+Qgk1hFholwQ5w3AaYi6yV0nFale3YaenEk9rE5TWVvH2Zx0bWKRtqDwS/I7DfgZMQNnGcRk+oJOANdbIp8cCuPHQv0b91J2FrDCMo6i6zOD4jxOamYr73F72PyKmgOdVnaJCejQn62CZI1aJfRRF7dzpw8hSriEv6khPgC9FGWgD/yAeqOnBD6bNIrFcKQRl5KdDqu2D8Dx1LhoCBeVpaY5Zzcf+6Jx2Yc2lpn8hpvFG084WHNddP3cz;25:vdb8PWdS8hp1Zy0jxXjn6zIJ2KJ4IQ3JCpx62+8tZiekYE8BU0joRfaRhdTyQLSBf1JAfL0nusQPksxxHvKtjdsDcoUZ0p6DTQSZweftHW6W/ZjbsS3SFMgBAhuYVUTApoyseDJzHRvz0zrr9xrTBP3aMF2skIACfI7iVdgNONQSklth7C17s+PfpsTTUsVVNavBiPKshnLBeQZTIb7WHHK8DRQkEc/pjHQZ4SuUgn2/Y9NO327ILsgHx94IkIg9Dz67+oRscyHCfnNRkwphLyhIBv3o2jq3pweqHFmbHTngAdUBkAO3pcxvnAr1mIs3OHnrI563ycWVi6RR2mFM6Q==;31:iq7GKuiy3/muVhklBlhzZkhEnh/z2ovuNFL1ZSUlxcA3RWjC9MBrSIJWy4DnStiM4+ulkS/FLNAcmbxwpsrPh4SUFNEIIbgo8tooqyEhiWpLzKoZasozDW5tYHu3YXnIvCgOUgeH0ZUUl4wvdqe6QN7UAnuQ3BJtfi9PJ1p1NXUBXTDDtLLNGW4XLLO4fcvdCGmjgREXZzXIeIyVygIRkkT6X/VrXe5iZA6ZXUpnlvI= X-MS-TrafficTypeDiagnostic: CY1PR0201MB1435: X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB1435;20:Bv3b4O8WzKnPF9nHAqZLVuKJq/tTCqUH2EXlL8a5QHmEQiQ4eiAHxorv8nC8WXPrgLOZoR3AwnnjNd680nUQ+Q7cEQVDfa/8nzCWZawovc12kTIL653CmcuaSBkYW60hBR1/RW+7/ZRD9CeSnA9V3UYFf7v88PKQKtoc8CMDzNpUrqLajckkY/f6LaLblEGBQ6gpaPKE6o0kFkiDC6DHzRAjBKdjekN4mx1qXGaOFp1djCMkZz8IifkFscBXIwGCpEfiGsFM3QcGsnZwqdoLxxK2tZ+oz03VKSpD+WfbwxDjSZuoDmEEFICR60vsO1yXF0Vm4K5UdlOf4vd9bbhHmTXa3GkEtygkZmQQUYvNSU7zH7qCx3Y0kdy3CFUPHCjoCCgoSKLvvytTpHmtyp53DYvQs8nlP4BTUv4tc5/XWIWrQF+rLIYPG5iuXkgY+X2304BF3BYdjVuo4UdCrbpZc1ZjOAXdSsamwmVWQiltgccLlAHqb3LR2uCE+B0aZDiy;4:3Va+5PzhS0R1DE1EjZ9ZMYUxvGCZh+Q15ZYOXk9UiqbYdfX/aGlYkqTkkoQ+QLD1ncxycbxletNIqxt06yBAy2nVHzOSY0L9Pz36A2tFDacE4EiTjJps+NaEJOzMeYTvzC5B5JBePjeYsQ9w4TzEmgiFXM1YvKfH2V/dUgx0cB09KSq8tM9WwBeJJPph5/dJ8yz2M/CKEgreX6t4oDqrEx2dPxnKJ28OYgF8SCwqglP4Mt9SmbIJb5cHs75fnQIcwhqaXKM8Gf3r7Hz8klbwmbfd+8L5aPfEQjsfCPRAMeqs8Ru/3PEK7V2jhH/R9bcxC1CPLKD+4k4+4WRYm98Qfw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:CY1PR0201MB1435;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1435; X-Forefront-PRVS: 0742443479 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(366004)(376002)(136003)(346002)(396003)(39860400002)(199004)(189003)(230700001)(6116002)(3846002)(966005)(72206003)(80792005)(36756003)(53936002)(39060400002)(4326008)(478600001)(97736004)(25786009)(6246003)(31686004)(66066001)(65956001)(65806001)(47776003)(105586002)(106356001)(3260700006)(486006)(476003)(5660300001)(229853002)(6666003)(316002)(2906002)(86362001)(305945005)(68736007)(6486002)(956004)(2616005)(446003)(186003)(11346002)(16526019)(6306002)(77096007)(58126008)(53546011)(386003)(26005)(76176011)(50466002)(67846002)(54906003)(16576012)(52146003)(2486003)(52116002)(81156014)(8936002)(110136005)(8676002)(31696002)(65826007)(64126003)(81166006)(7736002)(93886005)(23676004);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0201MB1435;H:[10.1.70.11];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: sierrawireless.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyMDFNQjE0MzU7MjM6bXJlSFlQS2VVS0RhanlJV2JtRm5WdVoz?= =?utf-8?B?dm1WVktGYXJCNDdqMkV6cEdEdDM0Z3dOd0N0NzQ1Skx4eUEwWWk4VzdFNzRt?= =?utf-8?B?cHRMalpRVzV5NktSRGZDVEVveGFpSEV6NXdHWTA3cjF2M2d0Z3BvRG80aXNk?= =?utf-8?B?QlA1MEttSGZNandhM1Z1MjdaSHYwT2FqWjl4aGJkc0l0U3JIVEkxSGYxNnc2?= =?utf-8?B?Y0gxRDlORjlKZlVGNnFEbHh1YTlSSDA4Z0NPTWR1N1FyWHF2TDU2YVg0M1Zz?= =?utf-8?B?OHZLMER6NnRlcVkrMHdqNXRzVEtBOG9HUUdKcW9vK2loc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TS/fWsbhRCR2PRRUd1zN6wI69eo=;7:qjlQVEzL1xFvyWt9fjsG5tKuuWv/qnunXrxh3btqpx4PKxyb1uJuatiAxgwxEPCXdMm8ZrCy5QCVwgHMcpSL4USKfzdczQJxBCU7ZlbedPoRfRNlSnKNmV27SKshZc9EUtmkq2xz1ZnbwCUIFjDaQNsoRdOGoyVLTaOzRMnSfZZmMy8W3noj0M1ROP1dmebde+ZxGMRuJdjxbtLArCEnxXXsLJuGUlcYydrOgEj5PeJEpdokaBoWagIuvWfBHFvR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sierrawireless.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 22:16:15.5953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6dd490a0-889c-46b1-dbf6-08d5f0e9e88e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 08059a4c-2486-43dd-89e3-3a747e0dcbe8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1435 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/22/2018 3:21 PM, Himanshu Jha wrote: > On Sat, Jul 21, 2018 at 08:45:34PM +0300, Daniel Baluta wrote: >> On Sat, Jul 21, 2018 at 6:43 PM, Andy Shevchenko >> wrote: >>> On Sat, Jul 21, 2018 at 6:36 PM, Himanshu Jha >>> wrote: >>> >>>>>> + /* Look up table 1 for the possible gas range values */ >>>>>> + u32 lookupTable1[16] = {2147483647u, 2147483647u, 2147483647u, >>>>>> + 2147483647u, 2147483647u, 2126008810u, >>>>>> + 2147483647u, 2130303777u, 2147483647u, >>>>>> + 2147483647u, 2143188679u, 2136746228u, >>>>>> + 2147483647u, 2126008810u, 2147483647u, >>>>>> + 2147483647u}; >>> >>> This one needs perhaps a bit of though, but... >>> >>>>>> + /* Look up table 2 for the possible gas range values */ >>>>>> + u32 lookupTable2[16] = {4096000000u, 2048000000u, 1024000000u, >>>>>> + 512000000u, 255744255u, 127110228u, 64000000u, >>>>>> + 32258064u, 16016016u, 8000000u, 4000000u, >>>>>> + 2000000u, 1000000u, 500000u, 250000u, 125000u}; >>> >>> ...this one obviously just a not needed one. You may replace it with a >>> one constant and simple calculation to get either value (index from >>> value, or value from index). >> >> Indeed this can be reduce to: >> >> 125.000 << (15 - idx). >> >> The real question here is if we approximate 255.744.255u to 256.00.00u how >> much different is the result. Being a gas sensor I think it is very >> hard to appreciate. >> >> We can go with this formula + adding a comment with the table with the >> exact coefficients. > > So, I have planned to use this 125000 << (15 - idx) equation with > approximating the array members. > > About the difference in results we would get after approximating isn't > much of a problem IMHO because gas sensor is primarily used for IAQ, and > IAQ is relative to the resistance reading. > > For eg: > > Resistance(ohm) IAQ > value < 30K Very bad > 30k < value < 50k worse > 50k < value < 70k bad > ... > .. > so on.. > > So, what I simply imply is the scale will be adjusted and nothing else > changes, unlike if it had been pressure, temperature, humidity. > > The IAQ implementation is userspace application suggesting > good/bad/ugly air quality. > > And since we know David Frey is planning to use this sensor in his > product mangOH board. > > So, David, how are you planning to use the gas sensing part in your > product ? RGB leds, buzzer, alarm ? > > Thanks Andy for the suggestion :) > My understanding is that the Bosch BSEC (Bosch Sensortec Environmental Cluster - https://www.bosch-sensortec.com/bst/products/all_products/bsec) software calculates the indoor air quality (IAQ) which is presented in the range of 0 to 500. BSEC is proprietary, pre-compiled static library. I don't know how they derive the IAQ, but it seems that it could be based on smoothing outlying gas resistance values and integrating other values such as temperature, humidity and pressure. Unless this driver can somehow produce IAQ values of equal or greater reliability to the BSEC library, then I would prefer that it just present the raw gas resistance value so that a user can write a program to feed the sensor data into BSEC. mangOH isn't really a traditional product. It's an open hardware board designed around Sierra Wireless cellular modules that run Linux. So I don't have any specific use case in mind, but I want to enable our users (and thus future products) to make use of air quality measurements.