Go Down

### Topic: Voltage divider question (Read 497 times)previous topic - next topic

#### Vulpecula

##### Jun 18, 2019, 12:10 pmLast Edit: Jun 18, 2019, 12:44 pm by Vulpecula Reason: Update
Hey there!

I have a voltage divider which is supposed to function as a crude input protection for an ADC (differential reading). I am familiar in calculating basic voltage dividers and this basically is just that, but somehow I am stuck now.

The ADC will see 0.24 volt since that is the differential voltage between the points A and B. But I am struggling to find the right equation to calculate the actual input voltage. Maybe someone is able to point me into the right direction.

Thanks, V.

Edit: I've been juggling with the formula a bit and it seems like I got my solution. So the voltage drop across R2 is supposed to be: UR2 = Uin * R2/(R1+R2+R3). Rearranging that formula will give me the input voltage.

I tried to verify that in practice and built a quick test-setup on a breadboard.

• Rtotal = 20.74 kOhm
• R2 = 0.9834 kOhm
• VR2 = 0.2372 Volt

The equation gives me 5.003V, opposing to 5.01V which I've fed into the circuit. But I guess that's okay since I have to take some measurement error into account.

#### Wawa

#1
##### Jun 18, 2019, 12:46 pmLast Edit: Jun 18, 2019, 12:52 pm by Wawa
Output voltage is 1/21 of input voltage (21:1 ratio).
Your formula UR2 = Uin * R2/(R1+R2+R3) seems right.

Are you sure you can use that diagram?
Most A/Ds must have BOTH inputs voltages within their own VCC-GND.
Or even less than that (common mode range).
I don't see any reference to the A/D's ground (or VCC).
Leo..

#### Idahowalker

#2
##### Jun 18, 2019, 12:57 pmLast Edit: Jun 18, 2019, 12:58 pm by Idahowalker
The op may find this info to be useful https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage, which was found by entering the words "arduino uno read volts" into my favorite internet search engine.

Also, this may be useful http://www.ohmslawcalculator.com/voltage-divider-calculator

#### Vulpecula

#3
##### Jun 18, 2019, 01:05 pm
Are you sure you can use that diagram?
Most A/Ds must have BOTH inputs voltages within their own VCC-GND.
Or even less than that (common mode range).
I don't see any reference to the A/D's ground (or VCC).
Yes, I am sure. I'm using an ADS1115 which has its upper and lower limits at VCC+0.3V and GND-0.3V. I'll be using the differential measurement to pick up the voltage coming from a hall sensor for current measurement. The hall sensor will output +/- 5V (according to the current flow). I do not expect to see that much (more like +/- 2V) but still I need to protect my inputs (voltage spikes, current).

#### Vulpecula

#4
##### Jun 18, 2019, 01:13 pmLast Edit: Jun 18, 2019, 01:15 pm by Vulpecula
The op may find this info to be useful https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage, which was found by entering the words "arduino uno read volts" into my favorite internet search engine.

Also, this may be useful http://www.ohmslawcalculator.com/voltage-divider-calculator
Also, this was even more useful:
https://www.electronicshub.org/potential-difference-in-resistor-networks/

#### Idahowalker

#5
##### Jun 18, 2019, 01:46 pmLast Edit: Jun 18, 2019, 01:53 pm by Idahowalker
sampling with A0 first and then A1 can be used for a differential measurement?

#### Wawa

#6
##### Jun 18, 2019, 01:52 pm
Yes, I am sure. I'm using an ADS1115 which has its upper and lower limits at VCC+0.3V and GND-0.3V.
Also sure, can't do that if you don't refer the inputs to some voltage.

Imagine the bottom part of the 1k resistor 'floating' on about -0.5volt.
Then the top part of the resistor is about -0.25volt.
Both inputs are outside the measuring range (GND-VCC), and the A/D will return zero.
As said, both inputs MUST be kept within VCC/GND of the A/D.
So what are you measuring.
Leo..

