Measuring 12V/24V from STM32

Hello Dears,

A couple of months ago I developped a project which was intended to measure from the pin of my microcontroller(STM32) an analog voltage value and varies it from 0 to 5V and that worked well.

Today I am wondering how it is possible to read or measure an analog voltage either 12V or 24V from a microcontroller? How can it be possible ?

If anyone have a clue, That will help me to work on it.

Thanks in advance!!!

Best regards

Yes, its possible. You may use a voltage divider circuit to break down the voltage to 3V or 5V. Their are some other methods you may follow as well, mentioned below.

  • Optocoupler.
  • Transistor.
  • Linear Regulator (not good for analog)
1 Like

Thanks a lot now I get a clue.