Q:

A general purpose way to connect cellphone line out to a microcontroller ADC

I have looked at many questions with similar titles but cone cover my query.
Question: How can I protect an STM32 Cortex M4 series ADC input when measuring the AUX output voltage from typical smartphones (eg Samsung Galaxy)

Here is a circuit I used to sample the mobile audio output through AUX jack, the measurement will be done by an ADC with maximum voltage input of 3V3 (may be 3.6V but I keep it lower.)
The ADC is part of an  STM32F446re  microcontroller.

simulate this circuit – Schematic created using CircuitLab
I am advised that this circuit can damage the ADC.
I (and many others) am looking for a safe way (safety is more important than quality of the signal) to sample audio from AUX jack (headphone output/line out/etc) where the solution is independent of the phone and is standard to most of them.

A:

I'd be tempted to do this: -

You certainly need the added 10 kohm resistor to limit the current pulse that could flow into the ADC's input if the audio level was uncontrolled. Most ADCs will have a maximum limit of around 5 mA beyond which you can damage the ADC. So, if a 10 kohm resistor was used, the peak voltage at the junction of R2, R3 and C1 would have to rise 50 volts above the ADC's supply rail before damage could occur. This is unlikely to happen but you still need to check what that maximum p-p output level could be from the circuit that drives the input.
Another option is to use a TVS diode that will clamp at say 10 or 20 volts - this ensures that the peak current into the added 10 kohm resistor could not rise to anywhere near 5 mA. But, you need to adequately design this - don't just choose some piddling TVS that could be damaged by a sustained signal from the audio source - design it properly and look at data sheets and calculate the energy withstand requirements for the TVS.

