Quote Originally Posted by dhouston View Post
With a purely resistive load, you should be able to establish the peak through timing. At 60Hz it will occur 4.17mS after ZC while at 50Hz it will occur 5mS after ZC.

However, this will change with reactive loads because of the voltage/current phase difference. It will also change with non-linear loads which most electronic gear presents. The only way to do this accurately is with many nearly simultaneous samples of current and averaging over time. Digital power meters sample voltage and current several thousand times per second. Your PAUSE 100 means you are only sampling a few times per second and so are unlikely to get the peak.
The problem I am seeing is that sometimes between coming down and back up again sometimes it does not always hit 0 so figuring out exactly when to start and stop I'm losing my mind. I've got darryl taylors averiging routine in my equation but still unless I must get vmax = vmax MAX x were x is my read value and display it no matter when I have choosen to reset vmax I get a tremendous fluctuating value. I'm starting to think perhaps there is something wrong with this sensor or my timing is just so completely out of sync...

The other problem I see as well is coming down the wave I have the same issue between the pic reading and the wave itself between readings it will have gone past the peek completely.

With this said I understand what you mean about taking many readings and as the MAX command proves I do eventually get a peak value my problem is knowing when exactly to reset that peak value and get my next reading. No matter what I try it seems to make my reading flucuate allot. I try to reset it when I hit 0 or after 50 times through the loop.

I do appreciate the help. I am trying so many things it is making me crazy.

David