CC Blog Research & Design Hub Tech Trends

Joulescope JS220

Figure 1 This is the Joulescope JS220 unit equipped with the standard front panel. Three other optional front panel variations are available.
Written by Brian Millier

A Precision DC Energy Analyzer

With the proliferation of battery-operated Internet-of-Things (IoT) devices capable of long service intervals, designers need precise measurement of a device’s current draw and power consumption. The Joulescope JS220 meets this requirement—and many other higher-current measurements as well.

  • What are the functions and features of the Joulescope JS220?
  • How does the Joulescope JS220 work?
  • How can I use a Joulescope JS220 in my next project?
  • Joulescope JS220
  • EVK Evaluation Kit 1
  • Raspberry Pi RP2040 Pico MCU
  • HP 3468A Multimeter
  • Agilent U1232A Multimeter
  • DFRobot DFR0487 ESP32 FireBeetle

I was lucky enough to be asked to review the new Joulescope JS220 instrument by the manufacturer Jetperch. This instrument pushes the boundaries of the current or power measurements that I encounter with my projects. Measuring the power consumption of battery-operated IoT projects is fairly challenging for the conventional instruments that I own, but is easily handled by the wide dynamic current range of the Joulescope JS220.

Figure 1
This is the Joulescope JS220 unit equipped with the standard front panel. Three other optional front panel variations are available.
Figure 1
This is the Joulescope JS220 unit equipped with the standard front panel. Three other optional front panel variations are available.

Figure 1 is a photo of the JS220 instrument itself. It comes in a nice padded carrying case, and its packaging would make for a great “unboxing” video. You can see that it is a small unit from the relative size of the extruded aluminum enclosure compared to the banana jacks. There are two sets of inputs: voltage (black and red) and current (red and yellow). The unit uses USB for power and to transfer its data to a PC.

Figure 2 shows the rear panel of the instrument. It contains a USB-C socket but comes with a USB-C to USB-A cable. Its power requirements are less than 500mA—the maximum provided by USB-A.

Figure 2
This is the JS220’s rear panel configuration. It communicates with a PC and is powered by it via the USB-C socket in the center. The 10-pin socket to the left provides access to several GPIO pins, which can be used to synchronize the unit’s measurements with other instruments.
Figure 2
This is the JS220’s rear panel configuration. It communicates with a PC and is powered by it via the USB-C socket in the center. The 10-pin socket to the left provides access to several GPIO pins, which can be used to synchronize the unit’s measurements with other instruments.

The 2×5 pin socket provides various general-purpose digital inputs and outputs which can be used to synchronize the unit’s measurements to events happening during the target microcontroller’s (MCU’s) code execution. The Trigger BNC can be configured as an input or an output and can similarly synchronize other instruments or the target MCU itself.

The JS220 is completely controlled by the attached PC computer, and all the data it collects is immediately streamed to the PC over USB. Jetperch supplies a user interface program for the PC. This application, which I’ll refer to as the Joulescope user interface (UI), will run under Windows, Mac OS, or Ubuntu Linux. It’s freely distributed, and can also be installed on other (off-line) computers in order to fully analyze the data-logging files that the Joulescope produces.

If you have experience measuring currents, you’ll know that it’s often important that the current-measuring device be floating. That is, it should not be referenced to ground, or anything else, for that matter. The JS220 fits that criterion. Its entire analog front end, ADC, and the control/processing FPGA are isolated from its USB circuitry (which is inherently ground-referenced via its connection to the host computer). Figure 3 shows the rough location of the isolation barrier on the bottom of the JS220’s printed circuit board (PCB). Notice the precious metal plating on the edges of the PCB—this ensures good contact with the enclosure for shielding purposes.

Figure 3
This is a view of the PCB inside the JS220. The ground-referenced USB circuitry is on the left. To the right, and separated by an isolation barrier on the PCB, is the AFE, ADC and FPGA signal processor. This is floating with respect to mains ground.
Figure 3
This is a view of the PCB inside the JS220. The ground-referenced USB circuitry is on the left. To the right, and separated by an isolation barrier on the PCB, is the AFE, ADC and FPGA signal processor. This is floating with respect to mains ground.

Another important consideration in current measurements is what’s called the “burden voltage.” This is the voltage that is dropped across the measuring device when the full-scale current is flowing through it. With the JS220’s wide current measuring range, this burden voltage could be a deal-breaker. Jetperch solves this issue by incorporating a multi-section shunt resistor chain. Which sections of this shunt resistor are actually placed across the current input terminals is electronically selected, under FPGA control, to match the current range being measured. This results in a maximum burden voltage of 25mV at 1A. On the highest current range, the shunt resistor is 0.01Ω. This increases proportionally, on each range, to a maximum of 1,111Ω on the 18µA range. In Section 7.5 in the User’s Guide, you can see, from the values listed, that the shunt resistor is actually a chain of resistors in series.

