Voltage divider question

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. :slight_smile:

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.

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..

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 Voltage Divider Calculator

Wawa:
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).

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.

Thank you for your incredibly helpful link. Unfortunately the ADC of the Arduino is not suitable for what I want to do.

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

Also, this was even more useful:

sampling with A0 first and then A1 can be used for a differential measurement?

Vulpecula:
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..

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.

Differential input circuitry will not protect your analog inputs as it is all referenced to gnd.

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

Tom... :slight_smile:

Wawa:
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.

CYHCS-WLY-300A.pdf (286 KB)

So the ground to the 24Volts cannot be tied to the Arduino ground?

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.

There are a host of schematics where the chip is grounded to the same ground connection as the other device grounds.

jremington:
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?

jremington:
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

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.

The ADS1115 is an absolute ADC, with its own internal reference.

jremington:
You may not but the manufacturer certainly does. That is why there are limitations on input voltages.

Sure, but when the measured circuit is floating with respect to ADS's ground the protection diodes will "drag" it to the suitable range. It is the same as measuring part of the circuit with a DMM.

jremington:
The ADS1115 is an absolute ADC, with its own internal reference.

Yes. And compares voltage in the sampling cap to this reference. Internal vs external reference has nothing to do with differential vs single-ended conversion.

EDIT: that part is stupid - it is a sigma-delta ADC, not SAR as Arduino has. I don't know how differential sigma-delta ADCs work and it is well possible they subtract the results.

The potential on that output pin will range from -5V to +5V according to the current (-300A min, +300A max).

That is a 10V swing, which cannot be measured by the ADS1115 anyway.

Use a different sensor, with single ended 0-5V output, and all these unfortunate misunderstandings and problems go away.

jremington:
That is a 10V swing, which cannot be measured by the ADS1115 anyway.

In that case I might just shift the signal up and do a single ended measurement. Shouldn't that do the job? Of course, I will need a common ground in that case and use a voltage divider to split up the 0 -10 volt range.

That is what I was thinking, too. The usual way is to use a summing amp converter (see Fig. 4).

Please post a link to the data sheet for the sensor.

Link to the hall sensor datasheet: http://www.hallsensors.de/CYHCS-WLY-300A.pdf

A summing amplifier will actually require a -Vcc rail, right? I'll have look into that. Don't know how I'll handle that.