For a safer setup always step it down with a transformer.
Or use an optoisolator. Have your voltage divided down/rectified AC driving an optoisolator, monitor the other side with the input.
isn't this an optoisolator I'm trying to use?
to detect power loss
this project won't have an AC receptacle to plug-into, so "wall-wart" is out