Control DC MOTOR from headphone
You want an audio level detector.







simulate this circuit &ndash; Schematic created using CircuitLab


C1 blocks any DC from this circuit getting back to your phone.
R2, R3 and C2 hold the '+' input at half-supply.
R1 and R4 set the gain of the op-amp circuit to 10. (Actually it's -10 because it's inverted.)
C4 blocks the DC from getting through to Q1.
R5 slowly bleeds off C4 holding it at 0 V.
D1 and C3 form a rectifier. When the audio signal exceeds the forward bias voltage of D1, C3 starts to charge up.
If the audio level is high enough the voltage on C3 will rise enough to turn on Q1 pulling the 'on' output towards 0 V.


You'll need to choose an op-amp to suit your power supply.
Q1 will gradually turn off as when the audio stops. You may need to add a Schmitt trigger after it to provide a clean signal to your motor controller.

Make an audio signal that goes from off to full on to full off to switch the motor.