When a plug is plugged into a 4mm socket, I want it to actuate an isolated switch (to provide a logic level). Do ready made versions of this exist, or do I have to try and make one? Suggestions? Anybody?
If you mean a standard 4mm banana type, I've never seen one that was switched (like a mic/speaker jack, for instance). A quickie google didn't provide anything, either.
Adapting one to your purposes sounds like a bit of a bear.
But if you have machining facilities (a lathe) it should be fairly easy to run a push rod up the centre of the socket and use that to actuate a microswitch.
How strong this modified connector would be is open to debate (and testing!)
A few second thoughts.
Have a look at the attachment.
The black terminal shows my initial idea, but that would be quite involved to make.
The red terminal just involves drilling one hole and mounting an opto switch to "look" through the hole.
When there is no plug inserted, the light from the opto will pass through the connector.
When the plug is inserted, the light path is obstructed.