You can't. This is not away to measure AC current in full scale.Originally Posted by Ruben Pena
In one of my project I had exactly the same problem : measuring AC current using current transformer. First idea was to do ADC sampling from time to time and search for max. value in recent period (to find amplitude for ac signal) and then calculate RMS (0.707*peak). This gave poor results so I used different approach: As mains frequency should be 50Hz+/-1Hz, I used interrupt routine synchronized with zero crossing of current, then trigger another interrupt that waits that you come near the expected peak of current and then start to do ADC searching for max value.
In my case, timings were 19.6ms for start and 20.6 for finishing ADC's (50 Hz mains). Since you got approx 40us resolution, this would capture a peak value with sufficient accuracy. This actually worked pretty good, I was able to calculate RMS and from there power. Problem was that in real application, AC mains were distorted (not pure sinus wave). I tried to introduce correction factor, but couldn't (you should calculate trig function in interrupt, that was impossible task for me and poor 18F).
Solution? Well, I finally used specialized (signal->True rms converter) IC. Not a great solution, but it worked and saved me a great time.
Also, put some bigger resistor so you expand your range from 0-3V to 0-5V or you would get poor resolution.
Bookmarks