Achraf Oukheir
Published

Current Sensor AC

A little project on how we can make an AC current sensor work, and measure current.

IntermediateFull instructions provided1 hour20,150
Current Sensor AC

Things used in this project

Story

Read more

Schematics

currentonly_bb_mGkUyhZ348.png

Code

Code Current Sensor

Arduino
Arduino Code.
If you take a look at openenergymonitor.org you can get an Arduino lib allowing to convert the raw data from analog input into a nice useful values.

EmonLib

Once downloaded and placed in your arduino librairies folder you can start the code
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance

void setup()
{  
  Serial.begin(9600);
  
  emon1.current(1, 5);             // Current: input pin, calibration.
}

void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
  

  Serial.print("Current : ");
  Serial.print(Irms);		       // Irms
    Serial.println(" mA");
}

Credits

Achraf Oukheir

Achraf Oukheir

8 projects • 14 followers

Comments