Using JS to measure battery capacity

Hello,

I would like to use the JS110 to measure the real capacity of a battery. Is there a way to set an under-voltage or cut-off voltage threshold for when to turn the power off and stop the measurement?

The battery is connected to the IN terminals and a load resistor to the OUT terminals.

Thanks

Hi @Romain and welcome to the Joulescope forum!

The Joulescope UI does not have this feature, but it is easy using a Python script. See the new battery_discharge.py example. You run it like this:

python battery_discharge.py 3.0

And here is the output with a 1 kΩ load and me manually changing the power supply voltage:

0.0: current=0.003717072, voltage=3.701, power=0.013757328, charge=0.000000000, energy=0.000000000
0.5: current=0.003717020, voltage=3.701, power=0.013757059, charge=0.001858510, energy=0.006878525
1.0: current=0.003716417, voltage=3.701, power=0.013755340, charge=0.003716715, energy=0.013756193
...
15.5: current=0.003113948, voltage=3.101, power=0.009655246, charge=0.056800149, energy=0.207720049
16.0: current=0.002843745, voltage=2.834, power=0.008067008, charge=0.058222018, energy=0.211753547

To get started, you usually just need to download and install Python and then:

pip install joulescope

For more details, see the joulescope package documentation.

Does this work for you?

Thanks Matt, that’s exactly what I was looking for!

1 Like

Everything seems to be running fine but when the script ends the load stays enabled.
The low_voltage_shutoff.py example gives the same result:

PS C:\Users\romai\Desktop\pyjoulescope> python low_voltage_shutoff.py --threshold 5.0
2024-09-29 19:36:32.058376 : 5.851 V
2024-09-29 19:36:32.558939 : 5.853 V
2024-09-29 19:36:33.058891 : 5.858 V
2024-09-29 19:36:33.558838 : 5.860 V
2024-09-29 19:36:34.058889 : 1.310 V
2024-09-29 19:36:34.058889 : input voltage below threshold
PS C:\Users\romai\Desktop\pyjoulescope> 

But the power to the load stays on.

The Joulescope GUI 1.1.10 can turn the power on and off, no issue. I tried adding device.parameter_set('sensor_power', 'off') tot he Python script but it didn’t help.
What am I missing?

BTW the JS110 could be running an old firmware. I found the update JS110 Firmware but I have no idea how to install it :sweat_smile:

Hi @Romain - I completely forgot to add the command that actually disconnects the device under test! This is now fixed. See the latest battery_discharge.py which adds:

device.parameter_set('i_range', 'off')

Does this now work for you?


Regarding JS110 firmware, the latest joulescope package and the Joulescope UI no longer update JS110’s by default. However, you can manually select the original Python backend by setting the JOULESCOPE_BACKEND environment variable to 0.

Using Windows Command Prompt:

set JOULESCOPE_BACKEND=0

You can then display the firmware version:

python -m joulescope info

I had firmware 1.3.2 on the JS110 that I pulled randomly, but 1.3.4 is the latest. To upgrade, download 1.3.4. Then:

python -m joulescope program upgrade "%USERPROFILE%\Downloads\js110_1_3_4.img"
device.parameter_set('i_range', 'off')

I confirm it does turn off the load now. Thanks !

I created a separate thread about the firmware update: JS110 Firmware update

1 Like