<?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>Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64757/inconsistent-battery-measurement</link><description>Hi! I&amp;#39;m having issues with inconsistent battery readout results. I&amp;#39;ll elaborate more below, but in general, I have multiple devices which &amp;#39;sleep&amp;#39; most of the time, and when they wake up they measure the battery voltage using the SAADC, translate it to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Sep 2020 09:22:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64757/inconsistent-battery-measurement" /><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/268235?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2020 09:22:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45fc19e0-45b0-412c-864c-1293918b7f7e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="A.P"]The 5 multiple samples are there, as you say, to average out any outlier samples. I placed a 1 ms in between them to &amp;#39;space out&amp;#39; the samples over a bit of time. There shouldn&amp;#39;t be any peripherals drawing power before or during the sampling.[/quote][quote user="A.P"]Yes, we set up the SAADC channel as follows:[/quote][quote user="A.P"]The channel is set to NRF_SAADC_INPUT_VDD before init and #define HAL_SAADC_VBAT_CHANNEL 0.[/quote]
&lt;p&gt;Great, thank you for clarifying.&lt;br /&gt;The channel configuration seems all right to me, but you might not need the full 40 US ACQTIME. Not that it should matter in this case though, since you are not doing high-frequency sampling.&lt;/p&gt;
[quote user="A.P"]You&amp;#39;re right. I copied this code from the example, and indeed we do not have a reverse current protection diode in place. Accordingly, we do not use this value in any of our calculations, it was placed there before we had decided whether to place a reverse current protection diode or not, and we had overlooked removing it from our code. Thank you for that point though, I will make a note of it in case we add a reverse battery protection diode to our PCB.[/quote][quote user="A.P"]We are using a custom board, not the DK. No reverse current protection is in place.[/quote]
&lt;p&gt;Thank you for confirming this. So it sounds like it has not caused any inaccurate readings, which is good. The reverse current protection in place on the DK&amp;#39;s is there mainly due to the multiple POWER options with different voltage ranges the DK&amp;#39;s have available.&lt;/p&gt;
[quote user="A.P"]I&amp;#39;m afraid I still have not been able to catch this raising battery values while having a debugger attached to the board. I&amp;#39;ll try to give you the data as soon as possible. Just so I&amp;#39;m sure we&amp;#39;re on the same page, you need the ADC readings as well as the battery% calculated from every sample. Is there anything else you&amp;#39;d need?[/quote]
&lt;p&gt;I will take a look at it whenever I get the data, no worries at all! Since I know which linearization scheme you have then I primarily need the SAADC readings and the interval in which they are taken ( i.e if there is 10 min between each sample ).&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/268150?ContentTypeID=1</link><pubDate>Sun, 06 Sep 2020 08:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03cbfc68-e0bf-4ac7-b355-c0a4bda3bd1d</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;Hi hmolesworth, Thank you for the input!&lt;br /&gt;&lt;br /&gt;As Karl said, we do not need to be very accurate. A ball park estimate is more than enough for my use case.&lt;br /&gt;&lt;br /&gt;In your experience, would I still need to measure the current under a predictable load to get a rough estimate of the battery %?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Could you point me to an example or a source I can read about how I should set this sequence up and how do I infer the approximate internal resistance of the coin cell from these two measurements?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="65515" url="~/f/nordic-q-a/64757/inconsistent-battery-measurement/267293"]The difference between loaded and unloaded&amp;nbsp; measurements allow inferring the approx internal resistance of the coin cell[/quote]
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/268149?ContentTypeID=1</link><pubDate>Sun, 06 Sep 2020 08:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af05dc63-cdad-4d9f-b2ff-69741b4e21bc</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/64757/inconsistent-battery-measurement/267259"]Are you doing the 1 ms delay to avoid an outlier sample caused by high current draw from a peripheral, or is there some other reason for the 5 samples over 5 ms?[/quote]
&lt;p&gt;The 5 multiple samples are there, as you say, to average out any outlier samples. I placed a 1 ms in between them to &amp;#39;space out&amp;#39; the samples over a bit of time. There shouldn&amp;#39;t be any peripherals drawing power before or during the sampling.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/64757/inconsistent-battery-measurement/267259"]I see you are referencing HAL_SAADC_VBAT_CHANNEL, is HAL_SAADC_VBAT_CHANNEL =&amp;nbsp;&lt;em&gt;NRF_SAADC_INPUT_VDD&lt;/em&gt;&lt;span&gt;&amp;nbsp;?&lt;/span&gt;[/quote]
&lt;p&gt;Yes, we set up the SAADC channel as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_saadc_channel_config_t channel_config;

    err_code = nrfx_saadc_init(&amp;amp;saadc_config, saadc_event_handler);
    APP_ERROR_CHECK(err_code);
    channel_config           = (nrf_saadc_channel_config_t)NRFX_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_VDD);
    channel_config.reference = NRF_SAADC_REFERENCE_INTERNAL;
    channel_config.gain      = NRF_SAADC_GAIN1_6;
    channel_config.acq_time  = NRF_SAADC_ACQTIME_40US;

    err_code = nrfx_saadc_channel_init(HAL_SAADC_VBAT_CHANNEL, &amp;amp;channel_config);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The channel is set to NRF_SAADC_INPUT_VDD before init and #define HAL_SAADC_VBAT_CHANNEL 0.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/64757/inconsistent-battery-measurement/267259"]I also register that you have the&amp;nbsp;DIODE_FWD_VOLT_DROP_MILLIVOLTS define in place. This define is to account for the voltage drop over the reverse current protection diodes on some of the Development Kits. In your case, the nRF52840 DK instead uses power switches ( and no diodes ) so this voltage drop can be discarded.[/quote]
