<?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>Battery measurement when charging?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73917/battery-measurement-when-charging</link><description>Is there a way only from the analog input where measure the battery voltage to distinguish that battery is charging? 
 I am short on IOs and will be quite a challenge to find extra input to hook a charging signal from the charging IC or the USB connector</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Apr 2021 07:59:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73917/battery-measurement-when-charging" /><item><title>RE: Battery measurement when charging?</title><link>https://devzone.nordicsemi.com/thread/304998?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 07:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1850c3e4-dab0-4dc3-9f26-471e0093e0f7</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="samsam"]The voltage divider (both schematic and values) are the same as &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/measuring-lithium-battery-voltage-with-nrf52"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/measuring-lithium-battery-voltage-with-nrf52&lt;/a&gt;&amp;nbsp;- second schematic (with capacitor)[/quote]
&lt;p&gt;Oh, thank you for clarifying this! If the voltage divider is wired the same way as in the blogpost schematic, you can measure the voltage of your battery directly - like explained in the blogpost.&lt;br /&gt;This makes me unsure if I might have misunderstood some part of your question - since this is exactly what is explained in the blogpost?&lt;/p&gt;
[quote user="samsam"]I’m short on IOs and in order to use an extra input for this purpose, I’ll have to sacrifice some other functionality&amp;nbsp;&lt;span title="Frowning2"&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2639.svg" alt="Frowning2" /&gt;&lt;/span&gt;[/quote]
&lt;p&gt;Aha, I see. Well, if your schematic is as in the tutorial, you can sample the voltage of your battery as shown in the tutorial. You will then have to implement some logic that determines with high enough accuracy and any real-time constraints your application may have, whether the voltage is rising or falling, to determine whether the battery is charging or not.&lt;/p&gt;
[quote user="samsam"]P.S. devzone again behaves weird - I don&amp;#39;t have &amp;quot;Reply&amp;quot; button to answer your last posting, so had to &amp;quot;Reply&amp;quot; myself on older posting. This problem runs couple years already I think :( Cant it be fixed?[/quote]
&lt;p&gt;Yes, this is a known issue for some time now, unfortunately..&lt;br /&gt;A workaround is to click the timestamp of the comment you are interested in replying to - this should make all the options for the comment show up. This is far from ideal, and we hope to have this fixed soon, you and me both!&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: Battery measurement when charging?</title><link>https://devzone.nordicsemi.com/thread/304896?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 15:19:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae164d7-2a94-437f-80c5-697e163eda15</guid><dc:creator>samsam</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;The voltage divider (both schematic and values) are the same as &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/measuring-lithium-battery-voltage-with-nrf52"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/measuring-lithium-battery-voltage-with-nrf52&lt;/a&gt;&amp;nbsp;- second schematic (with capacitor)&lt;/p&gt;
&lt;p&gt;I know that MCP73831 (bq24092 also) has &amp;nbsp;status output, but I already wrote in my very first posting &amp;ndash; I&amp;rsquo;m short on IOs and in order to use an extra input for this purpose, I&amp;rsquo;ll have to sacrifice some other functionality&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/2639.svg" title="Frowning2"&gt;&amp;#x2639;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;P.S. devzone again behaves weird - I don&amp;#39;t have &amp;quot;Reply&amp;quot; button to answer your last posting, so had to &amp;quot;Reply&amp;quot; myself on older posting. This problem runs couple years already I think :( Cant it be fixed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery measurement when charging?</title><link>https://devzone.nordicsemi.com/thread/304705?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 07:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f070a52-433f-4ff2-86d8-89923df6b01e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="samsam"]The device is nRF52840, but the problem is that between battery and nRF I have an external 3.3V voltage regulator.[/quote]
&lt;p&gt;Thank you for clarifying, this is very helpful to know.&lt;/p&gt;
[quote user="samsam"]The only direct connection between the battery (LiIon 3.7V) is the voltage divider that is hooked to AI0[/quote]
&lt;p&gt;How is this voltage divider connected to your AIN0 pin?&lt;br /&gt;Please be advised that the absolute maximum rating for voltage on the I/O pins with VDD &amp;lt; 3.6 V is VDD + 0.3 V, so if you are letting the battery&amp;#39;s 3.7 V directly to the AIN0 pin these limits are exceeded and might permanently damage the chip.&lt;/p&gt;
[quote user="samsam"]so I was interested if there is some algorithm that by just only reading analog input can distinguish if battery is charging or is full (4.2V)?&amp;nbsp; My charging chips are MCP73831 or bq24092.[/quote]
&lt;p&gt;Yes, but this will depend on how your analog input is wired to your battery circuit. You could then measure how the voltage of the battery changes over time, and use this to deduce what the charger is doing.&lt;br /&gt;Better yet, I skimmed quickly through the MCP73831 datasheet, and it seems to me that it comes with a&amp;nbsp;&lt;em&gt;Charge Status Output&amp;nbsp;&lt;/em&gt;feature that can be used to determine the current state of the charging.&lt;br /&gt;Have you looked into making use of this for your application?&amp;nbsp;&lt;br /&gt;&amp;nbsp;&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: Battery measurement when charging?</title><link>https://devzone.nordicsemi.com/thread/304656?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 16:37:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82bad26d-cb80-4df8-9d65-6b86d8ec438a</guid><dc:creator>samsam</dc:creator><description>&lt;p&gt;Hello, The device is nRF52840, but the problem is that between battery and nRF I have an external 3.3V voltage regulator. The only direct connection between the battery (LiIon 3.7V) is the voltage divider that is hooked to AI0, so I was interested if there is some algorithm that by just only reading analog input can distinguish if battery is charging or is full (4.2V)?&amp;nbsp; My charging chips are MCP73831 or bq24092.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery measurement when charging?</title><link>https://devzone.nordicsemi.com/thread/304418?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 07:37:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d54875c-05ab-495a-9621-2575ae877647</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Which device are you working with?&lt;br /&gt;The SAADC may measure the VDD bus directly through configuring the channel to measure VDD or VDDHDIV5.&lt;br /&gt;This will not require any external routing or wiring. You can try this in &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/nrf_dev_saadc_example.html"&gt;the SAADC example&lt;/a&gt; by changing the channel configuration set with&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fgroup__nrfx__saadc.html&amp;amp;anchor=gad0786760626db89142b8216320f223c8"&gt;NRFX_SAADC_DEFAULT_CONFIG_SE&lt;/a&gt;&amp;nbsp;to use the SAADC input NRF_SAADC_INPUT_VDD instead of _AIN0.&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></channel></rss>