<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91044/nrf-ppk2-gives-unreliable-current-readings</link><description>I&amp;#39;m using the nRF-PPK2 in ampere mode to measure power utilization in a battery powered device over a long period of time (about 16 hours). However, the PPK2 is giving unreliable measurements, as if it is not always sure exactly which measurement resolution</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Nov 2025 18:43:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91044/nrf-ppk2-gives-unreliable-current-readings" /><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/554301?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2025 18:43:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce2cd780-71ce-4e82-a4ae-c45674206ad6</guid><dc:creator>ArunSelva</dc:creator><description>&lt;p&gt;&lt;span&gt;I am also experiencing the same issue. Do we have a fix or an official workaround for this?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/554300?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2025 18:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccc94844-3661-447e-8d69-3f2a354cba69</guid><dc:creator>ArunSelva</dc:creator><description>&lt;p&gt;I am also experiencing the same issue. Do we have a fix or an official workaround for this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/457244?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2023 23:07:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38b9d78e-9f60-4604-aa81-54f59fdf1691</guid><dc:creator>spirosbond</dc:creator><description>&lt;p&gt;I have a similar behavior, but in my case the PPK2 measurement jumps to ~8Amps. Have you found a solution to your issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/412564?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 15:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce5947e1-1cd3-440d-81f5-79ddc417ae58</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Yes, when you use the desktop app it will ask you if you want to update the firmware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/412557?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 14:39:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b12ab839-6987-464b-b9a9-a2ab7a89ca86</guid><dc:creator>Anthony W</dc:creator><description>&lt;p&gt;Is there a way to update the PPK2 firmware to the latest version? Does that happen automatically when connected to the desktop app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/412537?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:54:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cca704af-b1c1-4af5-add5-f8102c47bc69</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Thanks for the script. I can set up a test here with that script, let it run for a day or two, and see if I can reproduce the issue. There has been a few updates to both the PPK2 firmware and the desktop software since last time, so the problem might have disappeared. Let me know if you see any more issues. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/412113?ContentTypeID=1</link><pubDate>Sun, 26 Feb 2023 19:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e744989-66ea-4006-9387-3ee2cf7840a8</guid><dc:creator>Anthony W</dc:creator><description>&lt;p&gt;I hadn&amp;#39;t run this specific test multiple times, but I have observed it more than once. Not often, though, because I haven&amp;#39;t conducted one of these long-duration tests in a while. I&amp;#39;ll have some coming up pretty soon though, I&amp;#39;ll let you know if there are more issues.&lt;/p&gt;
&lt;p&gt;In the mean time, here is the python script I used for data collection. This will&amp;nbsp;log data to disk at 100kHz in real time on reasonable hardware (I&amp;nbsp;ran it on a three year old i7 quad-core mac). It will collect data first with the DUT off to clear anything in the buffer, then run until you send it a keyboard interrupt, and finally collect any remaining data from the buffer. Status output at 1Hz.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;import time
from ppk2_api.ppk2_api import PPK2_API, PPK2_MP
from tables import *
import numpy as np
import traceback
import logging