&lt;p&gt;You&amp;#39;re right. I copied this code from the example, and indeed we do not have a reverse current protection diode in place. Accordingly, we do not use this value in any of our calculations, it was placed there before we had decided whether to place a reverse current protection diode or not, and we had overlooked removing it from our code. Thank you for that point though, I will make a note of it in case we add a reverse battery protection diode to our PCB.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/64757/inconsistent-battery-measurement/267259"]Could you confirm whether you are using an nRF52840 DK or a custom board, by the way?&lt;br /&gt;In the case that you are using a custom board, could you confirm for me whether you have reverse current protection, and in that case which type of reverse current protection you are using?[/quote]
&lt;p&gt;We are using a custom board, not the DK. No reverse current protection is in place.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m afraid I still have not been able to catch this raising battery values while having a debugger attached to the board. I&amp;#39;ll try to give you the data as soon as possible. Just so I&amp;#39;m sure we&amp;#39;re on the same page, you need the ADC readings as well as the battery% calculated from every sample. Is there anything else you&amp;#39;d need?&lt;br /&gt;&lt;br /&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/267552?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2020 08:29:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e5d27c5-4f7d-4fef-974d-56321e3fec24</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Thank you very much for your input here @hmolesworth, these are all important aspects that you mention!&lt;br /&gt;The implementation you describe could definitely yield a more accurate measurement of the remaining battery charge. If I could upvote your comment twice then I would have done it!&lt;br /&gt;&lt;br /&gt;I personally have yet to see a consistent trend of increasing VDD readings for a battery, such as the numbers shared by A.P initially. For most use-cases similar to this, reading the VDD and making sure there is no big power draw at that instant is usually enough to get a good ballpark of the remaining battery charge, in my experience. However, the approach you describe could absolutely be a good addition to projects if higher accuracy is needed.&lt;br /&gt;&lt;br /&gt;In applications where battery monitoring is critical, I would also recommend looking into the addition of a low-power battery fuel gauge IC to the project, in order to get precise battery charge measurements.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/267293?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 15:44:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25589dd9-1f95-4972-9268-f16a4ec4db10</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I looked through the posts in this thread and don&amp;#39;t see one of the fundamental steps for getting a useful voltage measurement on a coin cell to infer capacity. Out of interest a (say) 270mAH coin cell which has supplied (say) 220mAH - so most of the capacity - can recover to 2.95 volts or higher after a significant period where the coin cell does not supply significant current (say few uA). When this cell is used to power a circuit which measures the voltage an erroneous reserve power indication can result, despite monitoring temperature and using compensation curves. The reason is the changing internal cell resistance as the chemistry of the battery changes over time and discharge.&lt;/p&gt;
&lt;p&gt;One solution is to identify a part of the circuit which presents a predictable load each time it is turned on, perhaps a simple resistor driven by a port but also perhaps a small motor or voice coil or even a fixed code execution sequence such as code CRCC. Applying a fixed sequence of these battery load pulses during battery measurement allows measurement both under a known load and under relatively little load (the latter by sleeping during the SAADC sample). The difference between loaded and unloaded&amp;nbsp; measurements allow inferring the approx internal resistance of the coin cell, and thus better estimation of remaining battery life using the temperature and curve fitting already presented. Simply put, the loaded measurement returns a much lower battery voltage than the unloaded measurement. Pulse time is affected by total reservoir capacitance, which props up the coin cell battery voltage; the more the capacitance the longer the required load test pulse.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/267259?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 13:16:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:077ee0d6-7af3-412d-89b8-5929944e3ae7</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="A.P"]I&amp;#39;ve been unsuccessful in trying to capture the ADC readings on RTT viewer with a board displaying this increase in power. While I keep trying to catch one red handed, I can pass the attached table onto you and hope it helps.[/quote]
&lt;p&gt;Thank you for providing me the table of results. I have not heard of this behavior previously, so it would definitely be interesting to see the rising battery measurements if you should encounter them again.&lt;/p&gt;
[quote user="A.P"]Wake up, initiate the SAADC, calibrate it and take 5 measurements with 1ms sleep in between them.[/quote]
&lt;p&gt;Are you doing the 1 ms delay to avoid an outlier sample caused by high current draw from a peripheral, or is there some other reason for the 5 samples over 5 ms?&lt;/p&gt;
[quote user="A.P"]So, you might notice slight inconsistencies between the ADC value in the table and its matching battery %- that is because the SAADC value is the first read, which the battery% is the average of 5 readings.[/quote]
&lt;p&gt;Thank you for the thorough explanation.&amp;nbsp;&lt;/p&gt;
[quote user="A.P"]If you need anything else, I&amp;#39;d rather we switch the ticket to private before sharing more specific code.[/quote]
&lt;p&gt;I can set the ticket to private at any time, if you wish to share more code.&lt;br /&gt;As it stands right now, I do not see anything in your configuration that could cause rising measurements. I do however have two comments to the above:&lt;br /&gt;I see you are referencing HAL_SAADC_VBAT_CHANNEL, is HAL_SAADC_VBAT_CHANNEL =&amp;nbsp;&lt;em&gt;NRF_SAADC_INPUT_VDD&lt;/em&gt;&lt;span&gt;&amp;nbsp;?&lt;br /&gt;I also register that you have the&amp;nbsp;DIODE_FWD_VOLT_DROP_MILLIVOLTS define in place. This define is to account for the voltage drop over the reverse current protection diodes on some of the Development Kits. In your case, the nRF52840 DK instead uses power switches ( and no diodes ) so this voltage drop can be discarded.&lt;br /&gt;This might actually have quite an impact on your battery measurements, in the case that you are accounting for the voltage drop without having reverse current protection diodes present - because it will shift the samples further out on the discharge curve.&lt;br /&gt;Could you confirm whether you are using an nRF52840 DK or a custom board, by the way?&lt;br /&gt;In the case that you are using a custom board, could you confirm for me whether you have reverse current protection, and in that case which type of reverse current protection you are using?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/267093?ContentTypeID=1</link><pubDate>Sun, 30 Aug 2020 12:59:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bf513d5-c16f-48ac-bfda-0a13fd7462a1</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;Hi again!&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve been unsuccessful in trying to capture the ADC readings on RTT viewer with a board displaying this increase in power. While I keep trying to catch one red handed, I can pass the attached table onto you and hope it helps.&lt;/p&gt;
&lt;p&gt;What this table shows is as follows:&lt;/p&gt;
&lt;p&gt;1. Wake up, initiate the SAADC, calibrate it and take 5 measurements with 1ms sleep in between them.&lt;/p&gt;
&lt;p&gt;2. On the first measurement, save the ADC read value.&lt;/p&gt;
&lt;p&gt;3. Average the 5 measurements and report them as the battery %.&lt;/p&gt;
&lt;p&gt;4. Do the rest of the relevant logic (advertise, connect report measurements, other stuff and go to sleep for 10 minutes).&lt;/p&gt;
&lt;p&gt;repeat these steps.&lt;/p&gt;
&lt;p&gt;So, you might notice slight inconsistencies between the ADC value in the table and its matching battery %- that is because the SAADC value is the first read, which the battery% is the average of 5 readings.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Battery-increase-measurements-example.xlsx"&gt;devzone.nordicsemi.com/.../Battery-increase-measurements-example.xlsx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The saadc setup / configuration is as follows:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define ADC_REF_VOLTAGE_IN_MILLIVOLTS 600 //
#define DIODE_FWD_VOLT_DROP_MILLIVOLTS   270 //
#define ADC_RES_10BIT 1023 //
//#define ADC_RES_12BIT 4095 //
#define ADC_PRE_SCALING_COMPENSATION 6 //
#define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE) ((((ADC_VALUE)*ADC_REF_VOLTAGE_IN_MILLIVOLTS) / ADC_RES_10BIT) * ADC_PRE_SCALING_COMPENSATION)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The SAADC init function is this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfx_saadc_config_t saadc_config = NRFX_SAADC_DEFAULT_CONFIG;

    nrf_saadc_channel_config_t channel_config;

    err_code = nrfx_saadc_init(&amp;amp;saadc_config, saadc_event_handler);
    APP_ERROR_CHECK(err_code);
    channel_config           = (nrf_saadc_channel_config_t)NRFX_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_VDD);
    channel_config.reference = NRF_SAADC_REFERENCE_INTERNAL;
    channel_config.gain      = NRF_SAADC_GAIN1_6;
    channel_config.acq_time  = NRF_SAADC_ACQTIME_40US;

    err_code = nrfx_saadc_channel_init(HAL_SAADC_VBAT_CHANNEL, &amp;amp;channel_config);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you need anything else, I&amp;#39;d rather we switch the ticket to private before sharing more specific code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/266659?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 09:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:135bb8af-ed03-4602-988b-69588d89ad85</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="A.P"]Here is the linearization scheme as it is in our code, as well as the discharge curve for the batteries we use.[/quote]
