0
\$\begingroup\$

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.

schematic

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.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Put a 10 kohm resistor in series with the ADC input. \$\endgroup\$
    – Andy aka
    May 22 '20 at 8:45
  • \$\begingroup\$ @Andyaka excuse me, i just edited schematic, for R2 & R3 values, from 1k to 100k, is your suggestion remains helpful with this new values? tnx \$\endgroup\$
    – payam_sbr
    May 22 '20 at 8:47
  • \$\begingroup\$ Yeah, sure it is. \$\endgroup\$
    – Andy aka
    May 22 '20 at 8:49
  • \$\begingroup\$ Add 10k as Andy says. Two Schottky diodes (as you have mentioned) to supply and ground on ADC side of 10k will adequately limit almost all transients or over voltage. \$\endgroup\$
    – Russell McMahon
    Jun 22 '20 at 23:20
1
\$\begingroup\$

I'd be tempted to do this: -

enter image description here

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.

\$\endgroup\$
3
  • \$\begingroup\$ dear Andy aka, special thanks for the response.i noticed in some situations a pair of schottky diodes used as >"Connect one from ADC input to ground (cathode to ADC input). Connect the other from ADC input to chip Vcc " to protecting over voltage,... shall i add this extra protection after 10k resistor? \$\endgroup\$
    – payam_sbr
    May 23 '20 at 22:22
  • \$\begingroup\$ Read the chip data sheet for max input current then work out if the 10 kohm resistor and TVS are going to get anywhere close to exceeding that current. I doubt that they will. \$\endgroup\$
    – Andy aka
    May 23 '20 at 23:44
  • \$\begingroup\$ @Andyaka I edited question and added a comment based on your answer. \$\endgroup\$
    – Russell McMahon
    Jun 22 '20 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.