Joulescope data logging

Questions from a Joulescope user:
I want to log the current and voltage of a charging cycle of a Li-Ion battery. The charging time is about 3h.

  • Is it possible to show the entire cycle on the screen?
  • Is it possible to set the sampling rate?
  • Is it possible to save the data or export images?
1 Like

With the latest 0.5.1 software, the “.jls” file format is about 8.6 MB/s, which is 92 GB for 3 hours. If you are only concerned with monitoring charge or energy, recording the 2 million samples per second is overkill. We recently added downsample_logging.py to pyjoulescope_examples that records downsampled 2 Hz Joulescope data to a CSV file. Here is what you need:

  • Install python 3.6+ and pyjoulescope. See the instructions. Although we recommend using a virtualenv, that step is optional.
  • Clone the pyjoulescope_examples repo.
  • python pyjoulescope_examples/bin/downsample_logging.py

Here are the commands for windows without virtualenv. Open a command line (terminal) and type:

cd {your_repo_path}
pip install joulescope
git clone https://github.com/jetperch/pyjoulescope_examples.git
python pyjoulescope_examples/bin/downsample_logging.py

The script will print the logging location, which is:

C:\Users\{your_user_name}\Documents\joulescope\jslog_YYYYMMDD_HHMMSS_uuuuuu.csv

By default, the CSV contains a single line column header. Here is the full help from the script:

>python bin\downsample_logging.py --help
usage: downsample_logging.py [-h] [--header {none,simple,comment}] [--resume]

Capture downsampled data.

optional arguments:
  -h, --help            show this help message and exit
  --header {none,simple,comment}
                        CSV header option. "none" excludes all header
                        information and just includes data. "simple" (default)
                        adds a first line with column labels. "comment"
                        contains multiple lines starting with "#" and also
                        inserts events into the CSV file.
  --resume, -r          Resume the previous capture and append new data.

>

Here are example output files:

Units are SI: second, ampere, volt, watt, coulomb, joule

3 Likes

Just what I was looking for. I was planning to code something similar (but likely not as good).

Is this still processing the full 2MSPS? I presume the output is average values?
Any chance this will be extended to include min & max values per time interval? At least for current.
I may find some time to do that and create a PR - but probably not for a week or two.

2 Likes

Hi @Kean, Just capturing data is much simpler (see capture.py), and much of the extra complexity in downsample_logging.py comes from the error handling and recovery.

Yes. The Joulescope sampling still runs at 2 MSPS, and those full rate samples are used to compute power. The existing output for current, voltage and power are the average (mean) values. The existing implementation uses a rectangular window (trivial window) with no other downsampling filter. The energy is the discrete integration (sum multiplied by period) of power.

Adding other statistics and configurable CSV columns should be relatively straightforward. The implementation uses the same statistics as the multimeter display, so variance, standard deviation, min, max, and peak-to-peak are available.

1 Like