<?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>How to add Battery as a service in advertisement packet?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33980/how-to-add-battery-as-a-service-in-advertisement-packet</link><description>Hello, 
 I am running the ble_app_beacon example and want to add battery percentage in the advertising packets, how to do that. And is it possible for ble_app_beacon example to broadcast once every 5 mins i.e it will broadcast then it should go to sleep</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 May 2018 06:47:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33980/how-to-add-battery-as-a-service-in-advertisement-packet" /><item><title>RE: How to add Battery as a service in advertisement packet?</title><link>https://devzone.nordicsemi.com/thread/130724?ContentTypeID=1</link><pubDate>Thu, 03 May 2018 06:47:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65ccef29-3aa8-428a-87be-b5d0fa484ec7</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Good!&lt;/p&gt;
&lt;p&gt;app_timer uses RTC1 and you can configure the prescaler in sdk_config.h. If you set it to 31, then there are 1024 ticks per second. The RTC1&amp;#39;s count register is 24 bit wide so you can have 2^24 ticks / 1024 tics/sec / 60 sec/min ~= 273 minutes long intervals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That is the longest interval you can have using the app_timer library. If you configure the RTC yourself you can use a prescaler up to 4096 yielding only ~8 ticks per second enabling ~583&amp;nbsp;&lt;em&gt;hours&lt;/em&gt; long intervals. More info here:&amp;nbsp;&lt;a title="Resolution versus overflow and the PRESCALER" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=2_1_0_24_1#concept_iwc_1mj_sr"&gt;Resolution versus overflow and the PRESCALER&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Battery as a service in advertisement packet?</title><link>https://devzone.nordicsemi.com/thread/130562?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 13:02:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e6350ce-19ca-4b9b-98aa-de4b0f3ec236</guid><dc:creator>Nakul Nair</dc:creator><description>&lt;p&gt;Hi MartinBL,&lt;/p&gt;
&lt;p&gt;It worked thanks just one more question how long can we can configure the timer i.e what is maximum tick counts that can be given in APP_TIMER_TICKS()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Battery as a service in advertisement packet?</title><link>https://devzone.nordicsemi.com/thread/130494?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 09:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60b64dc8-72b7-4e04-ada9-485d22c66095</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use the ADC to measure the battery voltage. Depending on your battery type you can measure Vdd directly or, if Vdd is higher than 3.6 V, use an external voltage divider to scale the input voltage down to a safe level.&amp;nbsp;Then you can add the ADC value to the Manufacturer Specific Data field in the advertising packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use the app_timer library for example, to set up a timer that makes your device broadcast every 5 minutes.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>