How to measure negative voltages and high voltages - Page 1
Forum section: electronics / projects

author: asperised
author_rank: Contributor
timestamp: June 23, 2022, 08:31:24 am
content: Hello everyone,I have a Portenta H7 board which comes with the STM32H747XI microcontroller. I am using the breakout board for the portenta which comes with connections for 8 analog channels with a Vref+, Vref-, and a GND pinout. I looked at the data sheet for the microcontroller and found that the Vref+ supports a maximum of 3.6v and Vref- supports the vToltage range in Vss, unfortunately I couldn't find any other information on Vss. The problem is I need to measure a couple of negative voltages which range from -3v to -1.5v and some high voltages which range from +5v to +15v. I know that it is possible for me to condition the high voltage sources to get them down to less 3.6v to measure them but I don't really want to do that as that would extra external circuitry which will complicate things. I am not able to figure out how to measure the negative voltages however. Do I need to look for an external ADC which is capable of doing what I want to do? Would be greatly appreciated if someone could help me out.

author: MegaVolt
author_rank: Frequent Contributor
timestamp: June 23, 2022, 09:35:51 am
content: 1. To measure 5...15 volts you need a voltage divider with 2 resistors.2a. To measure negative voltage, you can use an inverting amplifier. But it will need a negative power supply.2b. If positive power is always available, you can make a divider with two resistors. Between positive and negative power line. So that the output is always positive. This should work well.

author: mikerj
author_rank: Super Contributor
timestamp: June 23, 2022, 10:23:20 am
content: To measure a negative voltage you can simply tie the top of a divider to your (positive) reference voltage, middle goes to the ADC, bottom goes to the negative voltage to be measured. Scale the resistors so that you hit zero volts in the middle at the maximum possible negative voltage that could be applied. The ADC will read zero with your maximum negative voltage applied, and full scale with Vref volts input, but this is trivial to fix this in software.

author: David Hess
author_rank: Super Contributor
timestamp: June 23, 2022, 03:39:08 pm
content: Quote from: MegaVolt on June 23, 2022, 09:35:51 amAn inverting amplifier does not require a negative supply to handle negative inputs.

author: TimFox
author_rank: Super Contributor
timestamp: June 23, 2022, 03:53:21 pm
content: Quote from: David Hess on June 23, 2022, 03:39:08 pmYes. Some op amps (but far from all) can operate with the inputs at or slightly negative with respect to the potential of the negative power terminal, which is grounded for a positive supply.This works perfectly for an inverting amplifier, so long as the output doesn't need to go to exactly zero, since rail-to-rail amplifiers cannot go to the negative power terminal (except for weird ones that include on-chip power thingies).

author: David Hess
author_rank: Super Contributor
timestamp: June 24, 2022, 05:02:09 am
content: Quote from: TimFox on June 23, 2022, 03:53:21 pmAnd not all inverting amplifiers require or use operational amplifiers. Single transistor shunt feedback amplifiers are inverting and handle negative inputs just fine.There are also difference amplifiers which rely on the inverting configuration so that they can accept inputs beyond their supply rails.

author: MegaVolt
author_rank: Frequent Contributor
timestamp: June 24, 2022, 09:08:42 am
content: Quote from: David Hess on June 23, 2022, 03:39:08 pmThis is really so)) The output is a positive signalI didn't think well at first

author: ejeffrey
author_rank: Super Contributor
timestamp: June 25, 2022, 08:40:21 pm
content: You can also bias the + input of the inverting amplifier slightly above 0 VDC. This will avoid needing to go beyond the rails for input and also allow reading all the way up to 0 V signal.If your ADC has a differential input this is particularly helpful as you can connect the - input to the opamp + bias point, meaning that value doesn't have to be accurate, just sufficiently above gnd for your needs.

author: Terry Bites
author_rank: Super Contributor
timestamp: June 26, 2022, 08:12:36 pm
content: TI have a very useful book on single supply opamp gain/ level shifting etc.https://www.tij.co.jp/jp/lit/pdf/sloa030?keyMatch=SLOA030A