@johnerrington , I've taken your advice and calculated the resistance as you mentioned above. With a resistor of value 1 Ohm, I ended up with a resistance of 33mΩ.
V2=1.305V, R=1Ω, I=1.305A, V1=1.349, so Rint=33mΩ. And yes, I agree I have to draw the line somewhere in regards to accuracy. Also, the 3.3Ω resistor you mentioned - I'm trying to achieve a 500mA discharge as per data sheets.
I might need @Wawa help here now. In my orginal project (LINK), I have tried to get the circuit to measure the resistance using the additional code below. It runs just before discharging the battery begins:
void resistanceCheck() {
delay(1000);
analogWrite(PWM_Pin, 0); // Set PWM to zero to read battery "at rest" voltage
measureBattery(); // Measures the existing battery voltage
bR = batteryVoltage; // This is used in calculating internal battery resistance
Serial.println(bR,3);
PWM = ((500.0 / 1000) * 255) / 3.317 * ((90.2 + 46.8) / 46.8); // Calculate PWM to set battery under 500mA load
analogWrite(PWM_Pin, PWM); // Load battery
delay (400); // pulse for 100ms, then read voltage
measureBattery(); // read voltage
Serial.println(batteryVoltage,3);
float resistance = (bR - batteryVoltage)/1.0; // Resistance = (Delta V) / Load resistance
Serial.print(resistance*1000,0); // display voltage in mΩ
Serial.println("mΩ");
}
Now still trying the whole "pulse" thingy as the data sheets suggest, I've tried taking voltage checks at different msecond values and hence Rint values.
I am however getting in knots a bit because I'm using a 1 ohm resistor in the circuit, sending a PWM pulse to a mosfet to drain the battery at a set current. So below I've picked a current of 500mA as suggested in the datasheet. However, I think I may be mucking things up in the calculation in the code in working out V2/R. I'm trying to measure the voltage at rest, then x mSeconds after:
The above looks nothing like the data sheet on batteries mentioned at the start of this thread. Also, if I apply the load for longer than 150mS (10 seconds), I get the graph below:
(image above amended as I added a duplicate of the other graph above it)
"If" my calclations are correct giving the graphs above, to reach 33mΩ, I'd have to load for 400ms (contrary to the data sheet that suggested 100ms).
Any thoughts anyone?