<?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>AC (240V) current measurement using a CT with NRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52562/ac-240v-current-measurement-using-a-ct-with-nrf52832</link><description>I need to measure current of loads attached to NRF52832 using current transformer(CT). 
 I can use SAADC library to read ADC value. But to measure current I have to know the pick values of samples of AC current waveform to measure its rms value. 
 How</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Sep 2019 12:49:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52562/ac-240v-current-measurement-using-a-ct-with-nrf52832" /><item><title>RE: AC (240V) current measurement using a CT with NRF52832</title><link>https://devzone.nordicsemi.com/thread/211825?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 12:49:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86cdb58f-f449-4613-b3b0-5ab8e218c0d0</guid><dc:creator>bivay</dc:creator><description>&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AC (240V) current measurement using a CT with NRF52832</title><link>https://devzone.nordicsemi.com/thread/211812?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 12:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:108162f8-d9ef-43d0-bfe8-a83287e759cc</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Yes, with continuous sampling.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AC (240V) current measurement using a CT with NRF52832</title><link>https://devzone.nordicsemi.com/thread/211790?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 11:52:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed27eb5a-29f8-4015-9322-9433d68f9aa5</guid><dc:creator>bivay</dc:creator><description>&lt;p&gt;Can this will be achieved without requesting time slot or stopping BLE functionality.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AC (240V) current measurement using a CT with NRF52832</title><link>https://devzone.nordicsemi.com/thread/211702?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 08:01:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19961c60-d7d3-4a53-bae0-176364ee3e6c</guid><dc:creator>haakonsh</dc:creator><description>[quote user=""]Which mode is suitable for it like single shot, or continuous mode?[/quote]
&lt;p&gt;Continuous mode is best if you need accurate measurements(in time) and the easiest, but it&amp;nbsp;has a bit more current consumption than single-shot.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Single shot on the other hand is at the mercy of the BLE stack who&amp;#39;s got higher interrupt priority. One way to get around the interrupt priority is to use the&amp;nbsp;&lt;a title="Radio Timeslot API" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/concurrent_multiprotocol_tsl_api/radio_tsl_api.html?cp=3_4_2_0_8_1_6"&gt;Radio Timeslot API&lt;/a&gt;&amp;nbsp;of the SoftDevice&amp;#39;s&amp;nbsp;&lt;a title="Multiprotocol support" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/multiprotocol_operation/multiprotocol_support.html?cp=3_4_2_0_8"&gt;Multiprotocol support&lt;/a&gt;&amp;nbsp;to request a time slot where you have complete control of the MCU. For a 50Hz signal that requires 20ms of sampling + minor processing of the data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To find the maximum and minimum value of an array you can use the ARM CMSIS DSP library&amp;#39;s &lt;a href="http://www.keil.com/pack/doc/CMSIS/DSP/html/group__Max.html#gad1eabd31544fe59c414d9ce5bd0cc151"&gt;arm_max_f32&amp;nbsp;&lt;/a&gt;and &lt;a href="http://www.keil.com/pack/doc/CMSIS/DSP/html/group__Min.html#ga514e2c920c432e1a3df2cb03f01d2797"&gt;arm_min_f32&lt;/a&gt;, or:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Set min/max values for 10-bit precision
int16_t max_val = -1023;
int16_t min_val = 1023;

for(uint16_t i=0; i &amp;lt; SAMPLE_SIZE; i++)
{
    if(my_samples[i] &amp;gt; max_val)
    {
        max_val = my_samples[i];
    }
    else if(my_samples[i] &amp;lt; min_val)
    {
        min_val = my_samples[i];
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>