This handy datalogging current meter can help make your projects more power efficient. We take a closer look and show you how to use it.
With more and more IoT (Internet of Things) devices coming to market, a major concern is the power consumption and battery life. One common technique to minimise power consumption is to enter some sort of sleep state after completing some task such as recording a value like my LoRaWAN battery monitor project in issues 61 and 62. Unfortunately, in this situation, using a multimeter does not give a true picture of the device's current profile. The issue is that multimeters give you an instantaneous reading, while it is common for the current to change drastically over time. Such current profile of an IoT device could look like the following.
To capture something like this, we require something with datalogging capabilities. This is where the Nordic Semiconductor power profiler kit 2 (PPK2) steps in.
The PPK2
The PPK2 essentially consists of two main components: an 8 channel digital logic analyser and a current logger – the main feature of this product. Hence, the primary focus of this review will be on the current measuring capabilities. Nordic Semi has developed an all-in-one software package called "nRF connect" that can be downloaded from their website to interface with this device. It acts as a gateway to a few of their other products, but the app needed for use with the PPK2 is the ‘Power Profiler’.
Once the app has been installed, the power profiler software can be launched. This is where you plug in the PPK2 to your computer and select it in the software.
Once the device is connected, there are a few things that can be set. These include sample rate, output voltage (not available in ammeter mode), which digital channels to monitor and sampling duration. After setting the voltage output (which is applied after you let go of the slider) and hitting the record button, some data begins to be displayed on the screen.
Similar to how an oscilloscope shows voltage over time, this view displays current over time. Apart from measuring different quantities, the key difference between the two is that the PPK2 has a much more limited sample rate but can log data over a much longer span.
The average and maximum currents, the width of the current view (in time), and its charge are among the other bits of information displayed on the interface above. If you are only interested in a segment of the waveform, you can select an area in time. This is useful when for instance, you start the device after pressing the PPK2's record button.
The other feature in this device is the 8 port logic analyser – the output logic levels can be observed below the main current waveform. In the previous screenshot, only 2 ports were enabled as an example and were just measuring the status of 2 pins on the device under test (DUT). While this perhaps isn’t the most feature-rich logic analyser, it’s ok for slow speed debugging.
Unfortunately, you won’t be able to capture standard I2C communication – you’d need a separate logic analyser for that. The vast majority of logic analysers out there also include features like UART and I2C (and so on) decoding, however, the PPK2 does not have this – it merely gives you the output logic level. This makes it feel as though it’s more or less designed to be used with GPIO as a reference point to the current plots more than a functional logic analyser.
Note: for the logic analyser to work, you must supply power to the Vcc pin in addition to everything else. Without Vcc connected, it will not work. This is so that you can use other logic levels such as 3.3V or 1.8V safely.
Since the PPK2 is open source, you can write some code to add additional features to it. This is exactly what IRNAS on GitHub did. They created a CLI interface to the PPK and it can be found at: https://github.com/IRNAS/ppk2-api-python . This will not be investigated in this review, however.
Features and Tests
On to the features of the device. The specifications offered by Nordic Semi will be covered first, and then the outcomes of some minor testing that was carried out will be presented to validate their claims.
The key features that Nordic semi give the PPK are: a 200nA to 1A current range, 100nA and 1mA resolution (depending on the range selected), a 100ksps sampling rate, build in source (voltage controlled between 0.8V and 5V) mode and an ampere meter mode. Just a quick comment regarding the 100ksps sampling rate: this means that the PPK2 can only measure current frequencies up to 50kHz due to Nyquist's theorem.
After a bit of digging through the user guide for the PPK, the rated accuracies can be found. A copy of this can be seen here.
Unfortunately, no details regarding the anticipated noise level were provided, so it had to be determined experimentally. However, this measurement should be taken with a grain of salt as it depends on a lot of different factors.
To validate these claims, the PPK2 was subjected to a range of tests. These tests comprise a variety of voltage and load resistor combinations. Inline to the load, a BM786 multimeter was used which has a known accuracy of 0.075% + 20 digits in the lower range modes, and 0.15% + 20digits in the higher ranges.
A summary of the findings can be downloaded on the DIYODE website. Generally speaking, the smaller ranges (<400µA) measurements were within 1% of the BM768. Do keep in mind that the multimeter has an accuracy of 0.15% plus up to 20 digits on top of this. After factoring this in, all of the lower ranges could be considered as accurate.
However, there was a little more inaccuracy for the larger currents (50µA and up). Some tests were 2% out, while others had an error of 4%. To the credit of the aforementioned specifications, all the tested values were well within what was specified – or at least in comparison to the BM768. However, as is often the case, it’s probably best to ignore the least significant digits in the readings anyway, especially in a higher current range (if you export the data – this gives you a higher resolution than the GUI).
In addition to the accuracy, the noise is another important factor. There are a couple of ways to measure noise. The first is to simply take the difference between the peak values. Another way is to subtract the mean from each of the individual datapoints (gives a relative error) and then take the root mean square (RMS) of that. Provided below is a table summarising the findings.
Resistance |
Voltage |
Pk-Pk (%) |
RMS (%) |
1MΩ |
3.3V |
0.28µA (8.2%) |
0.041vA (1.2%) |
500kΩ |
3.3V |
0.27µA (4%) |
0.042µA (0.6%) |
250kΩ |
3.3V |
0.29µA (2.1%) |
0.044µA (0.3%) |
100kΩ |
3.3V |
0.31µA (0.9%) |
0.043µA (0.1%) |
10kΩ |
3.3V |
1.31µA (0.4%) |
0.162µA (0.05%) |
10Ω |
0.8V |
1.51mA (2.9%) |
0.19mA (0.4%) |
10Ω |
2V |
18mA (13.1%) |
1.56mA (1.1%) |
10Ω |
5V |
20.25mA (6%) |
1.78mA (0.5%) |
Note: The 10Ohm resistor was rated at 50W and adequate time and cooling was given to limit the effects of temperature drift.
Overall, this result was reasonable and within expectations considering the cost and target audience of the device. While there are a few large errors in the peak to peak terms (especially for the high current draw ones) these were mostly due to random spikes (this could be due to a range of things). These shouldn't have a significant impact on the final outcome as they shouldn't contribute much energy to the averages.
Since the PPK2 has an onboard voltage source (0.8V to 5V), it is customary to check the accuracy of the output. The specification for the BM786 is +/- 0.03% + 2 digits, so the results obtained (these can also be downloaded on the DIYODE website) should be fairly accurate. The outcome of these tests can be grouped into two groups. The first is for voltages below 3V, and the second is for voltages above and including 3V.
At a setting above 3V, the voltage source was accurate to 0.2% and occasionally under 0.1%, while below 3V netted an accuracy ranging from 1% to 4%. Even though it might not seem optimal, the majority of IoT devices will run on 3.3V or 5V. There is the capability to provide your own voltage/current source and use the PPK2 in ammeter mode. This may also result in less noisy and more accurate readings. Unfortunately, I did not have access to a low noise power supply, however, in testing with USB power from a laptop, there was a measurable difference in the noise floor.
The sampling frequency will be the last item to be discussed in this section. Both the analog current measurement and the digital logic analyser use this sampling frequency While 100ksps (100 thousand samples per second) may seem like a lot to some people, it's actually quite modest in the broad scheme of things. Although the last part of that statement is really only true in certain applications. But do bear in mind Nyquist’s theorem which states your sampling frequency should be greater than 2 times the frequency you wish to measure.
This ultimately means that this product isn’t suited to measure signals at over 50kHz. If you’re trying to measure high frequency current components, then this likely isn’t for you. Instead, you should use a current probe with an oscilloscope. These can usually sample at speeds into the megahertz to gigahertz range. Again, for something that’s just measuring the power consumption of an IoT device, it’s quite likely that 100ksps is overkill.
Keep in mind that, naturally a higher sampling frequency will make the high frequency noise more apparent – it’s not necessarily any more noisy, you just have more detail that would have effectively been ‘filtered’ out otherwise. This can be seen clearly in the following 2 images. The first is the LED blink program at 100 samples per second, while the one after it is at 100,000 samples per second. The PPK2 was in ammeter mode for both of these tests.
Despite the higher sampling rate, the average currents are practically very similar and within a margin of error. What the lower sampling rate doesn’t capture is the higher frequency noise – this makes seeing the current trend more difficult to see in the second image. If you zoom in, you can see the trend, but even so, the noise is much larger than the difference in current from the LED blinking.
Construction and Build
The layout of the PPK2 consists of a rectangular PCB, with 2 USB ports, 2 banks of 2.54mm pin headers and a centre cut-out with 2 inward-facing LEDs. This is then covered with a clear plastic shell on one side. When these LEDs fade in and out of green, it means the device is powered, while red means the device is source meter mode. Finally, in ammeter mode, a blue light appears. When these LEDs are fading, it indicates that a measurement is taking place.
The USB on the right (looking at the PCB side) is used for both power and data communication, while the other is just there for power. USB can only supply 500mA of current, hence if you wish to supply more than 500mA, then you’ll need to connect the second USB port to another socket on your computer or better, a USB charger – such as the one you might use to charge your phone.
At the heart of the PPK2, there is an nRF52840 which is a multiprotocol 2.4GHz ARM cortex-m4 based microcontroller. It has 1MB of flash and 256kB of RAM and operates at 64MHz.
Notably, the onboard 12 bit ADC (which gets used for sampling) has a limit of 200ksps. This perhaps may have something to do with 100ksps limit.
This specific model can support both Bluetooth 5.3 and Zigbee (among others), and the PCB even has a 2.4GHz PCB trace antenna, but unfortunately, it is left unconnected and is not used in the PPK2. Perhaps a mobile app might have been useful to have, but it would have required time and money to produce.
There are other parts of the board that may be interesting such as the 8bit signal translator for the logic analyser or the onboard digital potentiometer, but these will not be investigated in this review. Feel free to check out the open-source schematics and PCB files on Nordic semi’s website.
Use cases and examples
Up until this point, a limited number of examples and applications have been supplied. So in this section, some cases that highlight the reason for such tool is needed are investigated. The first example is a low voltage battery cut-off that I designed in issue 56. While there was no sleep mode until the battery was depleted, it shows that due to a flashing LED and the MCU performing ADC conversions and whatnot it takes a different amount of power as if it was just executing a nop operation in a while loop.
Here it’s easy to see that, it reaches around 3.5mA when it’s performing an ADC conversion and powering the LED, but only consumes 1.6-1.7mA otherwise. Something like this is hard to see with a traditional multimeter. This gives an average current of about 1.8mA. This means that the device is expected to last about the same time as a device that constantly consumes 1.8mA and thus allows us to easily calculate an accurate estimated battery life. For example, if there was a battery with a capacity of 3000mAh (such as an 18650 battery), then assuming we only want to consume about 50% of the capacity, the device would last for 833 hours ((3000 / 2)/1.8 = 833.3). But what we also learn from the above plot is that the power source needs to be capable of supplying 4mA of current. In addition to this and out of interest, we can zoom in on the peaks to see the current profile for a specific cycle in the code – this is where the 100ksps comes in handy.
While the code inside the low voltage cut-off is rather small and simple, something such as a device that measures some sensor data and then send it over a wireless communication protocol is a lot more complex and its power usage is a lot less predictable. Such example includes the LoRaWAN battery monitor that I designed in issues 61 and 62. While this device was not tested (due to it operating at 12V and not 5v like the maximum of this PPK2), a simple script was created in MicroPython for a Raspberry Pi Pico W to send a message over MQTT every few seconds.
While this sounds like it should execute the same machine code each cycle, it probably doesn’t. For instance, if the radio has to wait for some free air-time to transmit data, or if some network failure happened and the packet needed to be retransmitted, or perhaps even the latency to the server increased drastically for some reason.
You can see the part when the pico w initially connects to the WiFi network (the part unselected on the left) and then when it starts sending MQTT messages. As you can see, the average current for the above device is about 47.5mA. From this, you can calculate how long it will last on a specific battery capacity and whatnot. However, the peaks on this graph are critical and a multimeter would unlikely pick it up. These spikes aren’t just noise or there by accident, they’re likely to be the current drawn from the 802.11n WiFi radio when a packet is transmitted. What this means is that, while your device might only consume 47.5mA on average, the power source/supply needs to be able to deliver over 375mA. If you zoom in on one of the cycles in then above graph, you can more clearly see the cycles in the software.
Here you can observe the CPU’s activity (such as preparing a packet), when it’s idling/sleeping and when the device is transmitting. Unfortunately, despite the fact that you can zoom in even further, there isn't a lot more detail that can be caught in the spikes because the sampling rate is a little bit too low. Supposedly this emphasises the point that even though the device takes 300-400mA to transmit over WiFi, due to the really short duration, it doesn’t end up affecting the overall power consumption.
Alternatives
Like with a lot of products, there are a few alternatives to the PPK2. The Otii Arc by Qoitech is one such device. It’s significantly more expensive (~10x), but boasts higher accuracy (+/-1% + 0.5uA) and higher current limits (up to 2.5A continuous or 5A burst - provided an external power source is used) while all being in a more reliable and professional enclosure. One drawback to the Otii is that it only has a sample rate of 4ksps – much slower than the PPK2. There also exists an Otii Ace which will do up to 25V at 50ksps.
Regular viewers may have noticed that in issue 64 (November 2022), Peter Stewart designed a project that is rather similar to the PPK2 – essentially a DIY version. The techniques used in Peter’s design is similar to what’s employed here so the technical details on how it works will not be discussed. The main differences, aside from the fact that it is a DIY version, are the sampling rate (1.88ksps vs 100ksps), the maximum current range (4A vs 1A), the user interface (OLED vs PC GUI), and the restriction to 5V output (the PPK2 can do 0.8V to 5V).
Conclusion and Final thoughts
The PPK2 would be great for anyone looking to get an accurate picture of their device's current consumption. This product is great at measuring currents, particularly in the low end and helps identify the regions where relatively large amounts of power is being consumed. Which is ideal for optimising the power consumption of your device. Although the sampling rate and accuracy were adequate for many applications, it might not always be the best solution. At the end of the day, the ppk2 leans more toward a hobbyist-grade tool rather than a commercial/industrial one. If you’re looking for a high-end prosumer-grade tool, then the Otii might be the better option here.
Perhaps a missing feature of the device is the ability to measure voltage. This would enable power measurements and make it possible to observe, for instance, the voltage and current profiles of a battery-powered device. Having this could also allow the user to disconnect the source when the voltage drops below a given value.
The user interface is intuitive, well-designed, and simple to use. Although it would be nice to have a customisable voltage profile so that the device could emulate a battery. Perhaps someone could add this feature to the UI.
In light of all of this, if you're interested in low-power IoT projects or small-scale hobby projects, this product is ideal and would be valuable to have in your toolbox.
As a "too long; didn’t read", here’s the breakdown:
Likes
- Price/value
- Software interface
- Programmable voltage output
- 100ksps sampling
- Small form factor
- Open source
Dislikes
- No way to emulate a battery.
- Low sampling rate of logic analyser
- Can’t measure analog voltages
Grab it online from Digi-Key