Measure High Dc Voltages 0-150V using a STM32F446RE MCU
The simplest way to do this is to scale the voltage down with a resistor divider. Say for example you want to scale 0-150V to 0-5V for an MCU with a 5V range A/D converter you could use this circuit:



If you cannot get accurate resistors you could replace the R1A component with a 10 turn 5K trimpot to adjust the voltage scaler to produce exactly 5V at 150V input.

When your A/D converter returns its count for the equivalent of 5V you would need to multiply the reading by a scale factor before displaying it on the LCD. If your A/D converter was a 10-bit unit such that the max A/D value was 1023 the scale factor would be:

1023 / 150 = 6.82

The shown circuit would put a load of 1.5mA on the 150V source. For most applications that should not be a problem. If in the extreme case that kind of load on the 150V source is too high then you can scale the resistors up an order of magnitude in value to lower the load to 0.15mA. In that case it would be advisable to add an opamp voltage follower at Vout to buffer the voltage scaler to the MCU A/D.

These days most MCU A/D converter inputs are high impedance and should not represent a significant load on the voltage scaler circuit. Once again if your A/D converter input impedance was not high you may want to buffer the Vout with a opamp voltage follower something like this with a rail to rail input and output opamp: