Right,o
I have to mention something here;
PLEASE do not go putting 240/110V AC any place even remotely close to your project board unless you have extensive knowledge of, and procedures regarding, high voltage safety. Yes, yes, I know I am a killjoy but mains AC is a killyou. Preferably use a mains measuring module double insulated with optoisolated TTL outputs, I shudder to think of the circuit containing live 110/240 ac all ending up at the pin of a PIC in 0-5v levels.
Please be very careful with this project and make sure you ask for help in the analogue electronics section of the forum for assistance with measuring and converting mains AC to TTL levels.
Good luck and be safe.