Coming from a different angle, could you use a small power transformer (like a mobile phone charger) to step the voltage down to 5V, then just detect it on a digital pin?You'd have to hack up the power pack if you don't have a standard outlet, and I guess you'd have to be confident in your ability to work with high voltages.
Meh. 120v is nothing compared to our 240v when it comes to killing power. I've had a number of nasty zaps.With Trialex's idea you could even use two halves of a rectifier and you'd be able to detect the phase.
Hi,BTW. Take care with all voltages above 24V. 65V can kill a horse (or your dog, cat whatever..)Got zapped several times, nothing happend? Wait until you caught a flew! Zapp! Heart goes out of sync, family cashes the life-insurance.
Ahem, don't mean to be a downer, but what kind of insane worst case scenario is this taken from?
It is sometimes suggested that human lethality is most common with alternating current at 100-250 volts, however death has occurred from supplies as low as 32 volts and supplies at over 250 volts frequently cause fatalities.
Don't miss the next question in our series : Do I really have to wear a seatbelt when driving slowly?