Received: from PCH.mit.edu (18.7.21.50) by mail.efplus.com (192.168.0.8) with Microsoft SMTP Server (TLS) id 8.3.485.1; Mon, 10 Aug 2020 13:43:42 -0700 Received: from PCH.MIT.EDU (localhost.localdomain [127.0.0.1]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 07AKYvfr031630; Mon, 10 Aug 2020 16:35:14 -0400 Received: from outgoing-exchange-5.mit.edu (OUTGOING-EXCHANGE-5.MIT.EDU [18.9.28.59]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 07AKYtpB031627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 10 Aug 2020 16:34:56 -0400 Received: from w92exedge4.exchange.mit.edu (W92EXEDGE4.EXCHANGE.MIT.EDU [18.7.73.16]) by outgoing-exchange-5.mit.edu (8.14.7/8.12.4) with ESMTP id 07AKY5Tk016104 for ; Mon, 10 Aug 2020 16:34:38 -0400 Received: from w92expo20.exchange.mit.edu (18.7.74.74) by w92exedge4.exchange.mit.edu (18.7.73.16) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 10 Aug 2020 16:33:32 -0400 Received: from oc11exhyb3.exchange.mit.edu (18.9.1.99) by w92expo20.exchange.mit.edu (18.7.74.74) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Mon, 10 Aug 2020 16:34:24 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.177) by oc11exhyb3.exchange.mit.edu (18.9.1.99) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 10 Aug 2020 16:34:24 -0400 Received: from MW3PR06CA0012.namprd06.prod.outlook.com (2603:10b6:303:2a::17) by SN6PR0102MB3373.prod.exchangelabs.com (2603:10b6:805:3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.21; Mon, 10 Aug 2020 20:34:24 +0000 Received: from CO1NAM03FT026.eop-NAM03.prod.protection.outlook.com (2603:10b6:303:2a:cafe::b6) by MW3PR06CA0012.outlook.office365.com (2603:10b6:303:2a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19 via Frontend Transport; Mon, 10 Aug 2020 20:34:23 +0000 Received: from mail-oi1-f172.google.com (209.85.167.172) by CO1NAM03FT026.mail.protection.outlook.com (10.152.80.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16 via Frontend Transport; Mon, 10 Aug 2020 20:34:23 +0000 Received: by mail-oi1-f172.google.com with SMTP id o21so10117378oie.12 for ; Mon, 10 Aug 2020 13:34:23 -0700 (PDT) From: Richard Prosser To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Mon, 10 Aug 2020 13:34:10 -0700 Subject: Re: [EE] averaging multiple samples to reject AC interference Thread-Topic: [EE] averaging multiple samples to reject AC interference Thread-Index: AdZvVu+gO8kklL8zSU2R+CCDqz4MkA== Message-ID: References: <20200810131708.06a56fd6300ec2bfca6379d4e10ab8d2.bc322fe198.wbe@email27.godaddy.com> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <20200810131708.06a56fd6300ec2bfca6379d4e10ab8d2.bc322fe198.wbe@email27.godaddy.com> Reply-To: Microcontroller discussion list - Public. Accept-Language: en-US X-MS-Exchange-Organization-AuthAs: Anonymous X-MS-Exchange-Organization-AuthSource: TS500.efplus4.local X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-SenderIdResult: Pass X-MS-Exchange-Organization-PRD: mit.edu X-MS-TNEF-Correlator: received-spf: Pass (protection.outlook.com: domain of gmail.com designates 209.85.167.172 as permitted sender) receiver=protection.outlook.com; client-ip=209.85.167.172; helo=mail-oi1-f172.google.com; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=zaabYyMu2hV2aWsZAapTPr4QsEQZpf5k8H9cJuVz9OQ=; b=SkoRJfE/owG3vBjUn/qIMAqZQUXeceiIn1DfBvgu2io+QeLDjX8l0ljQhZs1RtyTN0 9DrsKZuTPduNRb2ZTvcYTtRvCQvD4b0Bw5iuBuVnRm1AvwdkMpOG3Fm8dkh23d35BwHG +LG4bE3BM8amBjYybByVQfaVCGZHus5/y5dS6z2YKDO+etAilXz1wzxFY833jhht3n8f x6bxHCA4wkxKd4W9MB8NWHDgos/RhsAsgpNfV9s4geksh2Ji5SPPqXyG0DLP12MvGb3K TzQCnMfR3HtKKWH0e7fpeNCgOOy8ejil4kVkW5wx3A46do+sPrONJlj6dBHqO+GAHaD0 KU4Q== authentication-results: spf=pass (sender IP is 209.85.167.172) smtp.mailfrom=gmail.com; mit.edu; dkim=pass (signature was verified) header.d=gmail.com; mit.edu; dmarc=pass action=none header.from=gmail.com; errors-to: piclist-bounces@mit.edu list-id: "Microcontroller discussion list - Public." list-post: x-beenthere: piclist@mit.edu x-mailman-version: 2.1.6 x-received: by 2002:a54:4383:: with SMTP id u3mr829136oiv.155.1597091661847; Mon, 10 Aug 2020 13:34:21 -0700 (PDT) x-topics: [EE] x-content-filtered-by: Mailman/MimeDel 2.1.6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 I did something similar a longish time ago - synchronised my sampling with the mains frequency & averaged over a full cycle. I can't remember the details but It worked well. I think I was using a Keithly meter as the adc and it handled the AC triggering side of things. RP On Tue, 11 Aug 2020 at 08:17, Jim wrote: > > > A .1 second worth of samples is 30 samples at a 1/300 sampling period. > > If my calculations are correct, 30 samples, at a 1/300 second sampling > period, that would reduce interference below about 5 Hz, if I am > thinking correctly about the Nyquist theory. > If the interference is low frequency, this method should provide some > degree of reduction. If the interference is higher frequency than that, > there may be little to no reduction. > The best way to find the answer is probably to just write the code to > implement the algorithm, and test it under actual conditions. > > Regards, > > Jim > > > -------- Original Message -------- > > Subject: [EE] averaging multiple samples to reject AC interference > > From: Bob Blick > > Date: Mon, August 10, 2020 2:44 pm > > To: "piclist@mit.edu" > > > > > > I have sensors that feed an instrumentation amplifier running a voltage > gain of 10 before going into the A/D converter of a microcontroller. > > > > There is AC line interference. It is small, but if I can reduce the > effect, that would be good. I'm in the 60 Hertz part of the world, but > ultimately this will be used in both 50Hz and 60Hz locations. Battery > operated, this is not conducted interference or power supply ripple. > Shielding is not possible. I only need to process the signal about 4 or 5 > times per second. The signal is changing, so long-term averaging is bad. > Actually any averaging will result in a tradeoff between response time an= d > accuracy that I will need to evaluate. > > > > These sensors are multiplexed with others and I can't sample > continuously. > > > > If I average multiple samples taken at 1/300 second intervals over a > 1/10 second period, that should give some improvement at 50Hz and 60Hz > without getting too involved, correct? This would fit into my existing > multiplexing constraints. > > > > I seem to recall being in this situation before but forget what I did a= t > the time. > > > > Thanks for any suggestions. > > Bob > > -- > > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .