<?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>I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6449/i-want-to-measurement-battery-level</link><description>(I use nrf51822) 
 I use two 3V batteries in series. 
 Therefore Input Voltage of My Circuit is 6V. 
 My own source was coded as a collection of information. 
 Oh, by the way, I used a battery is Cr2032 Coin Cell. 
 Looking for information on a coin</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Apr 2015 22:09:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6449/i-want-to-measurement-battery-level" /><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22496?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 22:09:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae25602a-932b-4fcc-8d1d-f537e14d592a</guid><dc:creator>wojc0008</dc:creator><description>&lt;p&gt;Just use a voltage regulator (or an LDO to drop to 3.3V and run them both at 3.3V.  If you have the budget available, a switching regulator is a better way to go to run the system at 3.3V.&lt;/p&gt;
&lt;p&gt;If it was me, I would parallel the batteries and use a simple boost regulator to drive the LEDs like the TPS61220 (very simple circuit) &lt;a href="http://www.ti.com/product/tps61220"&gt;www.ti.com/.../tps61220&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or an even easier circuit (no inductor, just capacitors), &lt;a href="http://www.ti.com/product/tps60310"&gt;www.ti.com/.../tps60310&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Jamie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22494?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 10:16:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e423a87-59b1-4ad8-83b3-99b1ca3daf3c</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;5.49 MOhm is too large. You can use lower resistance, but then the battery will be empty really fast. Therefore, you must use a voltage regulator. A voltage regulator INSTEAD of the voltage divider.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22493?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 09:58:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5970fff2-2855-436a-86ab-a47268eea1e5</guid><dc:creator>GunMin</dc:creator><description>&lt;p&gt;I use CR2032 Coin cell(3v).&lt;/p&gt;
&lt;p&gt;but Working voltage of OLED is 3.3V.&lt;/p&gt;
&lt;p&gt;So I Used Two Coin cell.&lt;/p&gt;
&lt;p&gt;Would you say that to me 5.49 (Mega Ohm) and 6.71 (Mega Ohm) is unnecessary?&lt;/p&gt;
&lt;p&gt;And change to a lower resistance than it is now, I could add a voltage regulator?(In that part)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22495?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 08:26:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f36a65f-e2e8-4e11-8905-2b5a12174363</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Why are you using 6V if both the OLED and the nRF51 are running on 3.3V?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The AIN1 voltage divider is correct.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can not use a voltage divider to lower the voltage for the VCC of nRF51. You have to use a voltage regulator: &lt;a href="http://en.wikipedia.org/wiki/Voltage_regulator"&gt;en.wikipedia.org/.../Voltage_regulator&lt;/a&gt; . Have a look at the 5.49MOhm resistor: 6V / 5.49MOhm = 1.1uA. The resistor is too large to supply enough current to the nRF51. The nRF51 requires at least 16 mA when using the radio. So, you would need to lower the resistor values by a factor of tens of thousands. This would cause the resistors to burn up several mAmps all the time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22492?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 07:25:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1f48146-a17a-475a-9a53-6334a6a49d99</guid><dc:creator>GunMin</dc:creator><description>&lt;p&gt;I tried to configure the circuit again.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/12.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;I need  3.3V to nRF51822 and OLED.&lt;/p&gt;
&lt;p&gt;6V*(6.71M/(5.49M+6.71M)) = 3.3V&lt;/p&gt;
&lt;p&gt;If that minimum operating voltage of the OLED is 2.7V,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                             Max    Input        Min     Input
                             3.3V :   6V     =   2.7V :    x
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Therefore When the OLED is to use the minimum operating voltage, the input voltage is 4.9V.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;      - Maximum voltage:   6V*(2.2M/(2.2M+10M)) = 1.082V
      - Minimum voltage: 4.9V*(2.2M/(2.2M+10M)) = 0.884V
      - ADC value at 6V   - 10 bit setup: 1.082/1.2*1023 = 992
      - ADC value at 4.9V - 10 bit setup: 0.884/1.2*1023 = 754
      - Usable ADC resolution - 10 bit setup: 992-754 = 238
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And source are as follows:&lt;/p&gt;
&lt;p&gt;#define ADC_REF_VOLTAGE_IN_MILLIVOLTS        1200&lt;br /&gt;
#define ADC_PRE_SCALING_COMPENSATION      1&lt;br /&gt;
#define DIODE_FWD_VOLT_DROP_MILLIVOLTS       270&lt;/p&gt;
&lt;p&gt;#define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE)\&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    ((((ADC_VALUE) * ADC_REF_VOLTAGE_IN_MILLIVOLTS) / 255) * ADC_PRE_SCALING_COMPENSATION)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;static void adc_init(void){	

/* Enable interrupt on ADC sample ready event*/		
NRF_ADC-&amp;gt;INTENSET = ADC_INTENSET_END_Msk;   
sd_nvic_SetPriority(ADC_IRQn, NRF_APP_PRIORITY_LOW);  
sd_nvic_EnableIRQ(ADC_IRQn);

