First check that your phone will ring through the headphones. With some phones, when a call or text arrives when headphones are plugged in, the phone will just mute the headphones and play the ringing sound through the speaker.
Assuming the phone will send the ringing sound to the headphone socket, you need some kind of "envelope detector" - a circuit that detects an audio signal coming from the headphone output of your smartphone and activates a relay or power MOSFET.
Here's a simple solution with a couple of advantages: no power supply is required, and isolation is included.
View attachment 14979
This circuit uses an audio transformer, T1, to boost the (relatively) low-voltage audio signal from the headphone output of a cellphone or similar portable audio device to a voltage that's high enough to switch a MOSFET (Q1).
Headphone-level audio from the portable audio device is fed through a stereo jack-to-jack cable to input socket CN1. The left channel (the "tip" connection) feeds into T1, an audio transformer, which is used "in reverse", with its secondary driven, so that instead of boosting current, it boosts voltage.
Its output is rectified (converted to DC) and boosted by the "voltage doubler" or "charge pump" circuit formed by C1, D1 and D2, and a voltage is developed across C2 that depends on the amplitude (volume level) of the audio signal. R1 ensures that C2 discharges (over a period of a few tenths of a second) when the signal stops, and D3 limits the DC voltage to prevent possible damage to MOSFET Q1.
This circuit will probably cause audible distortion on the audio signal at the headphone output, so it probably won't be suitable if you're also using the headphone output as an audio source. This circuit only uses one channel though, so you might be able to use the other channel for audio purposes.
MOSFET Q1 is controlled by its gate-to-source voltage, which is equal to the C2 voltage generated by the audio signal. Various MOSFETs are suitable here; I've suggested the NTD4906N because it's cheap and has excellent specifications (apart from its voltage limit - it is only rated to switch 30V absolute maximum), but it's not widely available (it is stocked by
http://www.digikey.com and
http://www.mouser.com). Many other alternatives are suitable and any N-channel enhancement-mode MOSFET will work. For example, for low-power switching, BS170 or 2N7000 are suitable.
Q1 switches the output circuit. The "output" of this circuit is not a voltage; it must be inserted into a DC circuit to switch that circuit ON and OFF. It must be connected into the external circuitry with the polarity shown. If it is connected with the opposite polarity, the body diode in Q1 will conduct and the circuit will be permanently ON.
There are two caveats. First, the MOSFET is not switched ON and OFF quickly and cleanly, so it can dissipate significant power during the transitions from fully OFF to fully ON and vice versa if it is being used to switch a high-current and/or high-voltage circuit. In this case its SOA (safe operating area) parameters could be exceeded, in which case it will expire instantly, and/or it may get hot. If you're not sure, describe the load you're switching and ask for advice.
Second, the MOSFET is not protected against high-voltage spikes caused by "back EMF" or "inductive kickback" from inductive loads. Although such spikes will be minimised by the slow turn-OFF of the MOSFET, they could still cause problems, so if the load is inductive (e.g. a relay coil, a solenoid, or a motor), a diode should be reverse-connected across the load to clamp its back EMF voltage and protect the MOSFET.
The major requirement with this design is ensuring that sufficient gate-source voltage is generated to turn the MOSFET fully ON. This depends on (a) having a strong enough audio signal from the headphone socket, and (b) having a suitable turns ratio in the transformer, T1.
T1 should ideally have a turns ratio between about 5:1 and 10:1. This corresponds to an impedance ratio of between 25:1 and 100:1. (Transformers are often specified by their impedance ratio, not their turns ratio; the impedance ratio is simply the square of the turns ratio.) Here are a few transformers I found on Digi-Key that look suitable. Remember, these transformers are used in reverse - the audio from the portable device's headphone output drives the winding that is nominally called the secondary. In order of increasing price:
Tamura MET-28 1kΩ:50Ω encapsulated USD 11.07
http://www.digikey.com/product-detail/en/MET-28/MT4149-ND/285666
Turns ratio 4.47.
Tamura MET-35 600ΩCT:8Ω encapsulated USD 11.20
http://www.digikey.com/product-detail/en/MET-35/MT4153-ND/285670
Turns ratio 8.66 if you use the full winding on the circuit side. This one looks like a good choice.
Tamura MET-17 10kΩCT:500ΩCT encapsulated USD 13.44
http://www.digikey.com/product-detail/en/MET-17/MT4147-ND/285664
Turns ratio 8.94 if you use the centre tap and one end on the headphone side, and the full winding on the circuit side. Looks suitable.
Triad SP-33 1kΩ:50Ω encapsulated USD 16.30
http://www.digikey.com/product-detail/en/SP-33/237-1144-ND/242666
Turns ratio 4.47.
Triad SP-48 7.5kΩCT:12Ω encapsulated USD 17.37
http://www.digikey.com/product-detail/en/SP-48/237-1146-ND/242668
Turns ratio 12.5 if you use the centre tap and one end on the circuit side. Looks suitable.
Triad SP-29 10kΩCT:500ΩCT encapsulated USD 18.90
http://www.digikey.com/product-detail/en/SP-29/237-1143-ND/242665
Turns ratio 8.94 if you use the centre tap and one end on the headphone side, and the full winding on the circuit side (same as the Tamura MET-17).
Triad SP-5 50kΩCT:1kΩCT encapsulated USD 19.97
http://www.digikey.com/product-detail/en/SP-5/237-1138-ND/242660
Turns ratio 14.14 if you use the centre tap and one end on the headphone side, and the full winding on the circuit side.
I have only done cursory checks on the above listed transformers. I have not checked their power-carrying properties.
You may also be able to scrounge a suitable transformer from the output stage of an old transistor radio. These transformers have a centre-tapped "primary" (connect the ends of this winding to the circuit) and a "secondary" (connect this to the headphone signal).
In any case, you can test whether your transformer is suitable by measuring the DC voltage across C2 in the circuit. It should be less than 1V when there is no audio coming from the headphone output of the portable audio device, and should be at least 10V when audio is present, or a lower voltage if you use a MOSFET specified for "low V
GS" or "logic level gate". These MOSFETs conduct almost fully with gate-source voltages of only 5V, sometimes lower. The NTD4906N is one such device; 5V gate-source voltage is enough.
If you can't get enough voltage, try increasing the volume setting on the device. If that doesn't work, you need a transformer with a higher turns ratio.
Good luck!