Energy monitoring with Arduino and current clamp sensor


SNS-CURRENT

SNS-CURRENT-CT013-100A is split core current transformer which allow you to non-intrusively measure AC current. It’s safe even for people who do not know electronics as there is no access to high voltages etc.

All you have to do is to clamp the current sensor around one of the wires where the current flows. Note if you clamp the both wires you will not measure anything as the current flow from one wire will neutralize the current flow from the other wire and the sum will be always 0.

SNS-CURRENT-1

The sensor easily clamps around the current flow wire:

SNS-CURRENT-2

On the other end the sensor have 3.5 mm audio jack where you can plug in mating connector and connect to Arduino.

As any other transformerSNS-CURRENT-CT013-100A has primary and secondary windings, the ratio is 100:0.05 i.e. when 100A flow through primary 1 turn wire the secondary coil will have 50mA.

The current transformers must always have burden resistor connected to the second coil, the purpose is to measure the voltage drop on this resistor which will be proportional to the input current. This burden resistor value also should be low enough to prevent core saturation.

Safety: Current transformers should never operate without burden resistor, as if left open very high voltage may generate through second winding which to cause sparking. So never use this sensor without connecting it to proper circuit with burden resistor!

ConnectingSNS-CURRENT-CT013-100A to Arduino is well explained here. We have nothing to add. Based on same setup we tested the emon library and it works perfectly.

We used for our setup OLIMEXINO-32U4 + MOD-LCD3310 and breadboard where two 10K 1% resistors + 10 uF capacitor make the bias circuit to the sensor with 33 ohm 1/4W 1% burden resistor connected.

arduino-sns

For device under test we used toaster and we clamped one of the heater wires:

toaster

The Arduino code is quite simple:

#include "lcd3310_GPIO.h"
#include <math.h>
#include "EmonLib.h"

EnergyMonitor emon1;
String toPrint1, toPrint2;
double Irms, thePower;
char buffer1[30], buffer2[30];

void setup()
{
 Serial.begin(9600);
 emon1.current(1, 111.1);  //pin for current measurement, calibration value
 pinMode(8, OUTPUT);   //enable UEXT power supply
 digitalWrite(8, LOW);
 LCDInit();   //initialize LCD display
 LCDContrast (0xFF);
 LCDClear();
 LCDUpdate();
}

void loop()
{
 Irms = emon1.calcIrms(1480); // measure current
 thePower = Irms*230.0;   // we assume voltage is 230VAC if you add transformer to connect to other input you can measure real voltage too

 toPrint1 = "Power:" + String((int)thePower) + "." + String(((unsigned int)(thePower*100))%100) + " ";
 toPrint2 = "Current:" + String((int)Irms) + "." + String(((unsigned int)(Irms*100))%100) + " ";
 toPrint1.toCharArray(buffer1, 30);
 toPrint2.toCharArray(buffer2, 30);
 LCDStr(0, (unsigned char *) buffer1, 0);
 LCDStr(2, (unsigned char *) buffer2, 0);
 LCDUpdate();   // print power and current
 delay(10);
}

as you see emon library is very easy to use, so with just few component andSNS-CURRENT-CT013-100A you can easily monitor your home power consumption, log it to the cloud with ESP8266 for instance etc.

When the toaster is switched on the power is displayed:

power

If you look at the first picture when the toaster is not switched on there is still some 0.012A displayed and fake 28 W energy registered, this is just noise on ADC input. The easiest way is to filter this noise in software and if energy is less 30W to ignore it.

6 Comments (+add yours?)

  1. Dobril Dobrilov
    Jan 27, 2016 @ 18:47:53

    Any idea why we get double value than showed value on Clamp Meters ?

    Reply

  2. R Sternschulte
    Mar 20, 2016 @ 23:04:34

    @Dobril
    It can be if the voltage and current are not in phase. This is typical for inductive loads (transformers and motors) or if there are several current frequencies on the cable (harmonics of 50 Hertz ac frequency) which is typical for switsching power supplies or motor inverters

    Reply

  3. Laurance
    Oct 09, 2016 @ 11:21:14

    What hardware would I need to add to monitor voltage if any? Can I use P=I*E in the code to have voltage displayed on the LCD screen and skip the hardware?

    Reply

  4. laurance
    Oct 10, 2016 @ 02:14:50

    What could I add to the code to display voltage values? Would that require any extra hardware?

    Reply

  5. akmal
    Nov 24, 2016 @ 15:50:55

    #include “lcd3310_GPIO.h”
    #include
    #include “EmonLib.h”

    where can i get this code?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: