> I like Mr Doug's Idea as its the cheapest and would save quite some space > required by the transformer. I like it too as long as the PIC does not need to be isolated from the AC line. > I could just rectify the AC Voltage and then > use a > resistive divider to scale the voltage down to say 3 volts. But i'll have to > add a > couple of Mica Capacitors of say 0.47mfd/300 Volts to flatten out the DC. > And after > the Voltage Divider, I might also put up a small LC network based Low Pass > Filter. I don't see any need for LC. RC should be fine unless you're right on the edge of the tradeoff between ripple rejection and response time. > And finally, a Kamikaze Zener Diode of say 5.2 Volts to Commit Suicide and > Protect > the PIC if one of the Divider resistors is to fail. > > So, the voltage I'll be getting will be the peak voltage. How do I get the > RMS Voltage ? For a sinusoid, RMS = peak / SQRT(2). If the waveshape is not known, then you have to take lots of samples, square them, average them, and take the square root of the average. RMS = "root mean square". Please fix your reply address. The default reply goes to you instead of the list. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.