Table 1 lists some of the important features and specifications. It has a wide, bipolar input range for current and voltage measurements. It synchronously measures both voltage and current using a 16-bit ADC at a sampling rate of 2 million samples/sec. The JS220 contains an internal MOSFET switch that can switch the current flowing through the Current+ and Current- terminals. This will allow you to measure inrush currents at startup. Within the stated voltage range, the voltage input and current inputs are isolated with respect to each other. So, you can use either low-side or high-side current measurements. The voltage input is completely floating. If you wish to take only voltage measurements, you must connect a jumper between the positive voltage terminal and the positive current terminal. I know from experience—if you don’t, you’ll get quite erroneous readings.

Table 1
Here are some key features of the Joulescope JS220.
Table 1
Here are some key features of the Joulescope JS220.

For convenience in hooking up the JS220, three optional front panels can be ordered. It takes only a few minutes to unscrew the front panel and swap it out. I’ll cover these optional panels in more detail later.

While not a part of the JS220 per se, Jetperch offers an EVK Evaluation Kit 1. Figure 4 shows this small unit. Basically, it can provide a variable source voltage and a programmable sink current to test out the JS220. I’ll also cover this in more detail later.

Figure 4
This is the component side of the EVK Evaluation Kit 1. It is optional, and can be used for testing the JS220. The rear side of the board contains only the banana plugs which mate with the jacks on the JS220.
Figure 4
This is the component side of the EVK Evaluation Kit 1. It is optional, and can be used for testing the JS220. The rear side of the board contains only the banana plugs which mate with the jacks on the JS220.
JOULESCOPE UI SOFTWARE

The Joulescope UI software can run on PCs with the following operating systems:

  • Windows 10 and 11, 64-bit versions
  • macOS 12 and 13, Apple silicon arm64
  • macOS 12 and 13, Intel x86_64
  • macOS 10.15, Intel x86_64
  • Ubuntu—built for Ubuntu 22.04 LTS only (Use source code for other versions.)

I use Windows 10 (64-bit), and so I installed that version of the Joulescope UI. The installation went smoothly after I downloaded the install file from the Joulescope website. The install file is a 48MB EXE file that contains all the necessary files to install the Joulescope program; in other words, it’s not just a stub that downloads everything from the internet.

Unlike many applications that connect to an external device, the Joulescope application doesn’t need to be configured for the Joulescope JS220. That is, the JS220 is not configured as a USB CDC device, so you don’t have to play around with a COM port selection to make it work. Instead, once it’s plugged into the USB port, the Joulescope UI application will find it automatically. If you click on Device in the top menu strip, you will see the entry “JS220-000483.” The “000483” suffix is the serial number for the unit I had. As a reviewer, I was supplied one unit, but if several JS220s were plugged in, each one would be listed, and the user could select whichever unit was of interest at the time.

When you launch the Joulescope UI application, it will immediately connect to the Joulescope instrument and begin acquisition. There are two modes of operation for this application, selected via the View menu in the menu bar: multimeter, and oscilloscope.

When it’s run for the first time, the UI software starts in the multimeter mode. Figure 5 is a screen capture of the multimeter mode, with the control toolbar hidden. The displayed data is collected over a 500ms interval, and the average readings are the large values shown at the left. The various other readings and calculations over that 500ms interval are displayed in a smaller font to the right.

The multimeter mode is quite basic, so I’ll discuss the oscilloscope mode next, in more detail. The multimeter settings are a subset of those used in the oscilloscope mode.

Figure 6 is a screen capture of the Joulescope UI in the oscilloscope mode. I’ve shrunk the window substantially to save space on the magazine page. On a normal flat-screen monitor, it could easily be expanded by a factor of two, along both axes, to get a more detailed view of the current and voltage waveforms.

Figure 5
This is the Joulescope UI program in the multimeter mode. It provides readings averaged over a 500-millisecond period in large numerals to the left. Statistical calculations and total power consumption since the start of acquisition are provided in a smaller font, to the right.
Figure 5
This is the Joulescope UI program in the multimeter mode. It provides readings averaged over a 500-millisecond period in large numerals to the left. Statistical calculations and total power consumption since the start of acquisition are provided in a smaller font, to the right.
Figure 6
This is the Joulescope UI program in the oscilloscope mode. The odd waveform being displayed was generated by the EVK Evaluation board and is basically just a demo to show that the JS220 is working.
Figure 6
This is the Joulescope UI program in the oscilloscope mode. The odd waveform being displayed was generated by the EVK Evaluation board and is basically just a demo to show that the JS220 is working.

