Measuring AC current is not as easy as it seems. I assume that the voltage is something above 60V.
Although the voltage waveform of your AC might be a sine wave, the current waveform seldom is. Unless your load is purely resistive, you cannot measure current by taking a percentage of the peak value output of a current transformer or Hall-effect device. If you are measuring "mains" voltage, then measuring the current by sensing voltage drop across a resistor is probably not an option. A Hall-effect device is usually the best option.
So, you will probably need to measure RMS current.
In order to get decent accuracy, you will have to sample the current waveform at least 10 times in each half-cycle, multiply each sample value by itself (square it), then average the samples by adding the squares together over a period (at least one cycle) and dividing by the number of samples, and finally taking the square root of the average.
You *can* do this, and I don't want to sound like a broken record - but 18F parts are better at most everything!
That said, I have used an 18F8723 to measure 4 channels of RMS current with good accuracy using Allegro Hall-effect current sensors.
The chip was very busy, and was running at 40Mhz.
Bookmarks