60Hz on analog i/ps

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?

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.

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

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.

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:

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.

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.

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.