If your analog presampling filter isn't good enough, it can let through stuff that sampling will alias down into the passband. If you expect any signal content near 40 Hz, sampling at 80 isn't enough.
So sample at a higher frequency if you can.
Running average is a lot of work. You can simulate a first-order RC lowpass very simply:
Out = Out + (In - Out) / K
which can be done in integer math. The divide-by-K can just be a signed arithmetic right shift. You'd need to use a long enough integer size to encompass your ADC bit length plus room for the shift, plus a bit or two more for luck. Be careful about overflows.
Let's see.. if you sample at, say, 128 Hz and use K = 128 (right-shift
7 bits) you get a 1-second equivalent time constant so it acts like an RC lowpass of omega=1, so the 3 dB freq is 0.16 Hz. Oops, too slow. So shift less, 4 bits maybe. You get the idea.It's late. Where's that damned cat? EE by day, doorman to a cat by night.
John