# AVR ADC can measure rms?

I have worked many years with AVRs and know that its ADC has an internal capacitor that if charged well can measure AC voltages (applying an AC voltage gives a number). But what I don't know is that if this is just a feature made by intrinsic nature of them or they are designed to do that. In other words, how reliable this measurement is as a RMS measurement and if this is applicable, should I cut the input signal to remove the negative part of it (for example by a diode) or the pure peak-peak voltage is applicable?

If you want to use an undocumented feature then that's fine but if you want to be safer you need to calculate RMS based on the input waveform being fully within the upper and lower limits of the ADC.

You also need to take enough samples per second so that your RMS calculation fully takes account of harmonics in the waveform.

Removing part of the waveform is OK provided you are dealing with sinewaves (no harmonics) and you take account of this "planned" distortion.

• "Calculate RMS" means using rms circuits as ICs designed for that? or calculating it on the paper?
– Aug
Commented Sep 18, 2013 at 13:16
• @Aug I would calculate RMS using the code running in the AVR chip. Commented Sep 18, 2013 at 13:19
• OK let check I understood well. you mean to use the micro without additional components and converting the ADC value regarding the waveform ? Sine waves have negative parts but AVRs can not tolerate negative voltages. What do you do with that? using only the positive part of the signal or adding an offset voltage and removing the offset value by code?
– Aug
Commented Sep 18, 2013 at 14:14
• @Aug I would add an offset voltage to put the ADC in the middle of its range. If you do an RMS and an average in code you can calculate what you need. What type of signal are you trying to compute RMS? Commented Sep 18, 2013 at 14:55