There are two important parameters which need to be set: the full-scale (F.S.) current range (or “auto” mode), and the F.S. voltage range (±2V or ±15 V).

The current ranges are mostly decade-related: 18µA, 180µA, 1.8mA, 18mA, 180mA, and 10A. Both the voltage and current settings are adjusted in the control toolbar using drop-down lists. I’m not sure why, but both parameters can only be adjusted when the instrument is actually collecting data.

When the Joulescope UI is launched, by default it will recall the current setting from the previous usage of the application, but the voltage scale will default to 15V. Because the Joulescope instrument will start acquiring voltage and current readings immediately upon launch of the Joulescope UI, you might be concerned that the current measuring circuitry could be damaged if the current flowing through the device under test was much greater than the current range retrieved from your last Joulescope session. I did not want to purposefully damage the unit, but I did set the UI program on the 18mA scale, closed the program, and re-opened it with a roughly 40mA current flowing. The waveform display showed the current saturated at 20mA, just above the 18mA current setting. The unit was not damaged, but the current readings were inaccurate (saturated). So to be safe, just select the “auto” mode for current. Alternatively, you can modify the startup parameters to some safe, fixed settings.

Incidentally, in the View menu, you can choose to hide the control toolbar, if you wish. Hiding this toolbar might be useful if you expect the JS220 to be operated by non-technical staff who might otherwise “fiddle” with the controls.

Figure 6 shows the Joulescope UI program running with the EVK Evaluation Kit 1 connected to the Joulescope’s four input jacks. Even while it’s collecting data, you can click on the X-Axis icons and adjust the horizontal timescale to provide a useful display.

Adjusting the Y-Axis display (current, voltage, power) manually is a bit less intuitive. If you click in the Y-Axis label area (current or voltage) you get a menu. Among the choices is Range. If you set this to Manual, you can then adjust the display magnification of that waveform using the mouse scroll-wheel, while the Y-Axis labels have the mouse focus. You can also toggle the display between a linear or logarithmic representation.

The JS220 is acquiring data simultaneously for both voltage and current at a rate of 2 million samples/sec. Most of the time, obviously, you don’t expect to be seeing each of these samples on the screen—about one millisecond’s worth of samples would fill up a normal flat-screen monitor.

Instead, the Joulescope application shows the average of many samples, using a yellow trace. The actual number of samples averaged depends upon the horizontal time-base setting you have chosen.

The minimum and maximum values, calculated over that number of samples, are shown as red traces above and below the yellow trace. If you were to zoom out to the extent that each horizontal screen pixel represented one sample, these red bounds traces will disappear.

Along the right-hand side of the waveform display is a window which shows the voltage and current values, as well as the min, max, peak-to-peak values, and the standard deviation. These are calculated over the period of time displayed in the waveform window. It also shows the elapsed time displayed in the waveform window, as well as the total charge during that elapsed time, expressed in coulombs.

Whether collecting data or not, you can click on “Add Single” or “Add Dual” to add marker(s) on the waveform display. As you move a marker with the mouse, the group of values mentioned in the last paragraph will be displayed for the point in time represented by that marker. You can place many single markers, and if you place a dual marker, it will include values related to the time frame enclosed by those markers.

The Waveform Control toolbar also has group of buttons labeled “Signals.” In addition to the voltage and current waveforms, you can display a calculated power waveform. If you have connected either or both of the in0, in1 digital input pins (on the back panel of the JS220) to some external logic-level signal (target MCU GPIO pins, for example), you can add a “mini logic analyzer” display by clicking on the in0/in1 buttons. This will allow you to relate the voltage and current readouts to some real-time event. For example, you could have your target MCU set a GPIO pin high at the start of an ISR and drop it low at the end. Then connect that GPIO signal to in0 on the Joulescope. You could then relate the voltage and current waveforms to the in0 waveform displayed on the JS220 UI, and observe the MCU’s current consumption while it was executing that ISR.

In the control toolbar, to the right of the Start/Stop icon, is a round red icon that starts and stops the logging of the acquired current and voltage to a disk file with a JLS extension. When you click on one of these JLS files, it brings up what looks to be a screen capture of the Joulescope UI program, taken at the time that you triggered the capture. This is what my Siglent SDS1202X oscilloscope provides when I “Print” the scope’s display screen to a USB flash drive.

But wait—there is more magic going on here. If you look at the properties of a JLS file, you can see that it is tagged to open the Joulescope UI application. So, when you click on one of these files, it will invoke a new instance of the Joulescope program and then load the captured data stream. You are then free to scroll and zoom the scaling of the display axes, just as you would do with the Joulescope UI while it was connected to a JS220 and acquiring data. You can also add markers and scroll them around to see the voltage and current data at any given time. The filename itself contains the actual calendar data and the time (hh:mm:ss UTC) that the data was collected. More information about this file structure and its capabilities can be found at the Joulescope Github URL [1].

