You can calculate RMS using fast sampling of the rectified unfiltered AC, square each sample and add each to an accumulator, for one second. Then divide the accumulator by the number of samples taken. At the end extract the square root of the result. By arranging for a number of samples that is a power of 2 and by other shortcuts the implementation can be made more efficient. Peter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads