# Arduino Forum

## Using Arduino => General Electronics => Topic started by: Divinitous on Mar 28, 2013, 03:18 pm

Title: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 03:18 pm
Gentlemen,
I'm working on a small project where I'm creating a box to help make things more efficient when servicing machines at work.  First a short bit about the machine I'm working with.  Basically the machine I service is used to find the viscosity of a liquid.  Inside a glass tube the liquid fills up a capillary and two sets of optics detect the amount of time it takes for the minuscus to travel from the upper optic to the lower optic.  Every few months or so the optic stands have to be taken out and the voltage adjusted for both optics to compensate for any wear the optics may have suffered.

The setup that I'm creating will do much more than just this, but this is the part that I'm having an issue with.  The stands will never have a voltage above 11.5v DC so as long as I can get the voltage divider operating properly I am not concerned about an over voltage situation.  My issues lies in the voltage input that I'm getting before the voltage divider.  When I connect the voltage divider circuit the Vin from the source the voltage will drop.  What would normally be a 9.6v drops down to 8.2v.  Connecting the arduino won't affect this, so i know it's not anything with a faulty arduino or bad programming.  I could compensate with some mathematics but the system needs to be operational while I have my setup connected.  Basically I need something to detect the voltage but not create any interference on the source circuit.  Below is my configuration for the voltage divider.  Overall, it works as in the 8.2v is read as 3.3v, but that voltage drop on Vin is gonna be an issue.

Vin -- R1 (220k) -- Vout -- R2 (150k) -- Gnd
Title: Re: 12v to 5v - Voltage divider issues
Post by: fungus on Mar 28, 2013, 04:02 pm
Normally a voltage drop would mean too much current but 220k and 150k is plenty of resistance.

Double-check the resistors with a multimeter to make sure they really are that value (I know you're sure they are, but that's the symptoms...)
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 05:16 pm

Normally a voltage drop would mean too much current but 220k and 150k is plenty of resistance.

Double-check the resistors with a multimeter to make sure they really are that value (I know you're sure they are, but that's the symptoms...)

Yeah, that's something I checked previously.  The values are well within the 5% tolerance.

Any possible alternative to a voltage divider with resistance that i might be able to get away with?
Originally I setup a simple LED voltage meter in a project box and it did a great job. The connector for these stands has 24v for me to work with.
Title: Re: 12v to 5v - Voltage divider issues
Post by: 1oldfox on Mar 28, 2013, 05:22 pm
Good morning Divinitus. First a question. Are there other items, circuits, instruments, etc. in your project that depend on the source (Vin) remaining stable and constant. From what you have described so far, voltage isn't the issue. You are wanting to measure *time*, the measure of which can be mathematically massaged to give you the viscosity measure you are looking for. Is my understanding correct? If so, you may want to investigate using OpAmps for the so called sensors rather than a voltage divider. This would transition you out of the *analog* world and take you into the *digital* world. Much easier to measure time.
-oldfox-
Title: Re: 12v to 5v - Voltage divider issues
Post by: cmiyc on Mar 28, 2013, 05:37 pm
What is the source of "Vin"?

Title: Re: 12v to 5v - Voltage divider issues
Post by: Grumpy_Mike on Mar 28, 2013, 05:51 pm
It sounds like the impedance of the Vin is very very high if it is being dragged down by a load of 370K.
You have connected the grounds together haven't you?
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 05:56 pm
Quote from: 1oldfox

Good morning Divinitus. First a question. Are there other items, circuits, instruments, etc. in your project that depend on the source (Vin) remaining stable and constant.

Yes, this optics setup is only a small part of the complete system.  Bascially I need to check the voltage without having to disconnect the setup.  There are times when I may have to run the machine with my arduino attached to the circuit.  So the voltage drop does create an issue.

Quote from: 1oldfox

From what you have described so far, voltage isn't the issue. You are wanting to measure *time*, the measure of which can be mathematically massaged to give you the viscosity measure you are looking for. Is my understanding correct?

No, the optics setup connects to a larger part that does all the timing and calculations.  The machine itself does the viscosity measurements.  I am only looking to create something to detect the voltages.