Since the Joulescope UI program is freely available to anyone, such JLS files could easily be sent to others for analysis—whether they had a JS220 unit on hand or not. I was impressed by this Joulescope feature.

There is also a rectangular blue icon in the control toolbar that allows you to log the acquired data to a more conventional comma-separated values (CSV) file. I didn’t investigate this feature deeply. It opens up in Excel and displays the accumulated values for all parameters over a 500ms interval. You can change the 500ms period to some other value in the Preferences menu using the “reduction_frequency” setting.

The Joulescope UI is quite customizable. If you select Preferences from the File menu, you’ll see the window displayed in Figure 7. One example of the possible customizations is the starting_profile. You can change it from the factory default of previous to app_defaults, Multimeter or Oscilloscope. You can enable automatic checking for updates as well as their source (stable, alpha, beta). There are many possible customizations from this menu.

Figure 7
This is the JS220 UI program’s Preference menu, at the top of the oscilloscope hierarchy. The UI program’s startup configuration and defaults can be highly customized from this menu.
Figure 7
This is the JS220 UI program’s Preference menu, at the top of the oscilloscope hierarchy. The UI program’s startup configuration and defaults can be highly customized from this menu.
TESTING THE JS220 USING THE EVK BOARD

While not included with a JS220 purchase, Jetperch also sells the small EVK Evaluation Kit 1 board for $99. This can be used for routine tests of the JS220’s performance. Tests done with the EVK would not duplicate the parametric testing done by Jetperch on each JS220 before leaving the factory. However, they can be comprehensive enough to satisfy the user of the unit’s health if, for instance, something goes astray on the device under test (DUT) and there was a chance that the JS220’s input limit specifications were exceeded. Figure 4 shows the front side of the EVK PC board—only four banana plugs are present on the back side. These plug directly into the voltage and current jacks on the JS220.

It was tempting to get distracted by this board when I started reviewing the JS220, because it contained an RP2040 Pico MCU, which I am interested in. I quickly found out that the RP2040 runs MicroPython and can be re-programmed to perform specific tests that the user might want to run.

The EVK board contains a USB-C socket and, like the JS220, comes with a USB-C to USB-A cable, so it readily plugs into a standard PC’s USB port. The EVK uses a USB-C socket only because USB-C is becoming common nowadays. The board itself doesn’t take advantage of the power delivery (PD) features of USB-C. That is, it runs only on the 5V 500mA power that is available from a USB-A socket on a PC.

The EVK also contains two programmable regulators with outputs of 3.3V, 1.8V, 1.0V and 0.6V. One of the regulators is a switching, buck regulator which can increase the 500mA available from the USB-A port up to 1.0A, on the lower voltage ranges.

In addition to the programmable voltage sources is a programmable current sink. This consists of a bank of eight decade-related resistors which are programmatically switched in, by transistors, under the control of the RP2040 MCU. These resistors range from 1Ω to 10MΩ. Knowing the selected power source (0.6V-3.3 V), you can determine the current being passed through the Joulescope’s Current+ and Current- terminals, and on through these resistors to ground. This circuitry basically acts like an exponential current sink DAC. There are also two capacitors that can be programmatically switched in parallel with the resistors: 10µF and 1µF. I haven’t yet determined what these capacitors are for.

There is a 5-pin header on the board that provides access to the RP2040’s GPIO010, GPIO011, GPIO012. These can be programmed by the RP2040 as inputs or outputs, and can be used to synchronize other external devices, like an oscilloscope, to the program that is running on the RP2040.

The Raspberry Pi Foundation’s RP2040 MCU is a dual-core ARM Cortex M0. On the EVK, the RP2040 uses a crystal clock, so the MCU’s timing is highly accurate. The RP2040 contains two programmable IO blocks, each containing four state machines. The current waveforms are generated using a PIO block, and given that the RP2040 is crystal-clocked, the waveform timing is extremely accurate.

The RP2040 MCU mounted on the EVK comes with MicroPython pre-installed. Along with the MicroPython run-time interpreter, a Python program is also installed which runs a demo program that provides the voltage and current waveforms shown in Figure 6. This demo was not written for any specific calibration purpose, but just to show that the EVK/Joulescope combination is working. However, MicroPython is running on the RP2040, and it provides a “shell” that is accessed via a serial console. This is part of what is referred to in Python as the read-eval-print loop (REPL).

