Pages: [1]   Go Down
Author Topic: 60Hz on analog i/ps  (Read 700 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Faraday Member
**
Karma: 68
Posts: 2820
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For more accurate readings:
Would it be wise to read an analog I/P multiple times in a 16.5ms period (60hz) and then average them to reduce power influences?
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know what "i/ps" or "I/P" is.

When you are reading a DC voltage (for example an analog temperature sensor) in an environment with mains noise, you get better results by reading during a period (or multiple periods) of the mains 50Hz or 60Hz.

I had a chart of an analog temperature sensor at ThingSpeak.com
But it didn't look nice, too much noise. After sampling to reduce 50Hz noise the chart is now very smooth.

But you also should have good look at the circuit. Avoid high impedance, filter the power supply, avoid long wires.

You could make a loop with analogRead() and a delay. The analogRead() takes a certain time (about 120us), so tuning the delay between the samples is hard.
You could use millis() or micros() and use analogRead() without delay during the period.
Or a background task that uses the average of 1 second.
« Last Edit: August 07, 2013, 04:26:21 am by Erdin » Logged

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2820
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think then, 2 reads on an Analog input every 8.3ms will cancel out the  60Hz portion. (i.e. average of)


* 8-7-2013 1-55-55 PM.png (18.95 KB, 865x445 - viewed 28 times.)
« Last Edit: August 07, 2013, 03:23:52 pm by LarryD » Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Montreal
Offline Offline
Faraday Member
**
Karma: 30
Posts: 2602
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I think then, 2 reads on an Analog input every 8.3ms will cancel out the  60Hz portion. (i.e. average of)
I'd not agree, you would get just opposite results, beating two frequencies may produce slowly changing bias in the data pull. To minimize an influence of the mains, you better to sample as much as you can with NON-multiple to 60 Hz sampling frequency. Averaging interference, statistics math decreases a noise proportionally to sqrt(Nsamples).  For example, taking 100 samples you are reducing interference by factor 10 times, or 20 dB.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 637
Posts: 34609
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I think then, 2 reads on an Analog input every 8.3ms will cancel out the  60Hz portion.
Well only if you can synchronise the analogue read with your 60Hz interference.

However it is much better to get rid of the interference than try and get round it. Basically the lower the impedance of the source the less interference it will pick up.

The ultimate way to remove all 60Hz interference is to move to a country that uses the proper 50Hz.  smiley-twist
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree that sampling during one period is not enough. The mains noise carries all kind of other noise that is not related to 50Hz/60Hz.
At least 10 periods with at least 20 samples per period would be better.

The 50Hz/60Hz is quite accurate (where I live), so using the micros() to sample during 10 periods is possible.

What about a low-pass filter on the analog input. For example a capacitor at the analog input to ground of 1nF ... 100nF. It depends on your circuit, but that could help a lot.
Logged

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2820
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am missing something here.
In my 2nd post I think I have it wrong. The 60Hz would add and subtract the sensor voltage as below.
I think an average of 2 analog readings every 8.3ms would cancel the induction.
I am going to try a test setup with a long run of cable and try to induce 60Hz.
I'll look at the waveform with a scope to see if the image below is accurate, then try the 8.3ms idea to see if there is a cancelation and end up with the correct sensor voltage.

Thanks to all.


* 8-7-2013 1-55-55 PM.png (29.28 KB, 922x444 - viewed 20 times.)
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2820
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I took an extreme case of 1.47Vpp @60Hz superimposed on a 1.64V sensor o/p.
It looks to me like an average of 2 readings delayed by 8330us does indeed filter out 60 cycle induction on high impedance sensor outputs.


* 8-9-2013 10-02-51 AM.jpg (155.8 KB, 714x522 - viewed 21 times.)
« Last Edit: August 09, 2013, 11:01:53 am by LarryD » Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Pages: [1]   Go Up
Jump to: