Voltage Detector

Ok, no arduino Hmmmn. How did I miss that ?
I guess I have arduino on the brain LOL...
Ok your question about the opto suggests you still don't "get it".
Let's PRETEND for a moment there IS an arduino ( at the "end")
GOOGLE "OPTO COUPLER"
An ooto has an INPUT ( the LED) and an OUTPUT ( the photo transistor)
YOUR DETECTOR has a LED (what a coincidence)
If we REPLACE YOUR LED with the opto coupler led and follow my other instructions, what we wind up with at "the end" , is a microprocessor interface for your voltage detector.

The "point" of your detector is to generate a "trip LED" for the relay card. The simplest way would be an ac relay with a 9V battery powered led connected to the N.C. contacts of the relay so when the mains was lost, the relay would deenergize shorting the N.C. contacts , lighting the led. With no mains , your detector stops pulsing because all of the transistors are off. If the last transistor iis off , then the led across the collector and emitter of the transistor would be ON because the transistor is not shorting the anode and cathode of the led.

. In that case, the arduino ( that we're pretending exists) could detect that automatically using the digital signal coming from the collector of the optocoupler where it is pulled up to 5V by the resistor. But , in retrospect, a microprocessor seems overkill for a led. ( LOL)