While any serial terminal program on your PC can access RP2040’s Python shell, the best method is to install the Thonny application on your PC. Thonny is a basic Python editor featuring Python-context autocomplete. It also contains a serial terminal—this runs in a window at the bottom of the Thonny screen. At startup, Thonny will ask you what hardware platform you are using. When you select the Raspberry Pi Pico, Thonny will know enough to scan the available USB virtual COM devices and select the EVK board automatically, as long as it’s plugged in. This shell console window will display “MicroPython (Raspberry Pi Pico)” and its COM port number at the bottom right. If you haven’t configured it properly, clicking on this entry will bring up a menu, allowing you to select the Raspberry Pi Pico.

From the shell, you can run or stop the demo program, as well as execute some functions which are a part of the demo. So, even if you don’t write your own MicroPython scripts, you can do some useful EVK functions right from the shell itself. All of this is clearly explained in the Github repository for the JS220 Evaluation Kit 1 [2].

— ADVERTISMENT—

Advertise Here

Since MicroPython is an interpreted language, its run-time package and the REPL functionality have already been flashed to the RP2040. For your own programs, you must additionally provide:

  • a Python script file that contains the program you want the RP2040 to run.
  • a boot.py file containing boot-up instructions that specify what Python script file to run, and that define some dependencies.
  • optionally, some additional .py files containing library code that is used in your main program.
Figure 8
The RP2040 mounted on the EVK board is loaded with MicroPython and the EVK demo program (in Python). Using Thonny, you can examine the various files that are loaded in the RP2040’s flash memory and which constitute the demo program.
Figure 8
The RP2040 mounted on the EVK board is loaded with MicroPython and the EVK demo program (in Python). Using Thonny, you can examine the various files that are loaded in the RP2040’s flash memory and which constitute the demo program.

When an MCU has MicroPython flashed on it, there will also be code that implements a file system using the MCU’s Flash memory. I’m more accustomed to Adafruit’s CircuitPython, where this filesystem shows up as a USB flash drive on your PC when an MCU containing CircuitPython is plugged into the USB port. With MicroPython, in Thonny when you click on File -> Open, you have the choice to display the files on either your local hard drive or on the Raspberry Pi Pico board itself. If you select the latter, you’ll see the files in Figure 8 as present on the EVK board’s RP2040. Opening the boot.py file, you can see a few lines defining code dependencies, a statement defining an instance of the class “Js220Evk1” (defined in the file evk.py), and statements that send out an information splash screen to the serial console and then run the demo program itself. The demo program is run by invoking the “demo” function in the evk.py file. If you understand the Python language, you can make changes to the evk.py file to run whatever EVK routines you wish. In Thonny, as you open various files, each will open in its own tab, so it’s easy to refer to library functions and so forth as you go about the program development process.

I applaud Jetperch’s choice of the RP2040 MCU with MicroPython as an effective way to run the EVKs, as well as how they made it easy to re-program. Since the EVK can be easily programmed to emulate different “real-life” measurement scenarios, it’s well worth its $99 selling price.

HANDS-ON TESTING

While I was working in the Chemistry Department at Dalhousie University, I had access to Keithley electrometers and an HP (now Keysight) 3458A 8.5-digit Multimeter. I could have done some meaningful tests on the JS220’s calibration with those instruments. Now retired, my test equipment bench is not so well-endowed. For current measurements, I can use an HP 3468A Multimeter (single 1A DC range, 6-digit) or my Agilent U1232A Multimeter (10A and 600µA ranges).

Since Jetperch had also sent me the EVK Evaluation Kit 1 board, it was easy to use that to check out the Joulescope over most of its current ranges. Using the EVK is good for checking out the overall health of the JS220, but it’s not designed to be accurate enough to verify its calibration.

However, as a quick test, I set the EVK to put out a voltage of 1.0V by using the following commands from the shell window of Thonny (the “>>>” is the MicroPython shell prompt):

>>>evk.off()
>>>evk.power_ldo(1.0)

Use the following command to activate the current sink resistors:

>>>evk.resistance = 1000

Here you can specify resistors between 10Ω and 10MΩ, in decade steps. This gives currents of 100mA down to 100nA respectively. For finer control of the resistance values, you can combine the EVK’s decade-related resistors by combining them, as follows:

>>> evk.stop()
>>>evk.resistance_on(1000)
>>>evk.resistance_on(100)

In all cases, the resistors are switched in using NPN transistors of an unspecified type. The VCE of these transistors will not be zero volts, so you would expect the currents that the Joulescope measures to be a bit lower than what the specified voltage/resistance combination would indicate. Indeed, I found that to be the case. The current using the 10Ω sink resistor measured about 5% low, and the higher value resistors measured <2.5% low.

