Continue to Site

# How can i measure a bipolar voltage?

Status
Not open for further replies.

#### kieennx

##### Junior Member level 3
Hi all,
i have to measure a bipolar voltage (it can be positive or negative) in my design for alarm and protection. The voltage ranges from - 20V to +25V. The voltage will be calibrated to 0-5V before putting into ADC on AVR MCU. I need both absolute value and sign.
Please help me because i'm not much familiar with analog electronics.
Regards.

#### Borber

##### Advanced Member level 5
If it is about DC voltage you may use fullwave rectifier to get absolute value and comparator to get sign.

#### echo47

##### Advanced Member level 6
The simplest circuit uses two resistors and one voltage reference.
As Input goes from -20V to +25V, Output goes from 0V to 5V:
Code:
Input ----12K-----+
|____ Output
|
+2.5V ----1.5K----+
I suggest doing the absolute value and sign calculations in your MCU software.

Basically, I solved these simultaneous equations:
via = -20
vib = 25
voa = 0
vob = 5
(via - voa) / r1 = (voa - vref) / r2
(vib - vob) / r1 = (vob - vref) / r2

Other resistors values will work, if you keep their ratio constant.

#### kieennx

##### Junior Member level 3
Thanks all of you. But i want to get the maximum accuracy as possible as i can. The voltage is DC value but it can change its sign sometime. By using rectifier or resistor voltage divider as you suggested, the accuracy maybe low, i'm afraid of that. If there's some circuit that can have higher accuracy (maybe using Opamp?), please tell me how to build it.
Thanks and best regards.

yingngiap

### yingngiap

Points: 2

#### solace76

##### Newbie level 4
Hello,
What you are designing is a dc volmeter of some type, you will find that most of the microcontroller companies like Atmel, Microchip, Philips etc have an application note area on their websites, I am sure u will find one such applicatio about a voltmater over there.

Regards

#### VVV

##### Advanced Member level 5
I would definitely go with the circuit suggested by echo47.
All the A/D which feature a "pseudo-bipolar" input actually use that approach.

The only thing is you should make sure the resistors track one another over temperature. Therefore, I recommend using one of these resistor networks, RTY from Koa Speer: www.koaspeer.com/koa/index.html

They will track to 10ppm/°C. Better ones are available, but the values of the resistors inside are usually identical. Anyway, if you get one with 8 resistors inside (from Bourns or BI Technologies), you connect 7 of them in parallel and the 8-th one is the other resistor. Say you get a 12K network, you will have a 12k and a 1.7k resistor. With some minor adjustments, it can work.

#### kieennx

##### Junior Member level 3
Thanks for helps. I'll try to use the voltage divider suggested by echo47. Is there any good voltage reference creator beside LM336? I'm afraid of bad voltage reference (used for ADC and for the voltage divider).

Status
Not open for further replies.