&lt;p&gt;Thank you for providing it. This linearization is the exact one we use in our cr2032 dependent battery service examples.&lt;br /&gt;To my knowledge there has never been an issue before in which the readings have increased so steadily.&lt;br /&gt;With your configuration I would expect ~8 ENOB, with the remaining being noise.&lt;br /&gt;Could you perhaps increase the resolution to 12 bit, and see if you are seeing the same fluctuations?&lt;br /&gt;&lt;br /&gt;Could you also share with me the saadc setup / configuration and usage code?&lt;br /&gt;So I may see how the aquired samples are processed.&lt;/p&gt;
[quote user="A.P"]I&amp;#39;ve yet to capture an increasing battery % while recording the SAADC readout, so I&amp;#39;ll try and get that to you as soon as I catch it.[/quote]
&lt;p&gt;Great, I look forward to seeing the results, thanks!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/266528?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 13:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fbe879d-ade7-4054-9279-3062bb3c357a</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;Hi Karl!&lt;br /&gt;&lt;br /&gt;Here is the linearization scheme as it is in our code, as well as the discharge curve for the batteries we use. I&amp;#39;ve yet to capture an increasing battery % while recording the SAADC readout, so I&amp;#39;ll try and get that to you as soon as I catch it.&lt;br /&gt;&lt;br /&gt;Here is something to get things rolling&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Sener-CR2032.pdf"&gt;devzone.nordicsemi.com/.../Sener-CR2032.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Linearization scheme:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static __INLINE uint8_t battery_level_in_percent(const uint16_t mvolts)
{
    uint8_t battery_level;

    if (mvolts &amp;gt;= 3000)
    {
        battery_level = 100;
    }
    else if (mvolts &amp;gt; 2900)
    {
        battery_level = 100 - ((3000 - mvolts) * 58) / 100;
    }
    else if (mvolts &amp;gt; 2740)
    {
        battery_level = 42 - ((2900 - mvolts) * 24) / 160;
    }
    else if (mvolts &amp;gt; 2440)
    {
        battery_level = 18 - ((2740 - mvolts) * 12) / 300;
    }
    else if (mvolts &amp;gt; 2100)
    {
        battery_level = 6 - ((2440 - mvolts) * 6) / 340;
    }
    else
    {
        battery_level = 0;
    }

    return battery_level;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/266047?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 14:59:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e93ed4a-667b-4dd4-a7bf-bf4998d441fe</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="A.P"]Have I accidentally created a Perpetuum mobile device[/quote]
