I am designing my very first DC motor driver circuit. Right at the start, I want to be able to measure the input voltage to the system. The system supposed to work with external DC power supply from 12 to 35 Volts. I think it is possible to directly measure this range with the ADC of the MCU (it is an STM32) with ADC ref voltage of 3.3V. Is the divider circuit below enough?

Do I need to do any protection for the MCU pin? Do I need to add a series resistor in the path between this (VSENSE_IN) point and the MCU pin?

For example, if the divider gives more than 5V...the MCU pin input limit is reached and damaged...how can I protect it from over voltage?

enter image description here

How can I improve this?

  • \$\begingroup\$ Well, just do calculations, \$\endgroup\$
    – g_1_k
    Sep 6, 2018 at 20:41
  • \$\begingroup\$ @g_1_k Calculation is correct...I just want to know if this the correct approach and if I need to add more components for protection e.g. Over Voltage. \$\endgroup\$
    – DEKKER
    Sep 6, 2018 at 20:44
  • \$\begingroup\$ if the divider gives more than 5V...the MCU pin input limit is reached and damaged...how can I protect it from over voltage? \$\endgroup\$
    – DEKKER
    Sep 6, 2018 at 20:45
  • \$\begingroup\$ Try looking up Zener diode, even though I think this is overkill for your application and that this setup will solve the problem \$\endgroup\$
    – g_1_k
    Sep 6, 2018 at 20:48
  • 1
    \$\begingroup\$ Recheck Calc results, I get 2.24V from 35V in. But MCU inputs have Schottky diodes clamp overvoltage with <5mA limited OK by 82k. For a full-scale Vin ADC use gain and offset Vref to Op Amp to convert 12~35V to 0 to 3.3V \$\endgroup\$ Sep 6, 2018 at 20:55

1 Answer 1


You can add a Zener to protect your IC in case the voltage goes higher or electrostatics. You can also add a high value resistor between your measuring node and the IC pin, you can put a smaller cap after that to further reduce noise.

enter image description here

  • \$\begingroup\$ Downvote can at least give a reason \$\endgroup\$
    – Damien
    Sep 7, 2018 at 7:00
  • \$\begingroup\$ Voltage divider will not be accurate when you are using uA, micro controller needs to graw current too. Zener diode will give false reading when it starts to draw current starting at 3V according to data sheet, could be even lower but not specify. \$\endgroup\$
    – Jason Han
    Sep 7, 2018 at 7:04
  • \$\begingroup\$ This is a reference schematic, the values needs to be calculated accordingly to the sense circuit and need of the application. Zener will conduct only when over-voltage in order to protect the UC, which in this case is 3.3V, it won't false anything since anyway the ADC will be saturated above the range. \$\endgroup\$
    – Damien
    Sep 7, 2018 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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