voltage divider question

Other than control. (Navigation, Sonar, Ect.)
Post Reply
kenl
Posts: 153
Joined: Oct 19th, 2013, 8:50 am
Location: South Western Australia

voltage divider question

Post by kenl »

Hi all,

I have made a simple voltage divider using the diagram and calculator on THIS Web Site

The idea is to make the voltage from my 3s (12.6v) readable by my arduino analog pin, basically divide it by 3ish and then read it and scale it back up in the code.

So I looked at what resistors I had lying around, I have used a 33k (Ra) and a 15k (Rb) according to the calculator it should be a ratio of 3.125.

I hooked it up to my voltage supply at 5.14 volts and measured the output, I need a factor of 2.57 to scale it back up, no problem, that's what I put in my code.

But now I have tried it with a 12v input and with a scaling factor of 2.57 it only shows 10.5 volts? I can change the code but.. :?

My question is..... Should I be using a certain range of resistor values for the range of voltage that I propose to divide?
rossrov
Posts: 383
Joined: Feb 28th, 2013, 5:01 pm
Location: Australia

Re: voltage divider question

Post by rossrov »

Gidday Ken. The input impedance of the Arduino is lower and more involved than the input impedance of a voltmeter. It will be loading down the voltage, effectively reducing the value of Rb. Lots going on on the other side of the analog pin. Capacitance, multiplexing, and sample time affecting the voltage division.

Try a combination of Ra=10K and Rb=4K7. This will lessen the effect of the Arduino's input impedance/sampling process :)
kenl
Posts: 153
Joined: Oct 19th, 2013, 8:50 am
Location: South Western Australia

Re: voltage divider question

Post by kenl »

Thanks Ross I was hoping you would chime in :D

I've only 1/4w resistors in a good selection, would they be ok? I tried some at at lower resistance combination, some thing like 100 and 200 ohm, and they got hot quite quickly.

Ideally I would want use surface mount resistors.

Ken
rossrov
Posts: 383
Joined: Feb 28th, 2013, 5:01 pm
Location: Australia

Re: voltage divider question

Post by rossrov »

Cheers Ken. 1/4 watt fine to use.

To elaborate: You can get an idea how much power in watts in each resistor by first calculating the current (ie I=12.6/(Ra+Rb) then voltage across each resistor Vra= I X Ra, Vrb= I X Rb *, then just volts multiplied by the current to get the watts in each resistor

Out of curiosity, if you calculate power using the 100/200 ohm combination you will see why they got hot. Those values would still have done the division as required though.

* For practical or smaller than practical values of resistance the effect of the microcontroller's analog input impedance can be/has been ignored

Aside from all that, if you want to cheat and maybe reduce maths operations in the micro then use a 5k potentiometer (centre terminal and one other terminal only) in place of Rb. Caution: a larger pot or smaller Ra will risk damaging the microcontroller by putting a larger than allowed voltage into it.

When you have the numbers as desired, remove the pot and measure it's resistance then make up using fixed resistor combination :)
jpWA
Posts: 46
Joined: Feb 9th, 2013, 10:07 am
Location: Atlanta, Ga, USA

Re: voltage divider question

Post by jpWA »

I fried an arduino once by trying to use resistors to bring 12v down to 5v, so I just bought one of these
http://www.amazon.com/Nextrox%C2%AE-Dis ... +converter

it provides a pretty steady 4.8v when when I use a 11.5v battery
kenl
Posts: 153
Joined: Oct 19th, 2013, 8:50 am
Location: South Western Australia

Re: voltage divider question

Post by kenl »

Hi jpWA,

I think you have misunderstood what I'm doing with divider, it is not provide 5v power, it is only so that I can read the voltage with Arduino analog pin. I then scale it back up in the sketch and write it on my OSD. There is an easier way if you just want voltage and that is to buy an E-OSD from hobbyking, it's completely plug and play.

I too have fried a number of items, I'm quite good at it actually :lol: :lol:
Post Reply