Hello,
I have a 50v, 24Ah battery and i want to measure its voltage using arduino and voltage divider bias method, can you guys please help me to do this ?
Thank you!
Hello,
I have a 50v, 24Ah battery and i want to measure its voltage using arduino and voltage divider bias method, can you guys please help me to do this ?
Thank you!
What will the HIGHEST voltage on the batt, at full charge WITH the charger running be?
the highest voltage of the battery is 54 v.
I was thinking 51k and 4k7, 54V in, 4.56V out, but what would Z be, looking into the R1, R2 junction, I've forgotten the math.
but what about the current? will the current burn the resistors? so what power rating resistor should i choose?
110k and 10k gives 0,5mA aka 30mW total (of which the 110k does most). Aka, simple 1/4th Watt resistors are fine.
51k and 4k7 gives 1mA and 65mW total. Aka, little bit more current but simple 1/4 Watt resistors are fine.
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html.
Can you please tell us your electronics, programming, Arduino, hardware experience?
Thanks.. Tom...
Thank you very much
akshay698:
but what about the current? will the current burn the resistors? so what power rating resistor should i choose?
Any/all of these formulae apply for power in resistors:
P = V^2 / R
P = I^2 * R
P = V * I
Everything can be derived from P = VI and V = IR
I stands for current, the rest ought to be obvious(!)
So, to get closer to completing the analysys:
This is from a spreadsheet I designed to determine the spread due to tolerance error, of the Voltage Divider output voltage. I used 50V for the Battery Full Charge Voltage, but that my not be correct -- it's probably higher [but not 54, because that's, supposedly, the highest voltage while on the charger) -- so this may be incorrect, but it gives a ballpark analysys--at least (I attached the actual spreadsheet, so the OP can supply their own values):
Top Resistor (kΩ): | 110 | |||
---|---|---|---|---|
Bottom Resistor (kΩ): | 10 | |||
Battery Full Chrg Voltage: | 50 | |||
Resistor Tolerance: (%): | 1 | |||
Voltage Divider Output | ||||
Battery Percent Charge | Batt Voltage | Lowest | Nominal | Highest |
120 | 60.00 | 4.91 | 5.00 | 5.09 |
119 | 59.50 | 4.87 | 4.96 | 5.05 |
118 | 59.00 | 4.83 | 4.92 | 5.01 |
117 | 58.50 | 4.79 | 4.88 | 4.97 |
116 | 58.00 | 4.75 | 4.83 | 4.92 |
115 | 57.50 | 4.70 | 4.79 | 4.88 |
114 | 57.00 | 4.66 | 4.75 | 4.84 |
113 | 56.50 | 4.62 | 4.71 | 4.80 |
112 | 56.00 | 4.58 | 4.67 | 4.75 |
111 | 55.50 | 4.54 | 4.63 | 4.71 |
110 | 55.00 | 4.50 | 4.58 | 4.67 |
109 | 54.50 | 4.46 | 4.54 | 4.63 |
108 | 54.00 | 4.42 | 4.50 | 4.58 |
107 | 53.50 | 4.38 | 4.46 | 4.54 |
106 | 53.00 | 4.34 | 4.42 | 4.50 |
105 | 52.50 | 4.30 | 4.38 | 4.46 |
104 | 52.00 | 4.25 | 4.33 | 4.41 |
103 | 51.50 | 4.21 | 4.29 | 4.37 |
102 | 51.00 | 4.17 | 4.25 | 4.33 |
101 | 50.50 | 4.13 | 4.21 | 4.29 |
100 | 50.00 | 4.09 | 4.17 | 4.24 |
99 | 49.50 | 4.05 | 4.13 | 4.20 |
98 | 49.00 | 4.01 | 4.08 | 4.16 |
97 | 48.50 | 3.97 | 4.04 | 4.12 |
96 | 48.00 | 3.93 | 4.00 | 4.07 |
95 | 47.50 | 3.89 | 3.96 | 4.03 |
94 | 47.00 | 3.85 | 3.92 | 3.99 |
93 | 46.50 | 3.80 | 3.88 | 3.95 |
92 | 46.00 | 3.76 | 3.83 | 3.90 |
91 | 45.50 | 3.72 | 3.79 | 3.86 |
90 | 45.00 | 3.68 | 3.75 | 3.82 |
89 | 44.50 | 3.64 | 3.71 | 3.78 |
88 | 44.00 | 3.60 | 3.67 | 3.73 |
87 | 43.50 | 3.56 | 3.63 | 3.69 |
86 | 43.00 | 3.52 | 3.58 | 3.65 |
85 | 42.50 | 3.48 | 3.54 | 3.61 |
84 | 42.00 | 3.44 | 3.50 | 3.56 |
Notice how widely the voltages vary due to tolerance! So, if that's too much, then I suggest cherry picking the resistors [using an Ohmmeter to measure and select values closer to nominal], OR, involve a trim pot.
BTW: I use LibreOffice, so I saved the Spreadsheet in both the open format AND the Microsoft format. I have no way of testing the Office format document, so it might not work. They are both in the attached ZIP file.
Or, just calibrate it...
Bus as we're talking tolerances like this it would be a good idea to switch to an external reference voltage. The standard reference of 5V is from the supply voltage. Which also is just 1% accurate. Which can also lead to +-5mV error on the measurement...
~50volt sounds like four 12volt or eight 6volt lead/acid batteries in series.
I would want to know the voltage of each batttery, or even each cell, instead of total stack voltage.
Leo..
I just only one single battery of 48V and 24Ah.
If you use 1 MΩ for R1 and 20 kΩ for R2, you will need a 0.1 µF ceramic cap between the analog pin and ground to decouple the pin from noise at such high resistance. You can set the top value of analogRead() to 1.1 volts using
analogReference(INTERNAL)
The high resistance will give you very low drain on the battery. You get 1.059 volts on the pin at 54 Volts on the battery so the pin is further protected from overvoltage. To read the battery voltage
float batteryVoltage = analogRead(analogVoltageDividerPin)*(54/985)
986 would be more accurate if you have 1,059V at the pin at 54V. But for that you forgot a 0... 1M and 20k. But then again, that function will always return 0
float != decimal point! So better math without float
unsigned int batteryMilliVolt = analogRead(BatteryVoltagePin) * 56100; //full scale is 56,1V
But keep in mind you can have quite some error. Because of deviation in resistance but also the internal reference is not very accurate. But they are reasonable stable errors so you can compensate with calibration.
septillion:
986 would be more accurate if you have 1,059V at the pin at 54V.
I will concede here as I haven't set it up to test. I would build the circuit, apply 54 volts from a precision power supply, Serial.print(analogRead(pin)); and then take that value and plug it into the formula.
septillion:
But for that you forgot a 0...
I edited my post to fix the mistake...
septillion:
But then again, that function will always return 0
What do you mean?
septillion:
float != decimal point! So better math without float
Agreed! Thank you.
septillion:
the internal reference is not very accurate.
Is the internal reference within 1%? 5%? The point that I was making was to move the top value off VCC. The top value can be set by an external reference if that is more precise.
Another factor to consider is the energy taken from the battery by the divider. I think @septillion suggestion of 110k -- 10k is likely a good choice.
I would also add a capacitor across the 10K, something like 0.01µf should be OK. You would want to keep both resistors near the arduino, that would give the wire from the battery to the arduino the lowest impedance condition.
Consider the resistors you use. Metal film resistors are much more stable than carbon film. Both are really cheap.
For calibration / verification, I would think a decent multimeter would be all you would need.
Perehama:
Is the internal reference within 1%? 5%?
I thought 5% but the datasheet can tell. So combined with 1% error on the 1M that gives a pretty large range.
Perehama:
What do you mean?
Test it But as a hint, (54/985) in integer math will always be 0
If you left off the brackets it would have been fine
And about resistor values, higher mean lower draw but also "harder" to read. Above something like 50k impedance the ADC can struggle. You can fix that with a capacitor and by reading it less often. Once or twice a second is more than enough, a battery will not instantaneously change anyway.
And yeah, metal is cheap enough to make it a no-brainer but as far as stability (aka changes over time) both are fine. Only with a carbon you have a larger calibrate window.
septillion:
I thought 5% but the datasheet can tell.
According to the datasheet, the 1.1 volt reference can vary between 1 volt and 1.2 when stable, which is about 10%. There are a lot more precise reference voltages.
septillion:
Test itBut as a hint, (54/985) in integer math will always be 0
If you left off the brackets it would have been fine
Thank you for explaining.
septillion:
Above something like 50k impedance the ADC can struggle. You can fix that with a capacitor and by reading it less often.
This was my main point in contributing to this post. The cap is important for any voltage divider where R1 is > 10k. The ADC is optimized for low impedance signals. A simple voltage divider will either drain the battery to give enough current to the ADC or the ADC will take a long time to charge it's internal capacitor. Adding a ceramic capacitor in parallel with R2 is key to the success of the circuit.