Voltage Divider Question

Thread Starter

ppenumbra

Joined Jun 16, 2013
3
Hi there,

Complete neophyte to the electronics world, I've attempting to put the theory to work and a touch confused.

I'm using an Arduino to drive a gauge. The gauge is effectively a voltmeter with a maximum input of around .815V, as measured with a cheap meter. I slowly stepped up the voltage using PWM on the Arduino to get to that figure, stopping at 42 out of 255. Calculating the estimated output (42 / 255 * 5V), I get a slightly higher output of .823.

I'd like to have maximum control of the gauge. So, I'm thinking I should use a voltage divider to step down the max output of the Arduino (5V) to max at .82-ish, allowing me to use all 255 stops instead of just 42. I understand the basic math of the voltage divider, but I'm curious why I would use one set of resistors versus another.

Whether I use a 5k R1 and a 1k R2, or a 500/100 pair, the ratio remains the same. Given this gauge requires very little amperage, why would I use one pair or another?

Also, I'm thinking I should estimate a little aggressive with the final output V. If the circuit steps the 5V down too far, I won't reach the 100% mark on the gauge. Any thoughts on the voltage drop seen in the real world, would be helpful. As noted above, the theoretical 16% of the 5V put out by the Arduino is more like .815V of 4.93 max potential.


Thank you.
 

Alec_t

Joined Sep 17, 2013
14,313
For starters you need to consider that a) the Arduino output has a finite resistance which is effectively in series with the voltage divider and will drop some voltage, b) the gauge input has resistance which is in parallel with the bottom resistor of the voltage-divider so will pull the voltage down, and c) the resistors have a tolerance so won't necessarily have their marked values. All three factors mean you'll probably need one of the resistors to be adjustable to set the exact voltage you want.
R1 and R2 values are a compromise. Too low and they will overload the Arduino output. Too high and their division ratio will be affected by noise, stray capacitance and the swamping effect of the gauge resistance.
As a rule of thumb, the divider resistors need to have several times more resistance than the Arduino output and several times less resistance than the gauge.
 

MikeML

Joined Oct 2, 2009
5,444
You don't need a divider, just a resistor in series with the meter...

Try this. Start with a 1K pot. Set it to full resistance. Put the pot (as a two-terminal rehostat) between the Arduino pin and the meter. Set the PWM to 255. Turn the pot until meter reads full scale. Remove from circuit, and measure the resistance of the Pot. Use a fixed resistor of the appropriate value in place of the pot.

btw- if 1K pot is not enough resistance, start with a 5K or 10K pot instead.
 

#12

Joined Nov 30, 2010
18,224
MikeML has the answer. You are over-thinking this. What you do is use the full scale current requirement of the meter and add a resistor that limits 5 volts to that current.

The resistance of the meter, and it's current needs, are almost always a little off from the specifications, but they will be stable across time. When you get the series resistance dialed in, use a 1% resistor and forget about it for 10 to 20 years.

Trust me. I used to do this for my day job.
 
Last edited:

Thread Starter

ppenumbra

Joined Jun 16, 2013
3
Thanks for the recommendations! I had originally thought to just use a resistor, then digging around that seemed like the wrong move. I will take your recommended approach. Thanks!
 

WBahn

Joined Mar 31, 2012
30,058
You don't need a divider, just a resistor in series with the meter...

Try this. Start with a 1K pot. Set it to full resistance. Put the pot (as a two-terminal rehostat) between the Arduino pin and the meter. Set the PWM to 255. Turn the pot until meter reads full scale. Remove from circuit, and measure the resistance of the Pot. Use a fixed resistor of the appropriate value in place of the pot.

btw- if 1K pot is not enough resistance, start with a 5K or 10K pot instead.
I'd start the other way around. If you start with 1K and it isn't enough, they you may overdrive and damage the meter.

I think a better, and safer, way would be to start with your rheostat-configured (1K is fine) and put it in series between the meter and the Arduino and set the PWM to your 42/255, which you know is putting out about 0.84V and is just enough to full-scale the meter, so you know that it won't full-scale with the resistor. Adjust the pot until the meter reads half scale. Remove the pot and measure it's resistance -- this is the resistance of the meter. Now you can calculate how much current the meter takes for full scale deflection and figure out what value series resistance you need to trop the ~4.2V to get from 5V to 0.84V at that current. You can then pick a resistance that is about 80% to 90% of that and a rheostat that would take you to about 110% to 120% of that. Center the rheostate and put in in series with the resistor and the combo in series with the meter. Now put the PWM at 128/255 and adjust the pot until it reads half scale. No increase the PWM to 255 and make a final adjustment of the pot to read full scale.
 
Top