rs20 is right I didn't mention that i replaced the optotriac with an optotransistor.
I don't think to use the optotriac was a requirement

.
As soon as I got the purpose of the request I proposed an easy solution.
Surely it can be achieved in several different ways and this is why we love electronics

.
BTW removing the capacitor this is just a zero cross detection circuit that will provide a pulse every 10ms (if main is 50Hz). This will be also fine to detect the presence of the main.
The capacitor will "smooth" the pulseas and the output to the Micro will remain LOW as long as the main is present.
The capacitor can be placed instead between + and - of the bridge...
Mauro