I need to read two AC inputs, i conditioned the signals in way that with 220Vca in input board, i have 3 Vcc peak in AD input.
These two input not necessarily are in sincronism, sometimes it will be displaced.
I need to read the inputs and, in case of AC fault, turn on a led in a time less than 5 ms for each input. For example, if V1 fault, i turn on a led
if V2 fault, turn on another led.
How is the best way to do this? I have tried to set a timer for read the inputs every 102us and when the signal is decreasing means
that voltage in the peak, but how i can check if the AC mains is in fault?
i am using atmega88 and studio 7.0
Thanks in advance!