NRF_ADC-&amp;gt;CONFIG	= (ADC_CONFIG_EXTREFSEL_None &amp;lt;&amp;lt; ADC_CONFIG_EXTREFSEL_Pos) /* Bits 17..16 : ADC external reference pin selection. */
								| (ADC_CONFIG_PSEL_AnalogInput1&amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos)					/*!&amp;lt; Use analog input 1 as analog input. */
								| (ADC_CONFIG_REFSEL_VBG &amp;lt;&amp;lt; ADC_CONFIG_REFSEL_Pos)							/*!&amp;lt; Use internal 1.2V bandgap voltage as reference for conversion. */
								| (ADC_CONFIG_INPSEL_AnalogInputNoPrescaling&amp;lt;&amp;lt; ADC_CONFIG_INPSEL_Pos) /*!&amp;lt; Analog input specified by PSEL with no prescaling used as input for the conversion. */
								| (ADC_CONFIG_RES_10bit &amp;lt;&amp;lt; ADC_CONFIG_RES_Pos);									/*!&amp;lt; 10bit ADC resolution. */ 

/* Enable ADC*/
NRF_ADC-&amp;gt;ENABLE = ADC_ENABLE_ENABLE_Enabled;	           }
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;void ADC_IRQHandler(void){
uint8_t     adc_result;
uint16_t    batt_lvl_in_milli_volts;
 int percent;

/* Clear dataready event */
NRF_ADC-&amp;gt;EVENTS_END = 0;	

adc_result = (NRF_ADC-&amp;gt;RESULT);
batt_lvl_in_milli_volts  = ADC_RESULT_IN_MILLI_VOLTS(adc_result)+DIODE_FWD_VOLT_DROP_MILLIVOLTS;
percent = battery_level_in_pe


NRF_ADC-&amp;gt;TASKS_STOP = 1;



//Release the external crystal
sd_clock_hfclk_release();              }	
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Would not have a problem with as above?&lt;/p&gt;
&lt;p&gt;I wonder whether even such a way as above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22491?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 13:39:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a0eb930-8e41-43c5-83c8-a11950853e57</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;So, you would want to use a voltage divider at the input of the ADC to get as close to 0.6V as possible (Because of minimal current flow in to the ADC). You can check out this post to see how to make a voltage divider: &lt;a href="https://devzone.nordicsemi.com/blogs/30/measuring-lithium-battery-voltage-with-voltage-div/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The post also refers to some example code. Note that this is the voltage going in to one of the ADC input pins on the chip, not the supply voltage (VDD).&lt;/p&gt;
&lt;p&gt;For the supply voltage (VDD) you would need to use a voltage regulator in order to lower the voltage to within the operating conditions specified in the &lt;a href="https://www.nordicsemi.com/eng/nordic/download_resource/20339/13/41543646"&gt;nRF51822 Product Specification&lt;/a&gt; section 7.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22490?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 11:45:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d1109c0-d2be-46fa-8550-243f1751868a</guid><dc:creator>GunMin</dc:creator><description>&lt;p&gt;Oh.. Sorry, but not yet understood.&lt;/p&gt;
&lt;p&gt;If the maximum value of the voltage entering the port is 3.6V and the voltage going to the other device 5V, What is the measurement method?&lt;/p&gt;
&lt;p&gt;I have understood the contents as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;the voltage entering the board and another device is connected in parallel.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The voltage is put into a board made of 3.6V using a resistor. (Divided by 3.6V and 2.4V.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the voltage using the voltage drops, the voltage entering the board and another device (3.6V and 5V) will be the same is that ratio.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Therefore, if I want to know the remaining capacity of the battery, measures the voltage entering the board.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Did I understand the details are correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22489?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 09:08:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3bd7294-e8f3-49b6-a301-ee48f86f3077</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;It is the same question as you posted here right? &lt;a href="https://devzone.nordicsemi.com/question/33367/why-battery-level-is-always-100/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; Did you read my answer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22488?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 09:01:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f3522b7-b5c9-4763-95c2-2a7c7cee06be</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;So, you use 6V on the chip? You cannot do that. It is too much. 3.6V is maximum.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22487?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 03:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3351fafe-86ef-4022-b0ec-4cd4b66e184a</guid><dc:creator>GunMin</dc:creator><description>&lt;p&gt;I put the voltage to VCC_nRF of K1, uses the voltage output to the VTG.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22486?ContentTypeID=1</link><pubDate>Fri, 10 Apr 2015 11:50:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6f9f659-1635-4736-b287-2ef24b812eaf</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;What is the voltage in to the nRF51?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to measurement Battery level.</title><link>https://devzone.nordicsemi.com/thread/22485?ContentTypeID=1</link><pubDate>Fri, 10 Apr 2015 09:45:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6337a5b8-139b-40da-9d11-0a66a14aeae0</guid><dc:creator>GunMin</dc:creator><description>&lt;p&gt;Over time, The battery power level changes rapidly.
970 ~ 960 950  970 980 800 700  800 960  700 600 500 400 500 400 500 ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>