Russell McMahon ha scritto: >> I am to use a 24FJxxGA106 to (along other things) measure 220V mains >> voltage with some coarse accuracy, say 1-2% > > What is the intended application. > What you are proposing is vast overkill for some applications and > maybe not good enough for others. Hi Russell, this is a air-pump, pressure monitoring, temperature. Basically I need to be sure that VAC is not lower than 200V (say) or higher than 240 before activating the pumps, the valves, or else. So precision is not *that* important, but still somehow. > A transformer may somewhat modify the waveform. If you have heavy loads > present which modify the voltage from open circuit to on-load then > waveform shape may change depending on whether the load is resistive or > reactive or some mix (or changing). Other factors such as energy return from > rotating machines or electronic supplies MAY make a difference. But > may not, or may not matter. This transformer is very small one, dedicated to this purpose. I hope that returning energy won't disturb... or not even make their way through :) (except for fast peaks / transients maybe) > If you have a reasonable sine wave you could consider peak measuring a > lightly loaded secondary and scaling (by 0.7071 in ideal case). so this is more or less ok (as I was suggested above) > If you use an FFT you'll want to measure integral half cycles if you > want to avoid windowing complexities. yeah, maybe safer, though more costly in terms of cycles. But let's consider that the "timeframe" of the device is 10 seconds or so, so definitelt a looong time. > You could consider a precision ("ideal") rectifier and DC measurement > or just peak measurement with ADC or even measurements at fixed points > along cycle from zero to zero to confirm the sine shape with minimal > calculation. Yeah, I want to avoid more components. > Or ... > > So, knowing intended use may help provide a cheap or low complexity answer. thanks :) -- Ciao, Dario -- Cyberdyne -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist