<?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>adc Calculation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22679/adc-calculation</link><description>AD value and voltage conversion between the calculation formula 
 adc_config.resolution = NRF_ADC_CONFIG_RES_10BIT;
adc_config.scaling = NRF_ADC_CONFIG_SCALING_INPUT_ONE_THIRD;
adc_config.reference = NRF_ADC_CONFIG_REF_VBG;
 
nrf_adc_configure(&amp;amp;adc_config</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Dec 2019 09:16:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22679/adc-calculation" /><item><title>RE: adc Calculation</title><link>https://devzone.nordicsemi.com/thread/226308?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2019 09:16:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb8c2c17-4a92-4b63-a00e-b1f460275abe</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;ADC_SCALING is determined by the SAADC GAIN configuration.&lt;/p&gt;
&lt;p&gt;If you use printf() to print data to UART, you can use the float directly as a parameter to &amp;quot;%f&amp;quot; format string.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adc Calculation</title><link>https://devzone.nordicsemi.com/thread/226221?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2019 18:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd53db30-5106-4780-8c5d-0b5659f26943</guid><dc:creator>Sundar_santhanam@1998</dc:creator><description>&lt;p&gt;And also after obtaining the Voltage how do I display that float value in UART?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adc Calculation</title><link>https://devzone.nordicsemi.com/thread/226220?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2019 18:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7feb05bf-8889-46dd-be34-d9cb7441db2b</guid><dc:creator>Sundar_santhanam@1998</dc:creator><description>&lt;p&gt;Hi what is meant by&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ADC_SCALING ?&lt;br /&gt;&lt;br /&gt;I am using (nRF52840)IR sharp sensor to calculate voltage from adc values.&lt;br /&gt;Please tell me the formula to use if possible. I am using default saadc example code.&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adc Calculation</title><link>https://devzone.nordicsemi.com/thread/89154?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 08:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2e197e1-dbf8-4876-a998-c399ec177308</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You should be able to use &lt;a href="https://github.com/NordicSemiconductor/nrf51-ADC-examples/blob/master/ble_app_hrs_adc_battery_measurement/main.c#L105"&gt;this formula&lt;/a&gt; when calculating the voltage from ADC result.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;V = (((ADC_VALUE * ADC_REF_VOLTAGE) / (2^(ADC_RESOLUTION)-1)) / ADC_SCALING) V
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For your settings this will give:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;V = (((ADC_VALUE * 1.2) / (1023)) / (1/3)) V

V = (((ADC_VALUE * 1.2) / (1023)) * 3) V
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>