&lt;p&gt;Now that would have been quite the marvel!&lt;br /&gt;Sadly, I fear that this is related to the SAADC configuration and usage, more so than a sure-fire Nobel physics prize.&amp;nbsp;&lt;br /&gt;While the output may not be Nobel-grade, it is still some interesting percentages you are seeing, with a particular device seemingly increasing in power.&lt;/p&gt;
[quote user="A.P"]The only thing I can think of is that during the night the air conditioner is turned off, so some change in temperature is to be expected. However, I don&amp;#39;t expect the temperature to change by much. Lets say about 10 degrees C.[/quote]
&lt;p&gt;Temperature is the biggest cause of offset error, but you say you calibrate it before every measurement, so that should be fine.&lt;br /&gt;Could you share with me the exact implementation of your battery discharge curve model?&lt;br /&gt;Perhaps could you also provide the raw SAADC readouts, so that I may see that fluctuation in the measurements directly.&lt;br /&gt;&lt;br /&gt;With your configuration I would expect some LSB fluctuation in your SAADC output - and if your linearized discharge curve is incorrect, it might be the source of these wild measurements ( i.e it is just coincidental that the measurements seems to be increasing ).&lt;br /&gt;&lt;br /&gt;Looking forward to getting to the bottom of this!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/265881?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 07:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03aa8031-1963-400b-af07-5dd61a68da12</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;I&amp;#39;ve observed the same behavior in other devices. They may take longer, or rise by a different amount, but a steady increase in battery over the span of a few hours, maybe days does occur in a few of my devices.&lt;/p&gt;
&lt;p&gt;Have I accidentally created a Perpetuum mobile device &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/265545?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 12:01:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5b30654-883b-47dd-8f5a-68492c51cdf1</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;Hi Karl!&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve added the two points we&amp;#39;ve discussed to my code-&lt;br /&gt;1. I now calibrate the SAADC upon initialization, which means on every wake-up, before the ADC measurement is performed.&lt;br /&gt;2. I&amp;#39;ve eliminated the possibility of measuring after advertising. I now measure only before advertising and before any peripherals draw current.&lt;/p&gt;
&lt;p&gt;I ran ~10 devices throughout the night and read the battery values every 10 minutes or so. The result is that I see much more stable values from my ADC reads, which is good news. One device does seem peculiar in that it seems to report an increase in power. The measurements are very consistent, but they rise by from ~40% to ~70%&amp;nbsp; in about 10 hours, then start dipping again.&lt;/p&gt;
&lt;p&gt;Here are the results, they are measured every ~10 minutes, the SAADC is calibrated before each measurement.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;table style="border:none;border-collapse:collapse;font-family:Arial;font-size:10pt;table-layout:fixed;width:0px;" dir="ltr" border="1" cellpadding="0" cellspacing="0"&gt;&lt;colgroup&gt;&lt;col width="100" /&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;vertical-align:bottom;"&gt;Battery %&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;38&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;41&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;43&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;43&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;46&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;47&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;51&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;51&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;48&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;51&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;53&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;57&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;62&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;62&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;57&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;62&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;57&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;62&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;61&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;61&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;66&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;66&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;70&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;57&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height:21px;"&gt;
&lt;td style="overflow:hidden;padding:2px 3px 2px 3px;text-align:right;vertical-align:bottom;"&gt;59&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The only thing I can think of is that during the night the air conditioner is turned off, so some change in temperature is to be expected. However, I don&amp;#39;t expect the temperature to change by much. Lets say about 10 degrees C.&lt;/p&gt;
&lt;p&gt;Do you have any other ideas I could test?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/264870?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 12:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f555706-8f46-427b-9c3f-1d25226160e4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="A.P"]I&amp;#39;m not performing calibration before sampling, I&amp;#39;ll try adding it to my flow so it will occur upon initialization of the SAADC.[/quote]
&lt;p&gt;Great! This is recommended practice.&lt;/p&gt;
[quote user="A.P"]What I meant by &amp;#39;relevant peripherals&amp;#39; is that I do perform some operations before sampling the battery, but I don&amp;#39;t think they are relevant as they should not draw any significant power. For example, I feed the watchdog, check some flags, configure some GPIOs to input/output etc.[/quote]
&lt;p&gt;Well, any peripheral that draws current at the time of measurement could offset your samples.&lt;br /&gt;For example as Turbo mentions, logging does exactly this. Another big source of error here could be if the radio was active at the time of sampling - this would most definitely offset your CR2032 measurements.&lt;/p&gt;
[quote user="A.P"]I&amp;#39;ll add all of these to my code, test it and let you know if this fixes the problem.[/quote]
&lt;p&gt;I look forward to hearing if this resolves your issues, please let me know!&lt;/p&gt;
[quote user="A.P"]In the meantime, I noticed there is an SAADC &amp;#39;version 2&amp;#39; in SDK 17.0.0 (nrfx_saadc_v2). Could you explain what the difference is between version1 and version 2 please? Could version 2 help me get more accurate results? and are there any examples using SAADC version 2?[/quote]
&lt;p&gt;There is indeed a SAADC version 2 in the SDK 17, yes. This is nrfx v2.2. The main difference here is that the newest driver is easier to understand, more intuitive both in naming and function.&lt;br /&gt;Performance-wise it is the same, so it will not increase your accuracy.&lt;br /&gt;If you are already familiar with the nrfx_saadc v1 then you might just very well continue using it, but then I would also think that you will appreciate the improved naming of the updated version.&lt;br /&gt;Unfortunately there are no examples using the SAADC version 2 driver as of yet, sorry.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/264703?ContentTypeID=1</link><pubDate>Sun, 16 Aug 2020 09:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6959a37-05a5-43c5-aed0-596ddcbc48ec</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Put an oscilloscope on the battery and watch the voltage fluctuating wildly.&lt;/p&gt;
&lt;p&gt;Reason: CR2032 has significant internal resistance.&lt;/p&gt;
&lt;p&gt;Note that logging via UART consumes about 1mA constant, and RTT may consume even more (the JLink debug connection disables sleep).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/264701?ContentTypeID=1</link><pubDate>Sun, 16 Aug 2020 08:36:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:696dc499-9e88-4610-a579-0bc33aade7cb</guid><dc:creator>A.P</dc:creator><description>&lt;p&gt;Hi Karl!&lt;br /&gt;&lt;br /&gt;I&amp;#39;m not performing calibration before sampling, I&amp;#39;ll try adding it to my flow so it will occur upon initialization of the SAADC.&lt;/p&gt;
&lt;p&gt;What I meant by &amp;#39;relevant peripherals&amp;#39; is that I do perform some operations before sampling the battery, but I don&amp;#39;t think they are relevant as they should not draw any significant power. For example, I feed the watchdog, check some flags, configure some GPIOs to input/output etc.&lt;/p&gt;
&lt;p&gt;I had considered oversampling, but after sampling 5 consecutive times (with 1 ms in between each sample) and getting more or less the same result, I&amp;#39;ve concluded that the sampling is relatively consistent within a short period of time.&lt;/p&gt;
&lt;p&gt;I have found a scenario where if a few conditions are met, I sample the battery (again) after having advertised for a minute or more. So I need to issue a fix for this and test if this helps solve the problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll add all of these to my code, test it and let you know if this fixes the problem.&lt;/p&gt;
&lt;p&gt;In the meantime, I noticed there is an SAADC &amp;#39;version 2&amp;#39; in SDK 17.0.0 (nrfx_saadc_v2). Could you explain what the difference is between version1 and version 2 please? Could version 2 help me get more accurate results? and are there any examples using SAADC version 2?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent battery measurement</title><link>https://devzone.nordicsemi.com/thread/264458?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 12:11:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b76cd9e-463c-4702-b9fd-270528636094</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;That does sound strange.&lt;/p&gt;
[quote user=""]While I understand the curve may be inaccurate in terms of it matching reality for my specific battery, I should still expect it to give me consistent readouts- i.e, that the battery % values given should be ballpark accurate, should not increase sporadically, with minor fluctuations etc.[/quote]
&lt;p&gt;Your understanding here is correct, the measurements should be fairly accurate - accurate enough for most use-cases. The fluctuations you are seeing is larger than expected.&lt;/p&gt;
[quote user=""]its only between different reads in different wake ups, where I see this large gap between measurements.[/quote]
&lt;p&gt;Are you performing a calibration before you begin sampling? It is recommended to perform a calibration upon every initialization of the SAADC, and when there has been a significant change in temperature.&lt;/p&gt;
[quote user=""]No relevant peripherals draw current until after the SAADC read is completed.[/quote]
&lt;p&gt;What do you mean by &amp;#39;relevant&amp;#39; here?&lt;br /&gt;&lt;br /&gt;The fluctuations you are seeing might indeed be the result of another peripheral / the SoftDevice drawing a lot of power right at the time of sampling.&lt;br /&gt;You say that nothing else is happening on the device when the measurement is taking -&amp;nbsp; how have you verified this?&lt;br /&gt;Is the SoftDevice enabled?&lt;br /&gt;How many samples are you basing the BAS update on? You might benefit from taking multiple samples over a small period, or enabling oversampling for this.&lt;br /&gt;&lt;br /&gt;Looking forward to resolve this issue together!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>