<?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>DK coin cell tester</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36375/dk-coin-cell-tester</link><description>Looking to make the nrf52 DK into a CR2032 coin cell battery tester. I tried a couple of sdk 15.0 examples, uart, proximity and another from a devzone case but not really getting the actual values but something like 100% or 0x64 with no external USB,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jul 2018 03:40:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36375/dk-coin-cell-tester" /><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/141440?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 03:40:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9406bf0-8293-4d2f-b8ab-655e35c1aa8a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Those steps worked out better, now getting around 0x04 on the weak coin.&lt;/p&gt;
&lt;p&gt;-thank-you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/141402?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 16:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fcab6db-10f3-49da-9074-64860116300c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think I figured out what&amp;#39;s going on:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The initial battery value is always set to 100 during startup inside bas_init().&lt;/li&gt;
&lt;li&gt;The actual battery level is never measured unless you are in a connection &lt;em&gt;and&lt;/em&gt; have enabled CCCD on the battery service.&lt;/li&gt;
&lt;li&gt;When you enable CCCD a timer is started inside on_bas_evt().&lt;/li&gt;
&lt;li&gt;After a&amp;nbsp;120 second delay the battery voltage is finally measured and the characteristic updated.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can try some of this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Connect, enable CCCD, and wait.&lt;/li&gt;
&lt;li&gt;Start the battery timer with&lt;code&gt;&amp;nbsp;app_timer_start(m_battery_timer_id, BATTERY_LEVEL_MEAS_INTERVAL, NULL);&lt;/code&gt;&amp;nbsp;somewhere at the start of your application to make it do periodic battery measurements whether you are in a connection or not.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Lower the value of BATTERY_LEVEL_MEAS_INTERVAL to make the example sample the battery more often.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/141227?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 01:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc9cdb47-4c91-4a79-b301-412aa6f3d16c</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I missed that NRF_SAADC_INPUT_VDD condition thinking SAADC is only through the pin.&lt;/p&gt;
&lt;p&gt;Tried sdk15.0&amp;nbsp; proximity&amp;nbsp;sample s132 hex file on the DK using a coin with only a 2.55 V charge, and 0x64 is coming across on connect for iOS. &lt;br /&gt;If anything should show something closer to 0x00.&lt;br /&gt;Maybe missing something in the steps if out of the box (hex) works?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/141103?ContentTypeID=1</link><pubDate>Tue, 24 Jul 2018 08:43:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3592486-c33c-492c-a7f8-2a9f6126ea54</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Your example looks like its trying to run off a SAADC pin&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;What makes you say that? It uses VDD as input:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void saadc_init(void)
{
    ret_code_t err_code;

    nrf_saadc_channel_config_t channel_config =     {                                                  \
        .resistor_p = NRF_SAADC_RESISTOR_DISABLED,     \
        .resistor_n = NRF_SAADC_RESISTOR_DISABLED,     \
        .gain       = NRF_SAADC_GAIN1_6,               \
        .reference  = NRF_SAADC_REFERENCE_INTERNAL,    \
        .acq_time   = NRF_SAADC_ACQTIME_10US,          \
        .mode       = NRF_SAADC_MODE_SINGLE_ENDED,     \
        .burst      = NRF_SAADC_BURST_DISABLED,        \
        .pin_p      = (nrf_saadc_input_t)(NRF_SAADC_INPUT_VDD), \ // &amp;lt;- USING VDD AS INPUT
        .pin_n      = NRF_SAADC_INPUT_DISABLED         \
    };
    ....&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Anyway, I wasn&amp;#39;t aware that the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/ble_sdk_app_proximity.html?cp=4_0_0_4_1_2_21"&gt;ble_app_proximity&lt;/a&gt;&amp;nbsp;example uses the SAADC for battery measurements, but I just tested it and it seems to work out of the box and provides real battery level data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the example uses &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__app__util.html#ga8902704fe018646ace7d303994320f45"&gt;this function&lt;/a&gt; to convert the ADC voltage to a value between 0-100%. And 100 dec = 0x64 hex. Hence, when you say that the value is always 0x64 it indicates that you just have a good battery. If your coin cell provides a voltage lower than ~2.4 V on the other hand, it might be that the function actually always returns 0 %.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/140466?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 23:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0c27bbf-73c9-4403-a765-28744334f941</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Your example looks like its trying to run off a SAADC pin (this example in Keil exceeds limit and trying to port to SES is erroring out, hex seems ok but always 0x64).&lt;/p&gt;
&lt;p&gt;This &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/11840/how-to-measure-the-coin-cell-battey-voltage-in-real" rel="noopener noreferrer" target="_blank"&gt;case&lt;/a&gt; is referring to the proximity example&amp;nbsp;and&amp;nbsp;suggesting to not use the&amp;nbsp;SAADC pin &amp;quot;as the chip can connect VDD to the ADC input internally&amp;quot; to check battery output.&lt;br /&gt;Then trying proximity for SES sdk15.0, on a DK with only a coin, the values on nrf connect are a constant 0x00.&lt;/p&gt;
&lt;p&gt;Just looking for a confirmation that by using the proximity example on the DK the battery service should show values according to the coin output and not 0x00.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/140331?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 08:08:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b998e56-f9c3-4009-9a25-8341256bc0ec</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I managed to dig up an example that I made a while ago that shows how you can measure battery voltage and use the battery service. It is for SDK 14.0.0.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f653a17417be4fdaaf82ae934809d375/ble_5F00_app_5F00_battery_5F00_service.7z"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_battery_5F00_service.7z&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/140300?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 00:23:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8938052-bdb6-45ab-ad55-c5dd2725fc5f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;m trying sdk 12.2 Keil from that devzone case link above for pca10040 DK.&lt;br /&gt;(wanted to see if I could get it working for 12.2 before updating to SES sdk 15.0)&lt;br /&gt;It does not seem to budge from 0x64. &lt;br /&gt;(less charged coins don&amp;#39;t seem to be able to power the DK but same coin ok on custom 810, hence this task to view the charge)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_uart_2D00_1.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart_2D00_1.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DK coin cell tester</title><link>https://devzone.nordicsemi.com/thread/140268?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 16:44:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:177025c3-6f97-48cf-a98d-de101a889d18</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Do you always get 100% or does the values vary over time? Can you post your code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>