Quote from: 1oldfox

If so, you may want to investigate using OpAmps for the so called sensors rather than a voltage divider. This would transition you out of the *analog* world and take you into the *digital* world. Much easier to measure time.

This isn't an option for me.  Basically the overall machine detects the voltage drop when the meniscus passes through the optics.  Typical voltage is 9.5v and a drop from this is the machines trigger.  You can see now why the arduino creating a drop would become an issue as the machine would constantly see the voltage drop and cause the machine to error out.

Oldfox,
Maybe I didn't outline everything properly.  The optics stand is connected to a whole machine.  The circuit I'm designing is only to read the voltage so i can service the optics on the stand.
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 05:57 pm

It sounds like the impedance of the Vin is very very high if it is being dragged down by a load of 370K.
You have connected the grounds together haven't you?

Yes, the ground on the connector is connected to the ground on the arduino.  Should this be different?
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 06:04 pm

What is the source of "Vin"?

Basically the connects to the machine with a 4 pin connector.  All voltages are DC.  24v for the stand to operate on, 1 pin for the upper optic voltage, 1 pin for the lower optic voltage (both a max of 12v) and a ground.  The stand itself operates on 24v from a power supply that is also powering other components.  The supply isn't the issue as it was well oversized, it's the circuitry inside the stand and the voltage divider.

Title: Re: 12v to 5v - Voltage divider issues
Post by: DVDdoug on Mar 28, 2013, 06:10 pm

It sounds like the impedance of the Vin is very very high if it is being dragged down by a load of 370K.
Right...   An effective source impedance of around 50K along with your 370K load would another voltage divider, with about 1.4V dropped across the 50K source impedance.

A regular voltmeter/multimeter has very high resistance (maybe 10M) so it doesn't tend to "drag down" the voltage you are measuring.

