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?
voltage divider question
Re: voltage divider question
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
Try a combination of Ra=10K and Rb=4K7. This will lessen the effect of the Arduino's input impedance/sampling process
Re: voltage divider question
Thanks Ross I was hoping you would chime in
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
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
Re: voltage divider question
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
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
Re: voltage divider question
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
http://www.amazon.com/Nextrox%C2%AE-Dis ... +converter
it provides a pretty steady 4.8v when when I use a 11.5v battery
Re: voltage divider question
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
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