PDA

View Full Version : Best way to convert peak voltage to RMS?



HankMcSpank
- 1st June 2012, 16:04
At the moment, I have a PIC monitor peak voltage of an AC sine wave-esque signal which varies in frequency up to 1.5khz max (basicallly just sampling an AtoD pin very regularly...if it's greater than the last sample, store it, if it's not greater, then decrement the running stored total by one - kind of like a psuedo capacitor discharging).

It works, but I'd really rather track RMS voltage ...which is just peak voltage multiplied by .707 .....now bearing in mind it'll have to do this calculation in between all AtoD samples, I'm wondering what the best approach would be .....I'd rather keep this is inside a PIC (vs using didoes, resistors & caps externally into an AtoD pin).

top tips warmly received.

Darrel Taylor
- 1st June 2012, 17:18
The RMS value is only .707 of peak if the waveform is a perfect sine.
With a guitar input, that is not the case.

Converting to RMS using just an analog input and software takes many many samples per cycle and lots of math.
It's much easier to use an external RMS to DC convertor like the LTC1966.

The LTC1966 comes in a TSSOP package, so it's really small.

HankMcSpank
- 1st June 2012, 19:32
Hi Darrel,

this is for an AGC for a guitar sustainer circuit (a sustained/infinite guitar note is pretty much a perfect sine - because it's only the initial pluck that's full of harmonics & they drop out quickly), but I take your point about about the cycles & maths involved...