Electronic – How to measure -50V to +50V using a microcontroller ADC

adcavrmicrocontroller

How to measure -50V to +50V using a microcontroller ADC?

I would like to scale my signal so that -50V signal voltage equals -5V at the input to the ADC and +50V signal voltage equals +5V at the input to the ADC. Vref and Vcc are 5V.

for clarification
When I connect the-50V input (trimmer), so the output will be-5V.
When I connect the +50 V input (trimmer), so the output will be +5 V.

So the input range for the AD converter is + /-5V.

Thank you very much for your help

I drew a schematic, but this works in the output range of + /-5V.
output range +/- 5V

Best Answer

Please be aware that virtually all microcontroller ADCs that I have encountered support input ranges from 0V to VRef. In your case that would be from 0 to 5V. As such you would not be able to apply -5V as an input to a microcontroller ADC of the types that I've seen. There are of course many ADC implementations that do support input ranges like -10 to +10V or -5 to +5V but these are generally found as part of a more comprehensive data acquisition board or module.

If you want to use a -50 to +50V input range with a microcontroller ADC that supports a 0 to 5V capability then you would have to scale the inputs in a manner as follows:

Trimmer Input -50V => ADC Input at 5V

Trimmer Input 0V => ADC Input at 2.5V

Trimmer Input +50V => ADC Input at 0V

The following circuit shows a typical scaling circuit that can achieve the above range. An additional opamp stage could be added if the inverting characteristic of the circuit is undesirable. Since you are using a microcontroller ADC it would not really be necessary to add the additional stage because the software can be used to invert the ADC readings.

Note that the circuit is sensitive to the absolute accuracy of the +12V and -12V supply levels. In a production design the R4//R2 divider should be replaced with a suitable reference voltage produced from a component such as a TLV431 shunt regulator.

The shown LT1638 opamp was used in the simulation circuit because its model was available. Many other opamp types are usable in this design as well.

enter image description here