To get at least some sense of the Joulescope’s calibration, I decided to rig up a simple test circuit using several different batteries. I chose batteries as the voltage source because they are completely free of any ripple, and they are completely isolated from mains ground. I placed various resistor values in series with the battery and sent the current through both the JS220 and one of my multimeters. For currents <600µA I used my Agilent U1232A Multimeter, as it has a 600µA scale. For the few readings above 600µA I used the HP 3468A Multimeter on its sole DC current range of 1A.

Figure 9 shows the results of those tests. As you can see, the Joulescope readings matched those of my two multimeters, at least to the extent of the numeric place values the multimeters displayed. While I don’t have test equipment to match that used at Jetperch’s facility, it was satisfying to see that the Joulescope’s readings matched those of my meters. In all the current readings that I took, whether EVK-produced or from my battery-resistor circuit, the JS220’s computed average values were always quite steady and matched the values obtained from my multimeters.

Figure 9
This is an excel spreadsheet showing the readings I obtained with the JS220 as well as by using a combination of my two multimeters.
Figure 9
This is an excel spreadsheet showing the readings I obtained with the JS220 as well as by using a combination of my two multimeters.

The JS220 comes with a nice set of jumper leads terminated in a 2×5 pin plug which mates with the GPIO socket on the back panel of the Joulescope case. When running the Joulescope UI, the View menu will allow you to choose to display the GPIO control panel (termed “Widget” in the manual) at the bottom of the Joulescope UI screen. From the Waveform Control toolbar, you can select which of the GPIO input pins (IN0, IN1) you wish to have displayed. And, from the GPIO Widget, you can toggle the levels of GPIOs OUT0 and OUT1. I connected IN0 to OUT0 and IN1 to OUT1, and proved that all four of these GPIO pins were working correctly. In2, In3 and the BNC Trigger are not implemented in the current Joulescope UI program. But they can be used when you control the instrument with your own Python scripts, via the pyjoulescope_driver).

While the JS220 User’s Guide says that you can enable or disable these two inputs using the IN0, IN1 check boxes, the current version of the Joulescope UI only supports this feature on the older JS110 models.

The GPIO widget contains a drop-down list box labeled “Voltage” that is described in the User’s Guide. Here again, the description in the User’s Guide reflects how the earlier JS110 works, and is different for the JS220. Currently, the Joulescope UI sets the JS220’s logic level to an internal 3.3V power supply. I confirmed this in my tests—the OUT lines produced 3.3V logic levels and the IN lines switched at 3.3V/2 (CMOS switching levels). I asked Jetperch how one would set the logic levels using the VREF pin and an external voltage source. This was their response: “The actual reference node is VREF through 10kΩ and 3.3V through 267kΩ resistor and optocoupler. So, even with the 3.3V reference, you can easily drive a desired voltage at the cost of a little current.”

A REAL-WORLD TEST USING AN ESP32 DEVELOPMENT BOARD

For my purposes, the JS220 would be most useful performing measurements on my various projects that involve battery operation and a project board which generally contains an MCU with Wi-Fi or Bluetooth capability. The current consumption of the different members of the ESP32 family, in the various operating modes, is fairly well-documented. However, I use various ESP32 development boards in projects, and the deep sleep current consumption is often dominated by other circuitry on the development board itself and can’t be easily determined without a measurement.

Most MCU development boards contain a USB port for power and flash programming or serial debugging. In addition to the JS220 and the EVK kit, I also received a variety of custom front panels, one of which can adapt the Joulescope to measure USB current and voltage (Figure 10). These can be purchased from Jetperch.

Figure 10
These are the three optional front panels available for the JS220. They can be swapped in for the banana jack front panel that comes standard with the JS220. The swap can be made in about one minute, by removing two screws.
Figure 10
These are the three optional front panels available for the JS220. They can be swapped in for the banana jack front panel that comes standard with the JS220. The swap can be made in about one minute, by removing two screws.

I wanted to try out the JS220 USB front panel, so I connected up a DFRobot DFR0487 ESP32 FireBeetle board to the JS220 and used my PC’s USB port for power. I had loaded a program into the ESP32 which would put the ESP32 into a deep sleep mode a few seconds after boot-up. The current readings that I obtained were much higher than the 15µA deep sleep current that DFRobot claims for this board. However, looking at the schematic, I recalled that the CH340 USB bridge chip is powered up when the board is powered via the USB port (but isn’t when powered via the LiPo battery socket). You can’t measure ESP32 deep sleep current this way, so I switched the Joulescope front panel back to the original banana jack version.

I then powered the DFR0478 via its battery socket using three AA cells in series (4.8V). I hooked the JS220’s current terminals in series with the positive battery lead (high-side monitoring). Figure 11 is a screen capture of my results. At the start are several seconds in which the ESP32 is actively executing program code. During this period the ESP32 is sending out serial data via the USB port, which may explain the spikes seen in that interval (although it could be the RF modem in the ESP32 running in the background, even though I did not call for any Wi-Fi activity).