#### TomGeorge

#7
##### Jun 18, 2019, 02:21 pmLast Edit: Jun 18, 2019, 02:22 pm by TomGeorge
Hi,
Why do you need to read differential voltage from a Hall Effect device?

Can you post a circuit diagram of your project so we can see how you aim to measure the current detected by the Hall Effect Device.
Can you tell us your application?

Part numbers would be helpful too.

Your Hall Effect device will provide the isolation protection from the measured current.

Tom...
Everything runs on smoke, let the smoke out, it stops running....

#### Vulpecula

#8
##### Jun 18, 2019, 05:22 pmLast Edit: Jun 18, 2019, 05:24 pm by Vulpecula
Also sure, can't do that if you don't refer the inputs to some voltage.

Imagine the bottom part of the 1k resistor 'floating' on about -0.5volt.
Then the top part of the resistor is about -0.25volt.
Both inputs are outside the measuring range (GND-VCC), and the A/D will return zero.
As said, both inputs MUST be kept within VCC/GND of the A/D.
That should be the case if the measured device had a common ground shared with the measuring device which is not the case. As far as I understand it, the ADC references differential, meaning A0 against A1 (and not against GND).

@TomGeorge: I am using a hall sensor to measure the current going into electric motors (see attached PFD for more info).

The Schematic of the circuit:

Please note that the GND of the hall sensor is not the same GND as the one of the ADS1115.

#### Idahowalker

#9
##### Jun 18, 2019, 05:25 pm
So the ground to the 24Volts cannot be tied to the Arduino ground?

#### jremington

#10
##### Jun 18, 2019, 05:57 pmLast Edit: Jun 18, 2019, 06:13 pm by jremington
Quote
As far as I understand it, the ADC references differential, meaning A0 against A1 (and not against GND).
No, that is not how the ADS1115 works. The inputs are referenced to the ADC ground and internal VREF, and the difference between them is constructed.

Both of the the input voltages must be positive with respect to the ADC ground and within the allowed range, which depends on how the gain section is configured. Furthermore the difference between the two is also limited, to +/- 4.096/(PGA gain) V.

Please explain the real purpose of this circuit. "crude input protection" does not make sense.

#### Idahowalker

#11
##### Jun 18, 2019, 06:45 pmLast Edit: Jun 18, 2019, 06:47 pm by Idahowalker
There are a host of schematics where the chip is grounded to the same ground connection as the other device grounds.

#### Vulpecula

#12
##### Jun 18, 2019, 08:22 pm
Please explain the real purpose of this circuit. "crude input protection" does not make sense.
So I need to measure a heck of a current. Therefore I have a hall sensor which gives me an output referenced to its own ground (as seen in the PDF earlier). The potential on that output pin will range from -5V to +5V according to the current (-300A min, +300A max).

Testing this with different voltage sources with different polarities gives me the correct values. So if there is something wrong with this circuit, can you tell me what?

#### Smajdalf

#13
##### Jun 18, 2019, 08:53 pmLast Edit: Jun 18, 2019, 09:55 pm by Smajdalf
No, that is not how the ADS1115 works. The inputs are referenced to the ADC ground and internal VREF, and the difference between them is constructed.
I think this is NOT how ADS1115 works. AFAIK the ADS charges its internal sampling cap to the measured voltage difference, than it disconnect it from input pins and than measures voltage in the cap. I am quite sure it does not measure both voltages in single-ended mode and subtract them later. It makes no sense. I don't see any problem in measuring a floating voltage that does not share common ground with the system containing the ADS1115.

EDIT: this was stupid, see later post
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

#### jremington

#14
##### Jun 18, 2019, 09:28 pm
Quote
I don't see any problem in measuring a floating voltage that does not share common ground with the system containing the ADS1115.
You may not but the manufacturer certainly does. That is why there are limitations on input voltages.