You can try increasing the resistance values in your voltage divider, or the best solution would be an op-amp buffer (http://en.wikipedia.org/wiki/File:Op-Amp_Unity-Gain_Buffer.svg).
Title: Re: 12v to 5v - Voltage divider issues
Post by: retrolefty on Mar 28, 2013, 06:10 pm

What is the source of "Vin"?

Basically the connects to the machine with a 4 pin connector.  All voltages are DC.  24v for the stand to operate on, 1 pin for the upper optic voltage, 1 pin for the lower optic voltage (both a max of 12v) and a ground.  The stand itself operates on 24v from a power supply that is also powering other components.  The supply isn't the issue as it was well oversized, it's the circuitry inside the stand and the voltage divider.

If those voltage divider resistors are really the ohms you have stated then the two optic voltage outputs have just too high a source impedance to read like that. You would have to buffer them first with a high input impedance op-amp or some other means to not 'load down' the signal voltage from those two signals.

Lefty
Title: Re: 12v to 5v - Voltage divider issues
Post by: Grumpy_Mike on Mar 28, 2013, 06:11 pm
Quote
The supply isn't the issue as it was well oversized,

Then you are not explaining what your set up really is. Putting a high resistance across a supply like this will not cause it to drop. If you are seeing a voltage drop then something is not as you described it.

Your response also indicates you are not understanding what 1oldfox said.
Title: Re: 12v to 5v - Voltage divider issues
Post by: 1oldfox on Mar 28, 2013, 06:20 pm
OK. Check me out on this. You want to measure the voltage at the optic sensors to give you a value of light transmittance for maintenance purposes. As the transmittance drops, that would indicate a *dirty column* for example, and would be time for you to perform your PM's. Your concern is that the Arduino will cause the voltage to drop, giving a false level from the optic sensors. Here, I would again say, look into OpAmps. The perfect solution. You are already hooking up a voltage divider. You just replace it with the OpAmp and associated circuitry. Which, by the way, can be tuned for voltage levels with a potentiometer.
Title: Re: 12v to 5v - Voltage divider issues
Post by: fungus on Mar 28, 2013, 06:56 pm

Any possible alternative to a voltage divider....

In theory: 10 times more resistance in your divider should mean 10 times less voltage drop (more or less).

You could try putting bigger resistors in there, eg. in the megaohm range. The Arduino ADC input has 100 megaohm resistance so there's still some margin to work with.

Title: Re: 12v to 5v - Voltage divider issues
Post by: retrolefty on Mar 28, 2013, 06:58 pm

Any possible alternative to a voltage divider....

In theory: 10 times more resistance in your divider should mean 10 times less voltage drop (more or less).

You could try putting bigger resistors in there, eg. in the megaohm range. The Arduino ADC input has 100 megaohm resistance so there's still some margin to work with.

Yes, but the analogRead() function works best and is recommended being driven by a voltage source of 10K ohms or less, so values read for such a high impedance source are sure to be problematic.

Lefty
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 07:17 pm

Any possible alternative to a voltage divider....

In theory: 10 times more resistance in your divider should mean 10 times less voltage drop (more or less).

You could try putting bigger resistors in there, eg. in the megaohm range. The Arduino ADC input has 100 megaohm resistance so there's still some margin to work with.

I'm experiencing the problem before the voltage divider even gets to the arduino.  With the arduino removed from the circuit the Vin still loses ~1v.  I think the best solution would be the opamp as someone has mentioned.
Title: Re: 12v to 5v - Voltage divider issues
Post by: fungus on Mar 28, 2013, 07:23 pm

You could try putting bigger resistors in there, eg. in the megaohm range. The Arduino ADC input has 100 megaohm resistance so there's still some margin to work with.

Yes, but the analogRead() function works best and is recommended being driven by a voltage source of 10K ohms or less

That would suggest there's some capacitance in the input stage of the chip. If that's the case then a small resistor could be needed for sampling (eg.) a 10kHz signal. For a low frequency signal though, it would make no difference.

I'd say "try it and see" before adding opamps (or whatever). There's nothing to lose except two resistors.
Title: Re: 12v to 5v - Voltage divider issues
Post by: retrolefty on Mar 28, 2013, 07:28 pm

You could try putting bigger resistors in there, eg. in the megaohm range. The Arduino ADC input has 100 megaohm resistance so there's still some margin to work with.

Yes, but the analogRead() function works best and is recommended being driven by a voltage source of 10K ohms or less

That would suggest there's some capacitance in the input stage of the chip. If that's the case then a small resistor could be needed for sampling (eg.) a 10kHz signal. For a low frequency signal though, it would make no difference.

I'd say "try it and see" before adding opamps (or whatever). There's nothing to lose except two resistors.

Certainly, the AVR single ADC converter uses a sample and hold capacitor that is switched to the pin to be measured by the input pin multiplexer. The 'charge time' for the S/H cap is effected by the source impedance of the voltage trying to charge the cap. This is unrelated independent of the DC input resistance of the analog input pins.

Lefty
Title: Re: 12v to 5v - Voltage divider issues
Post by: fungus on Mar 28, 2013, 07:36 pm

Certainly, the AVR single ADC converter uses a sample and hold capacitor that is switched to the pin to be measured by the input pin multiplexer. The 'charge time' for the S/H cap is effected by the source impedance of the voltage trying to charge the cap.

Sure, but for slowly changing signals the charge on the capacitor will be about the same between each sample. You don't need much source current unless you're trying to change that charge by large amounts on each sample.

This is all just pontificating of course, but it's easy/cheap to try it and see what happens.
Title: Re: 12v to 5v - Voltage divider issues
Post by: dc42 on Mar 28, 2013, 07:38 pm
If the voltage source really does have a very high source resistance, then you can increase the values of the resistors in the voltage divider, provided that you take appropriate precautions when using the ADC to read the voltage, and that you don't need to measure a rapidly-changing voltage. I've used two 4.7M resistors in one of my designs to monitor the voltage of the 9V battery powering a circuit that had no on/off switch. However, it seems strange to me that at voltage or 9.5V should have such a high source resistance.
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Mar 28, 2013, 08:13 pm

If the voltage source really does have a very high source resistance, then you can increase the values of the resistors in the voltage divider, provided that you take appropriate precautions when using the ADC to read the voltage, and that you don't need to measure a rapidly-changing voltage. I've used two 4.7M resistors in one of my designs to monitor the voltage of the 9V battery powering a circuit that had no on/off switch. However, it seems strange to me that at voltage or 9.5V should have such a high source resistance.

Well, it seems you get the prize... if there was one.  I put a 4.7M and a 10M resistors in there and the voltage drop is very minimal.  All that's left is to see if I'm getting correct values with the arduino calculated properly.
Title: Re: 12v to 5v - Voltage divider issues
Post by: dc42 on Mar 28, 2013, 09:35 pm
You need to take precautions either in hardware or in software to get reasonably accurate readings when using such a high resistance source. The simplest is to connect a 0.1uF capacitor between the analog input and ground. Also remember that the input resistance of the ADC is only 100M ohms typical, so you are likely to get about 3% error using 10M and 4.4Mohm resistors.
Title: Re: 12v to 5v - Voltage divider issues
Post by: tocpcs on Mar 28, 2013, 11:14 pm
I'm trying to consider why one wouldn't use an opamp buffer in this design?
It makes sense to me - accurate readings, no load on source circuit.
Title: Re: 12v to 5v - Voltage divider issues
Post by: Divinitous on Aug 14, 2018, 04:20 pm
I'm trying to consider why one wouldn't use an opamp buffer in this design?
It makes sense to me - accurate readings, no load on source circuit.
I'm revisiting this circuit.  I had shelved it for quite some time.

The reason being is that I have limited experience with circuit and this would be over my head.  If you wouldn't mind offering some links or guides I would be extremely grateful.
Title: Re: 12v to 5v - Voltage divider issues
Post by: Paul__B on Aug 14, 2018, 04:53 pm
I'm revisiting this circuit.  I had shelved it for quite some time.
Well over five years in fact.   :smiley-lol:
Title: Re: 12v to 5v - Voltage divider issues
Post by: MarkT on Aug 14, 2018, 05:38 pm
Basically I need something to detect the voltage but not create any interference on the source circuit.  Below is my configuration for the voltage divider.  Overall, it works as in the 8.2v is read as 3.3v, but that voltage drop on Vin is gonna be an issue.

Vin -- R1 (220k) -- Vout -- R2 (150k) -- Gnd
You need a very high impedance buffer before the divider.  This means something like an opamp
buffer - is there a convenient +15V rail to use for this?  It would be a simple opamp non-inverting
buffer of gain 1 driving a 22k/15k divider directly,  with 10k series resistance on the input to
balance the divider and protect the opamp.

Your circuit impedance is sufficiently high that the multimeter itself is probably affecting the
circuit (hard to check without a very high impedance voltmeter).
Title: Re: 12v to 5v - Voltage divider issues
Post by: Paul__B on Aug 14, 2018, 05:42 pm
A MOSFET version of the old VTVM!
Title: Re: 12v to 5v - Voltage divider issues
Post by: JohnRob on Aug 15, 2018, 12:25 am
From what I can gather is you have a circuit powered by 24V (DC?).  And you machine has some sort of electro / optical circuit that works with high impedance.   You want to measure the voltage presented by the high impedance circuit.

I see three options, two have been suggested before.

1) Increase the divider impedance to the point is does not adversely effect the voltage being measured.  This will of course move you away from the 10k optimum of the Arduino A/D.  But still may work.  You haven't stated your required accuracy.

2) Buffer the to be measured voltage with an high impedance opamp potentially powered from the 24Vdc (if it is DC and if it is available).

3) Use something like this A/D (https://www.ebay.com/itm/1Pcs-CJMCU-1232-ADS1232-24-Bit-Low-Noise-A-D-Analog-To-Converter-ADC-For-Arduino/272763153513?epid=15005458188&hash=item3f81f36c69%3Ag%3ALAYAAOSwhilZadKM&_sacat=0&_nkw=a%2Fd+converter+arduino&_from=R40&rt=nc&_trksid=m570.l1313&LH_TitleDesc=0) with high resistor values.

Title: Re: 12v to 5v - Voltage divider issues
Post by: noweare on Aug 15, 2018, 04:28 am
Wow, at least tell us if you ever got the circuit working with the dividers.