Non-invasive AC Current Sensors are a good way to measure real consumption without altering the electrical composition of the elements to be analyzed. They work by magnetic induction, so that the field generated in the cable, used to power the device, induces a current in the transformer integrated in the sensor. In this way we can know what the current is in the power cable and therefore the actual consumption of the device to be measured.

Among the variety of sensors that are in the * SCT-013* series we will use the

*model because it is the only one that does not have an integrated resistance, allowing us to adjust the measuring range in which we work, as well as you can see in the table can measure currents up to*

**STC-013-000***.*

**100A**To connect to Arduino we have to use a very simple circuit, in which the values of its components will determine the measurement range. The Arduino itself also will impose limitations such as the maximum value of the input voltage in the digital analog converter and the number of bits (*10 bits*) which will have a resolution limited.

Being an *AC* measurement to do it with Arduino we have to create a virtual ground by a voltage divider because we can measure only positive values, so that the intermediate value is *2.5V*. This causes the maximum amplitude of the voltage is *2.5V*.

To assign the circuit values we take the European power system (*220V and 50Hz*). The * SCT-*013-000 will give us the current in the power cable in which this measuring divided by

*2000*(as the integrated transformer consists of

*2000*laps). Bearing all this in mind we must decide either what we want to measure maximum current or minimum current we want to detect. By having

**10 bits***, conversion will be*

**LSB***5V / 1024*so the minimum jump between digital values, our resolution will be

*. In this case I will define the accuracy is approximately*

**4,882mV***, the commercial value of resistance that comes closest to achieving this precision is*

**0,5Watts**

**3300***. With this value Rburden the maximum power that can be measured*

**ohms***and an accuracy of*

**235.7 Watts***.*

**0.46****Watts**Resistors ** R1** of the voltage divider must have a value much higher than the value of the Rburden so that the divisor is not affected. In this case

*will be enough. The capacitor, with a value of*

**100Kohms***will serve us.*

**10μF**To be more precise as far as possible we will also measure the virtual ground to adjust to the maximum the measures by software. Here below you have some sample code for Arduino.

const unsigned int numReadings = 200; //samples to calculate Vrms. int readingsVClamp[numReadings]; // samples of the sensor SCT-013-000 int readingsGND[numReadings]; // samples of the virtual ground float SumSqGND = 0; float SumSqVClamp = 0; float total = 0; int PinVClamp = A0; // Sensor SCT-013-000 int PinVirtGND = A1; // Virtual ground void setup() { Serial.begin(9600); // initialize all the readings to 0: for (int thisReading = 0; thisReading < numReadings; thisReading++) { readingsVClamp[thisReading] = 0; readingsGND[thisReading] = 0; } } void loop() { unsigned int i=0; SumSqGND = 0; SumSqVClamp = 0; total = 0; for (unsigned int i=0; i<numReadings; i++) { readingsVClamp[i] = analogRead(PinVClamp) - analogRead(PinVirtGND); delay(1); // } //Calculate Vrms for (unsigned int i=0; i<numReadings; i++) { SumSqVClamp = SumSqVClamp + sq((float)readingsVClamp[i]); } total = sqrt(SumSqVClamp/numReadings); total= (total*(float)2/3); // Rburden=3300 ohms, LBS= 0,004882 V (5/1024) // Transformer of 2000 laps (SCT-013-000). // 5*220*2000/(3300*1024)= 2/3 (aprox) Serial.println(total); delay(1500); }