— ADVERTISMENT—

Advertise Here

Figure 11
This is a screen capture of a measurement taken on a DFRobot DFR0478 ESP32 board. The green marker that I placed shows that the ESP32’s deep sleep current is 9.98µA. This figure matches that obtained using my Agilent U1232A Multimeter and tracks with DFRobot’s published specification for that board.
Figure 11
This is a screen capture of a measurement taken on a DFRobot DFR0478 ESP32 board. The green marker that I placed shows that the ESP32’s deep sleep current is 9.98µA. This figure matches that obtained using my Agilent U1232A Multimeter and tracks with DFRobot’s published specification for that board.

From the six-second mark on, the ESP32 is in deep sleep mode. I added a marker in this region and the results were 9.98µA (average). This was somewhat better than the DFRobot specifications for the board, but this depends mainly on the ESP32 itself, and could vary from device to device.

For comparison’s sake, I disconnected the Joulescope and hooked up my Agilent U1232A Multimeter, on the µA scale, in series with the positive battery lead. Since the U1232A has a high burden voltage on its 600µA range, I had to temporarily add a jumper wire across the meter leads so that enough current could flow to allow the ESP32 to boot up and execute for the six seconds before deep sleep started. The Multimeter read 10.0µA during deep sleep, which is right in line with the readings I got from the JS220.

A word to the wise: The first time I took the above readings on the Joulescope, I had chosen a current range of 180mA—the next highest range from what I expected the ESP32’s current consumption to be—during normal execution. For some reason, I thought that the JS220 would auto-range downward as soon as the deep sleep started. It turns out that it doesn’t, and the currents I saw during deep sleep were all over the place. This happens because the JS220 measures across a 0.11Ω shunt resistor on this range, and is using just a small fraction of the 16-bit ADC’s resolution (because the voltage drop is so low with only microamps flowing). To get accurate measurements over a wide dynamic range, you must select “auto” for the current range. Lesson learned.

WRITING YOUR OWN JOULESCOPE COMPUTER INTERFACE SOFTWARE

For a hardware or software developer using the Joulescope on the bench, the Joulescope UI program is perfectly sufficient to monitor a device’s power consumption. It’s easy to use and its multimeter and oscilloscope modes cover most use cases. The data can be logged, in what I would call a processed basis, as a CVS file that an Excel spreadsheet can read. In Figure 12, each entry is the integration of the current or power over a 500ms interval, by default. This interval can be changed in the Preferences menu if you navigate to the Device -> Settings -> reduction_frequency entry.

Figure 12
This is the CSV-formatted data, logged to a file, using the red circular icon in the control taskbar of the Joulescope UI program. The data file easily imports into Excel.
Figure 12
This is the CSV-formatted data, logged to a file, using the red circular icon in the control taskbar of the Joulescope UI program. The data file easily imports into Excel.

The raw data is collected at a sample rate of 2 million samples/sec. by default. The round red icon in the Control taskbar starts and stops the logging of this data to a file on your PC. As I mentioned in the UI software section, this results in large files, and Jetperch uses a custom file format (JLS file extension) to make visualizing this data easier.

However, the JS220 could just as easily be used as part of an automated test equipment (ATE) setup. Its small size, and the wide dynamic range of its current readings, make it a good candidate for ATE. Because it connects to a PC via USB, there would be obvious limitations on how many JS220s you could use simultaneously, since PC computers have a limited number of USB ports. Even if you decided to add several USB hubs to the PC, the JS220 streams data at 8MB/sec., which would overwhelm the PC’s OS if a number of JS220s were connected. However, if you plan to use multiple JS220s in the Multimeter mode, the USB bandwidth is a lot less than 8MB/sec. The Oscilloscope mode already supports down-sampling, but the down-sampling is currently performed on the host. Jetperch plans to move the down-sampling to the instrument to allow you to reduce this bandwidth as well.

Assuming you only need a reasonable number of JS220s for a given ATE setup, how do you go about controlling and collecting data from them in an automated way? Even seasoned programmers writing code for PCs are unlikely to have much experience writing USB drivers that can handle a data stream coming in at 8MB/sec. Windows and OSX are not true real-time operating systems, so latency issues could result in data being dropped.

In academia and industry, LabVIEW by National Instruments is a popular way to integrate many different models of test equipment into a system control and data acquisition setup (SCADA). The LabVIEW software is supported by drivers for most commonly available test equipment. I won’t offer my opinion on the pros and cons of LabVIEW, other than to say that Jetperch has chosen another way to allow users to integrate the JS220 instrument into their own custom test rig. How did they go about doing this?

