Always consider safety and whether you know what you are doing when dealing with mains electricity.
There are at least four ways of detecting the presence of a mains voltage:
There are at least four ways of detecting the presence of a mains voltage:
- As suggested by OP use a mains to low voltage transformer or power supply for each input.
- Use a relay with a mains coil for each input and use one of the relay contacts to switch a low voltage signal.
- Use optical-isolators. One possible (non-hat) board is here. Note that I have never used this board.
- There are various "contactless" detectors. Search "Contactless main detection". How well they work when the wire you want to sense is in close proximity to other live wires I don't know.
Statistics: Posted by Memotech Bill — Tue Nov 19, 2024 6:04 pm