Hi, I am trying to interface the ACS712 Hall Effect current sensor from Allegro. It's a nice little chip with some neat features like; output voltage proportional to AC or DC currents, very stable output voltage offset, ratiometric output from supply voltage.
As far as to interface the sensor with DC currents, there nothing much to it, just sample the output subtract the 2.5V offset and multiply the difference with the output gain.
But it's a different ball game when measuring AC(50Hz in my case) currents, the output follows nicely the AC sine current but the 'zero crossing' is at the offset voltage (+2.5V).
Now my question, how can I synchronize the ADC sampling to read peak current, and in mean time to read or count the frequency?
I tested the sensor with the scope and a AC voltage meter, and the sensor is working fine. I get a nice sine wave on the scope when there's AC current flowing and on the voltage meter I can read in AC millivolts the peak current.
So the sensor is working, but I am wondering will I need some additional hardware to read AC current or could I implement it in software to measure the peak AC current and the frequency?
Edit, removed some typo's.