To start with, the Joulescope UI program is written in Python, and its source code is available on GitHub [3]. While I am much more comfortable with the C language, I acknowledge that Python has become the programming language of choice for many applications where C used to dominate. If you are intending to write a completely customized user interface program for your SCADA setup, you could certainly peruse the source code of the Joulescope UI and use it as a template, of sorts.

When you download and install the standard Joulescope UI on a Windows PC, you will end up with an EXE file after the installation completes. This EXE program runs without any external Python framework being present. However, if you want to customize the source code of the Joulescope UI (obtained from GitHub [3]), you must install Python 3.8 or later. Even if you never do any Python programming, it’s quite likely that your PC will already have Python installed, as it’s used by other software. However, on my PC, only Python 3.7 was installed (likely by the ESP32 toolchain). Instructions on how to work with the Joulescope UI source code, running under Python, can be found on GitHub [3].

Jetperch also supplies a Joulescope driver which can be imported into your own Python program. The small snippet of Python code shown in Listing 1 can be run from Python, and will collect 100ms of current and voltage data and print it out. As evident in Listing 1, Python is a high-level programming language and uses libraries to do all of the heavy lifting.

Listing 1
This is a simple Python program that can interact with the JS220, collect some data, and print it out.

import joulescope
import numpy as np
with joulescope.scan_require_one(config=’auto’) as js:
    data = js.read(contiguous_duration=0.1)
current, voltage = np.mean(data, axis=0, dtype=np.float64)
print(f’{current} A, {voltage} V’)

In the Joulescope folder of the pyjoulescope Github repository, you can find many Python scripts which perform various tasks, such as writing the data out to a JLS file, and so forth. I didn’t find much in the way of Python examples in the Jetperch/Joulescope examples folder within the pyjoulescope_examples Github repository [4]—only one plotting routine that had no direct interaction with the Joulescope instrument itself.

However, in the bin folder are 26 Python script files that perform most or all of the functions you would need to use the Joulescope instrument with your custom program. For those scripts that take arguments, you can get a description of the argument list, as in the following example:

python3 bin\downsample_logging.py –help

For the purpose of a review article, and given my limited exposure to Python programming, I haven’t yet explored programming a custom Joulescope application myself.

— ADVERTISMENT—

Advertise Here

CONCLUSIONS

Ironically, when I was asked to review the JS220, I had just finished designing and building a project that could monitor voltage and current consumption on my MCU-based IoT projects (see “A Power Consumption Monitor for IoT Boards,” Circuit Cellar 392, March 2023). Its specifications were much more relaxed than the JS220, since it was targeted at a more defined measurement paradigm, and I didn’t want to spend a lot of money. Having built it, however, gave me a much better appreciation of the design effort involved in the JS220. Although the JS220 comes in a small enclosure, its PCB is loaded with chips and precision components. All its software is open-source Python code, so tailoring the JS220 to automated custom measurements should not be a problem.

In performing this review, I had a lot of questions and comments. I’d like to thank Jetperch’s Matt Liberty for all his the time and effort to help me out in this regard. It speaks well of the company and its after-sale technical support. 

REFERENCES
[1] jetperch/jls—Performant data storage for huge, simultaneous, one-dimensional signals (github.com): https://github.com/jetperch/jls/tree/dc6770f36c62d167d2953dc7ee0f9b322dc97e8a[2] jetperch/js220_evk1: Joulescope JS220 Evaluation Kit 1 (github.com): https://github.com/jetperch/js220_evk1[3] jetperch/pyjoulescope_ui: Joulescope UI source code (github.com): https://github.com/jetperch/pyjoulescope_ui[4] jetperch/pyjoulescope_examples: Python scripting and programming examples using the joulescope package (github.com): https://github.com/jetperch/pyjoulescope_examples

RESOURCES
Agilent Technologies | www.agilent.com
DFRobot Electronics | www.dfrobot.com
Espressif Systems | www.espressif.com
Hewlett Packard | www.hp.com
Joulescope | www.joulescope.com
Raspberry Pi | www.raspberrypi.com

Code and Supporting Files

PUBLISHED IN CIRCUIT CELLAR MAGAZINE • APRIL 2023 #393 – Get a PDF of the issue

Keep up-to-date with our FREE Weekly Newsletter!

Don't miss out on upcoming issues of Circuit Cellar.


Note: We’ve made the Dec 2022 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Sponsor this Article
+ posts

Brian Millier runs Computer Interface Consultants. He was an instrumentation engineer in the Department of Chemistry at Dalhousie University (Halifax, NS, Canada) for 29 years.

Supporting Companies

Upcoming Events


Copyright © KCK Media Corp.
All Rights Reserved

Copyright © 2024 KCK Media Corp.

Joulescope JS220

by Brian Millier time to read: 28 min