<?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>Reading NRF52840 DK battery level</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108068/reading-nrf52840-dk-battery-level</link><description>Hello, I am trying to read the battery level form the development kit from the nrf52840. At first I was trying to use the bas service, but, does this work? Also, I saw some questions in the forum, from 3 years ago, and it is mentioned that it can not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Feb 2024 14:19:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108068/reading-nrf52840-dk-battery-level" /><item><title>RE: Reading NRF52840 DK battery level</title><link>https://devzone.nordicsemi.com/thread/470293?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 14:19:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3d7d361-c14b-4457-b10c-325b5a1ee6be</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, please create a new ticket for these questions, as they are not related to the topic of this thread.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading NRF52840 DK battery level</title><link>https://devzone.nordicsemi.com/thread/470230?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 11:55:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05f893cf-7d16-4c12-b140-cd0cd546397b</guid><dc:creator>Adrian1504</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;J&amp;oslash;rgen,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much for your answer.&lt;/p&gt;
&lt;p&gt;I will be trying this, but some other doubts came while working. I guess I will have to make another ticket for this:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;How can i test the data transmission rate of the nrf52840?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which is the best way of sending the data read from a sensor?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading NRF52840 DK battery level</title><link>https://devzone.nordicsemi.com/thread/468258?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 15:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d540dcd7-83d6-4ced-85c8-f775fdcbabec</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Adrian,&lt;/span&gt;&lt;/p&gt;
[quote user="Adrian1504"]Is it in here where the Proximity application will be? Because with my current version I don&amp;#39;t seem to find the sample.&amp;nbsp;[/quote]
&lt;p&gt;No, the proximity application is only available in nRF5 SDK (our old SDK in maintenance mode). If you are already using nRF Connect SDK (the new SDK variant that will support new features) you should stick with this and not try to use the examples from nRF5 SDK.&lt;/p&gt;
&lt;p&gt;In nRF Connect SDK, I&amp;#39;m not aware of any simple example showing both battery measurements and the BLE battery service, but there is a &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/v3.4.99-ncs1-2/samples/boards/nrf/battery"&gt;battery sample&lt;/a&gt; that you can use as a starting point. You need to create an overlay file for the board you are using (for instance &amp;quot;nrf52840dk_nrf52840.overlay&amp;quot; placed in the root of the sample directory) and fill it with the &amp;quot;zephyr,user&amp;quot; node as described in the sample readme. By default, this sample does not support VDDHDIV5, only the standard &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1-2/samples/boards/nrf/battery/src/battery.c#L129"&gt;VDD input&lt;/a&gt;, but you should be able to change this to&amp;nbsp;SAADC_CH_PSELP_PSELP_VDDHDIV5 in the code. If you want to use BAS to transfer the battery level over BLE, it is quite simple to use this service in nRF Connect SDK, see for instance how it is done in the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5.2/samples/bluetooth/peripheral_hids_keyboard/src/main.c#L920-L931"&gt;Peripheral HIDS: Keyboard sample&lt;/a&gt; (with dummy battery levels).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading NRF52840 DK battery level</title><link>https://devzone.nordicsemi.com/thread/468036?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2024 11:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd6911c5-8464-43d2-95bb-5d5e94d28e17</guid><dc:creator>Adrian1504</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;J&amp;oslash;rgen,&lt;br /&gt;&lt;br /&gt;Thank you for your answer. I have the nRF Connect SDK v2.4.1, now that I entered the toolchain manager I see that there is a v2.5.2, Is it in here where the Proximity application will be? Because with my current version I don&amp;#39;t seem to find the sample.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For measuring with the SAADC it means I have to read from&amp;nbsp;&lt;/p&gt;
&lt;table id="register.CH-0-7.PSELP__CH-0-7.PSELP" class="table register long" border="1" cellpadding="4" cellspacing="0" frame="border" rules="all" summary=""&gt;
&lt;tbody class="tbody"&gt;
&lt;tr class="row"&gt;
&lt;td class="entry row-nocellborder" colspan="1" headers="d1381047e19267 d1381047e19374 d1381047e19454 d1381047e19570" rowspan="1"&gt;
&lt;p class="p"&gt;VDDHDIV5&lt;/p&gt;
&lt;/td&gt;
&lt;td class="entry row-nocellborder" colspan="8" headers="d1381047e19270 d1381047e19273 d1381047e19276 d1381047e19279 d1381047e19283 d1381047e19286 d1381047e19289 d1381047e19292 d1381047e19377 d1381047e19379 d1381047e19381 d1381047e19383 d1381047e19386 d1381047e19388 d1381047e19390 d1381047e19392 d1381047e19457 d1381047e19460 d1381047e19463 d1381047e19466 d1381047e19470 d1381047e19473 d1381047e19476 d1381047e19479 d1381047e19573" rowspan="1"&gt;
&lt;p class="p"&gt;0x0D&lt;/p&gt;
&lt;/td&gt;
&lt;td class="entry row-nocellborder" colspan="20" headers="d1381047e19295 d1381047e19298 d1381047e19302 d1381047e19305 d1381047e19308 d1381047e19311 d1381047e19314 d1381047e19317 d1381047e19321 d1381047e19324 d1381047e19327 d1381047e19330 d1381047e19333 d1381047e19336 d1381047e19340 d1381047e19343 d1381047e19346 d1381047e19349 d1381047e19352 d1381047e19355 d1381047e19394 d1381047e19396 d1381047e19399 d1381047e19401 d1381047e19403 d1381047e19405 d1381047e19407 d1381047e19409 d1381047e19412 d1381047e19414 d1381047e19416 d1381047e19418 d1381047e19420 d1381047e19422 d1381047e19425 d1381047e19427 d1381047e19429 d1381047e19431 d1381047e19433 d1381047e19435 d1381047e19482 d1381047e19485 d1381047e19489 d1381047e19492 d1381047e19495 d1381047e19498 d1381047e19501 d1381047e19504 d1381047e19508 d1381047e19511 d1381047e19514 d1381047e19517 d1381047e19520 d1381047e19523 d1381047e19527 d1381047e19530 d1381047e19533 d1381047e19536 d1381047e19539 d1381047e19542 d1381047e19577" rowspan="1"&gt;
&lt;p class="p"&gt;VDDH/5&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;?&lt;/p&gt;
&lt;p&gt;It would be reading the analog value?&lt;/p&gt;
&lt;p&gt;Sorry for the questions, I am literally starting in this embedded software world.&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Adrian Lopez&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading NRF52840 DK battery level</title><link>https://devzone.nordicsemi.com/thread/467615?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2024 15:02:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c65eb2b0-2ca8-41cc-9a3c-906f617e3b6c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which SDK variant are you using? Bluetooth BAS service does not sample battery level on its own, this needs to be handled in the application and supplied to the battery service to update the battery level over BLE.&lt;/p&gt;
&lt;p&gt;In nRF5 SDK, there is an example,&amp;nbsp;&lt;a title="Proximity Application" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_proximity.html?cp=9_1_4_2_2_21"&gt;Proximity Application&lt;/a&gt;, that implements BAS along with actual battery level reading from the VDD input of the chip.&lt;/p&gt;
[quote user=""]Also, I saw some questions in the forum, from 3 years ago, and it is mentioned that it can not be read directly in the DK, but we need to do a voltage&amp;nbsp;divisor to bring the voltage from the battery to a gpio port.[/quote]
&lt;p&gt;The nRF52840 SAADC supports direct sampling of both VDD and VDDH/5 inputs, as mentioned in the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html#register.CH-0-7.PSELP"&gt;input pin configuration register&lt;/a&gt;. If you are powering the chip in normal voltage mode directly from a small battery (for instance a 3V coin cell) or through high-voltage mode directly from a battery (for instance a 3.7V Li-Po battery), you should be able to measure battery voltage without any external circuitry. You will need to create a battery profile for the battery in use in your application, to convert the voltage to battery level.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>