logging.basicConfig(
    handlers=[
        logging.FileHandler(&amp;quot;power_collector.log&amp;quot;),
        logging.StreamHandler()
    ],
    datefmt=&amp;#39;%H:%M:%S&amp;#39;,
    format=&amp;#39;{name:.&amp;lt;15} {asctime}: [{levelname}] {message}&amp;#39;,
    style=&amp;#39;{&amp;#39;, level=logging.INFO)
log = logging.getLogger(&amp;quot;main&amp;quot;)


def avg_current(N, s, dt):
    if N == 0: return &amp;#39;No samples&amp;#39;
    avg = s/N
    unit = &amp;#39;&amp;#181;A&amp;#39;
    if avg &amp;lt; 1:
        avg *= 1000
        unit = &amp;#39;nA&amp;#39;
    elif avg &amp;gt; 1000:
        avg /= 1000
        unit = &amp;#39;mA&amp;#39;
    f = N/dt
    funit = &amp;#39;&amp;#39;
    if f &amp;gt; 1000:
        f /= 1000
        funit = &amp;#39;k&amp;#39;
    log.info(f&amp;#39;{N:10} samples ~ {f:7.2f}{funit}Hz ~ avg: {avg:7.2f}{unit}&amp;#39;)

def doit():
    sampling_rate = 100000              # 100 ksps
    measurement_duration = 60*60*16     # 16 hours

    filters = Filters(complib=&amp;quot;lzo&amp;quot;, complevel=1)
    h5 = open_file(
        &amp;quot;power_samples.h5.lzo&amp;quot;, mode=&amp;quot;w&amp;quot;, title=&amp;quot;Samples&amp;quot;, filters=filters)
    data = h5.create_earray(
        &amp;quot;/&amp;quot;, &amp;quot;samples&amp;quot;, Atom.from_dtype(np.dtype(&amp;quot;f4&amp;quot;)),
        shape=(0,),
        filters=filters,
        expectedrows=sampling_rate*measurement_duration)

    ppk2s_connected = PPK2_API.list_devices()
    if(len(ppk2s_connected) == 1):
        ppk2_port = ppk2s_connected[0]
        log.info(f&amp;#39;Found PPK2 at {ppk2_port}&amp;#39;)
    else:
        log.error(f&amp;#39;Too many connected PPK2\&amp;#39;s: {ppk2s_connected}&amp;#39;)
        exit()

    ppk2 = PPK2_API(ppk2_port)
    if not ppk2.get_modifiers():
        raise Exception(&amp;quot;Invalid modifiers!&amp;quot;)
    ppk2.use_ampere_meter()         # set ampere meter mode
    ppk2.toggle_DUT_power(&amp;quot;OFF&amp;quot;)    # disable DUT power
    ppk2.set_source_voltage(3700)   # Changing, connected directly to battery

    ppk2.ser.timeout = 0

    ppk2.start_measuring()  # start measuring

    log.info(&amp;quot;DUT off, starting collection.&amp;quot;)

    # measurements are a constant stream of bytes
    # multiprocessing variant starts a process in the background which constantly
    # polls the device in order to prevent losing samples. It will buffer the
    # last 10s (by default) of data so get_data() can be called less frequently.
    N = 0
    s = 0
    i = 0
    t0 = time.time()
    while True:
        read_data = ppk2.get_data()
        if len(read_data) &amp;gt; 0:
            samples = ppk2.get_samples(read_data)
            data.append(samples)

            N += len(samples)
            s += sum(samples)
            t1 = time.time()
            dt = t1-t0
            if dt &amp;gt; 1:
                avg_current(N, s, dt)
                N = 0
                s = 0
                i += 1
                if i == 5: break
                t0 = t1


    ppk2.toggle_DUT_power(&amp;quot;ON&amp;quot;)

    log.info(&amp;quot;DUT ON&amp;quot;)
    try:
        N = 0
        s = 0
        t0 = time.time()
        while True:
            read_data = ppk2.get_data()
            if len(read_data) &amp;gt; 0:
                samples = ppk2.get_samples(read_data)
                data.append(samples)

                N += len(samples)
                s += sum(samples)
                t1 = time.time()
                dt = t1-t0
                if dt &amp;gt; 1:
                    avg_current(N, s, dt)
                    N = 0
                    s = 0
                    t0 = t1

    except KeyboardInterrupt:
        log.info(&amp;quot;Interrupted, stopping.&amp;quot;)
    except:
        log.error(traceback.format_exc())

    ppk2.stop_measuring()
    ppk2.toggle_DUT_power(&amp;quot;OFF&amp;quot;)

    log.info(&amp;quot;DUT OFF. Reading any remaining data...&amp;quot;)
    N = 0
    s = 0
    t0 = time.time()
    while True:
        read_data = ppk2.get_data()
        if len(read_data) &amp;gt; 0:
            samples = ppk2.get_samples(read_data)
            data.append(samples)

            N += len(samples)
            s += sum(samples)
            t1 = time.time()
            dt = t1-t0
        else:
            avg_current(N, s, dt)
            N = 0
            s = 0
            t0 = t1
            break

    log.info(&amp;quot;Done, flushing data to disk...&amp;quot;)

    data.flush()
    h5.close()

if __name__ == &amp;#39;__main__&amp;#39;:
    doit()&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/396034?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2022 14:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:571a0df3-c26e-4b58-9427-5fd68416d382</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, yes this is the correct setup.&lt;/p&gt;
&lt;p&gt;Have you run this test several times, and do you see the same thing every time?&lt;/p&gt;
&lt;p&gt;Do you know the battery voltage when this 9.5A occurs? At the moment I don&amp;#39;t have any ideas how this can happen. I think I would need to run the same tests here, and try to recreate the problem. Do you think you can share your python script? And what type of battery are you using?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Stian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/393091?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2022 22:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0582c792-4712-428b-9d7c-c16cdf8d1559</guid><dc:creator>Anthony W</dc:creator><description>&lt;p&gt;Stian, I have it connected from the battery -&amp;gt; PPK Vin, then PPK Vin -&amp;gt; board&amp;#39;s power input, then both ground pins are connected to ground. Does that sound right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/383499?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 13:44:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8059fb20-2290-46a5-a033-a71fb6148675</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, sorry for the late reply. I took over this case from Håkon which is out of office.&lt;/p&gt;
&lt;p&gt;Did you connect the PPK GND line to the GND on the DUT? It may sound strange, but you actually need three wires for getting a stable reading in ampere meter mode on the PPK2. Vout, Vin and GND.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/382068?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 13:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12f3309d-10a0-4247-8751-a4ebc23d4ca6</guid><dc:creator>Anthony W</dc:creator><description>&lt;p&gt;Not over a period of time. I did use the device in source mode to measure power usage in the absence of a battery, but I don&amp;#39;t remember whether or not I saw this issue. This was before I started using the python API so I was dealing more with the app lag issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF-PPK2 gives unreliable current readings</title><link>https://devzone.nordicsemi.com/thread/381962?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 09:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:203df21b-38de-430b-988c-afc99e1eaec0</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Antony,&lt;/p&gt;
&lt;p&gt;Thank you for reporting this. We will dig deeper into it and get back to you.&lt;/p&gt;
&lt;p&gt;Have you tried measuring other devices(like a battery only) for an extended time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>