Thanks for your suggestion about capacitve coupling.
Using an Arduino oscilloscpe, I can see a random signal mainly fed from mains noise in the air (230V 50 Hz here) as soon as I put 10 cm of wire into A0.
Now I built a voltage divider with 2 of my largest resistors ( 1.2M ) between 5V and GND on a breadboard, and got a clear 2.5V flat line.
Touching the center point with a finger, produces a signal of about 1.5 … 3.5 Volts (with similar 50Hz noise pattern).
Now I tried your “poor man’s coupler” trick, but got at max a voltage level varying about 0.2V only around that center line. ( 2.3 … 2.7 V)
I can confirm it’s capacitive (not inductive), as it’s independent of a current flowing through the line, but a difference between switched on and off is “clearly” visible.
It works slightly better if wound around the separated live line only, but that might be due to the smaller distance ?
Applying my scenario to an LTSpice simulation, I guess there’s not more than about 2pF of coupling capacity.
Any hint on how to improve the effect ? ( using 30 cm aluminium foil (household tin foil) instead of “a few turns of wire” ? )
Or is digital much more sensitive than an ADC channel, where a capacitor needs to be charged?
Spending two 1.2M resistors for a safe but useless “mains detector” lets me think about adding a zener (or a diode and about 30k resistor) , connect the two 1.2M resistors directly to the mains lines and have an unsafe but strong mains detector (turning 325V into 4V pulses @0.1 mApeak) as well.
Sure, optocoupler is the better way to go.
But not unscrewing mains installations, and using “jelly beans” parts is a good thing. If it worked, it were great.