I am trying to build a circuit that turns on a speaker when headphones are unplugged (so it like how our phones detect when our headphones are connected).
To do this, I was thinking of simply using a headphone socket and male jack. This way, when the male jack is plugged, the circuit between the positive and negative terminals of the socket is open (as shown in the picture), and the speaker will not have any power. However, when the male jack is unplugged, the circuit is closed, and the speaker will turn on.
The problem with this design is that I would like to be able to easily pull the male jack out, at angles. However, the problem with only using a female headphone socket is that the headphones can't be pulled out at an angle, but rather can only be pulled out straight. To solve this problem, I was thinking of attaching a dongle (aka headphone extension wire) to the fixed socket, and then plugging the headphones into that dongle. Now, I can pull the male jack freely, at whatever angle (since the dongle is free to rotate).
However, the problem with doing that is that now, the socket's circuit is permanently open since the dongle is always plugged in and won't be removed. Does anyone have any ideas on how I can overcome this problem? Any suggestions or solutions to what I am trying to do? Please let me know if I should explain more details. Thanks!