# Measuring current only

**URL:** <https://community.openenergymonitor.org/t/measuring-current-only/7304>\
**Category:** Hardware\
**Created:** [29 April 2018 13:36 UTC](https://community.openenergymonitor.org/t/measuring-current-only/7304 "2018-04-29T13:36:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alweerahman](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/a3d4f5/32.png) [@alweerahman](https://community.openenergymonitor.org/u/alweerahman)\
**Post date:** [29 April 2018 13:36 UTC](https://community.openenergymonitor.org/t/measuring-current-only/7304/1 "2018-04-29T13:36:25Z")

</div>

good evening everyone !  
Im using the YHDC sct-0013-000 current type CT and the sample code and hardware provided on this site. Can i know what is the meaning of the number inside the bracket based on the provided cosing fromthe open energy monitor… here is the coding

```auto
#include "EmonLib.h"
// Include Emon Library
EnergyMonitor emon1;
// Create an instance
void setup()
{
  Serial.begin(9600);

  emon1.current(1, 111.1); // Current: input pin, calibration.
}

void loop()
{
double Irms = emon1.calcIrms(1480); // Calculate Irms only
Serial.print(Irms*230.0); // Apparent power
  Serial.print(" ");
  Serial.println(Irms); // Irms
}

```

so what is the value 1480 means?

double Irms = emon1.calcIrms(1480)

thank you guys

hopefuly

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [29 April 2018 15:08 UTC](https://community.openenergymonitor.org/t/measuring-current-only/7304/2 "2018-04-29T15:08:46Z")

</div>

Look at the code and the comments in emonLib.cpp to see exactly how emonLib works and what is needed.

The number (1480) is no longer optimal. The sampling rates, measured with a standard emonTx V3.4 (and the emonPi is the same processor) are:  
calcIrms( ) - approx 5588 current samples per second.  
calcVI( ) - approx 2535 pairs of voltage & current samples per second.

See [Sampling rate of emonLib](https://community.openenergymonitor.org/t/sampling-rate-of-emonlib/4383) for more information.

---

<div class="post-metadata">

**Author:** ![mohammedbenhadine](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/mohammedbenhadine/32/15086_2.png) [@mohammedbenhadine](https://community.openenergymonitor.org/u/mohammedbenhadine)\
**Post date:** [17 September 2020 15:46 UTC](https://community.openenergymonitor.org/t/measuring-current-only/7304/3 "2020-09-17T15:46:53Z")

</div>

@Robert.Wall May i ask how did you accomplish the test to know how much samples the emonTx process in 1s ?  
In the code , the loop has no clear timing , it only depends on the HEX instructions after compilation of the code !, Have you count the HEX instructions in the loop section to determine the frequency ?

Thank you

---

<div class="post-metadata">

**Author:** ![mohammedbenhadine](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/mohammedbenhadine/32/15086_2.png) [@mohammedbenhadine](https://community.openenergymonitor.org/u/mohammedbenhadine)\
**Post date:** [17 September 2020 15:51 UTC](https://community.openenergymonitor.org/t/measuring-current-only/7304/4 "2020-09-17T15:51:16Z")

</div>

I found the answer [here](https://community.openenergymonitor.org/t/calcirms-sampling-rate-slower-than-expected/7544/3)

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [17 September 2020 16:07 UTC](https://community.openenergymonitor.org/t/measuring-current-only/7304/5 "2020-09-17T16:07:01Z")

</div>

It’s always a good idea to search for the answer _ **BEFORE** _ you post the question.
