Tony Pan asked: >I want to use a pic to measure AC line voltage. [...] >How do I calculate the AC voltage from these reads? ...and there followed a discussion of various ways to characterize a time-varying signal, such as peak-to-peak, RMS, average, etc. I just wanted to interject one comment. Several people mentioned using the *average* of the signal, and though I am sure it was obvious to the people who posted, it may not be so obvious to some of those reading the suggestion: the average of a typical (non-DC-offset) AC signal is zero, so of course what was meant was the average of the absolute value of the signal (or the average during a carefully-phased half cycle). If you low-pass (DC) filter a non-rectified AC signal, you'll get a deceptively small value, since the plus swings tend to cancel the minus swings. Indeed, the reason for using RMS is that the square part of it makes everything positive, so you don't get the cancellation effect; in addition, the squaring function is continuous and differentiable everywhere, unlike the absolute value which has a slope singularity at zero (so it is easier to do analytics with RMS than with average-absolute). Oh, and the order of "RMS" is exactly correct: it is the Root of the Mean of the Square. Michael V Thank you for reading my little posting. _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.