How to calculate instantaneous current using SCT-013-030

hi guys, im new here so pls bear with me. i just want to know the code to calculate the instantaneous current for our current sensor SCT-013-030 that is connected to arduino uno r3 and ac single phase motor with 1.5hp. here’s the code that we are currently using:

#include "EmonLib.h"  //Include Emon Library

#define VOLT_CAL 148.7
#define CURRENT_CAL 111.1

EnergyMonitor emon1;  //create an instance

void setup()
{
    Serial.begin(9600);

    emon1.voltage(1, VOLT_CAL, 1.7);  //Voltage: input pin, calibration, phase_shift
    emon1.current(0, CURRENT_CAL);  //Current: input pin, calibration.
    
}

void loop()
{
  emon1.calcVI(20,2000);  //Calculate all. No.of half wavelength (crossings), time-out

  float currentDraw = emon1.Irms;  //extract Irms into Variable
  float supplyVoltage = emon1.Vrms; //extract Vrms into Variable

  Serial.print("Current: ");
  Serial.println(currentDraw);
  
}

Welcome, @HirayaManawari, to the OEM forum.

I am not sure what you want to know. To me, the instantaneous current is continuously varying, according to the (approximately) sinusoidal wave that you expect. But emonLib does not store every sample, it uses it immediately and discards it, only keeping the accumulating (current2) value to give your the rms average current.

If you want to record individual samples, to print to the monitor, then you must write your own sketch. Your problem will be the limited amount of memory available to you. Because you cannot send the samples out fast enough, you will need to record and store a limited number in an array - a few hundred, perhaps two or 3 cycles - and then send them when recording has finished.